OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "mojo/public/cpp/application/application_runner.h" | 5 #include "mojo/public/cpp/application/application_runner.h" |
6 | 6 |
7 #include "mojo/public/cpp/application/application_delegate.h" | 7 #include "mojo/public/cpp/application/application_delegate.h" |
8 #include "mojo/public/cpp/application/application_impl.h" | 8 #include "mojo/public/cpp/application/application_impl.h" |
9 #include "mojo/public/cpp/environment/environment.h" | 9 #include "mojo/public/cpp/environment/environment.h" |
10 #include "mojo/public/cpp/environment/logging.h" | 10 #include "mojo/public/cpp/environment/logging.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 MojoResult ApplicationRunner::Run(MojoHandle app_request_handle) { | 43 MojoResult ApplicationRunner::Run(MojoHandle app_request_handle) { |
44 MOJO_DCHECK(!g_running) | 44 MOJO_DCHECK(!g_running) |
45 << "Another ApplicationRunner::Run() is already running!"; | 45 << "Another ApplicationRunner::Run() is already running!"; |
46 | 46 |
47 g_running = true; | 47 g_running = true; |
48 Environment env; | 48 Environment env; |
49 { | 49 { |
50 RunLoop loop; | 50 RunLoop loop; |
51 ApplicationImpl app(delegate_.get(), | 51 ApplicationImpl app(delegate_.get(), |
52 MakeRequest<Application>(MakeScopedHandle( | 52 InterfaceRequest<Application>(MakeScopedHandle( |
53 MessagePipeHandle(app_request_handle)))); | 53 MessagePipeHandle(app_request_handle)))); |
54 loop.Run(); | 54 loop.Run(); |
55 } | 55 } |
56 | 56 |
57 delegate_.reset(); | 57 delegate_.reset(); |
58 | 58 |
59 g_running = false; | 59 g_running = false; |
60 | 60 |
61 return MOJO_RESULT_OK; | 61 return MOJO_RESULT_OK; |
62 } | 62 } |
63 | 63 |
64 } // namespace mojo | 64 } // namespace mojo |
OLD | NEW |