| 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/shell/in_process_dynamic_service_runner.h" | 5 #include "mojo/shell/in_process_dynamic_service_runner.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/message_loop/message_loop_proxy.h" | 12 #include "base/message_loop/message_loop_proxy.h" |
| 13 #include "base/scoped_native_library.h" | 13 #include "base/scoped_native_library.h" |
| 14 #include "mojo/public/platform/native/system_thunks.h" | 14 #include "mojo/public/platform/native/system_thunks.h" |
| 15 | 15 |
| 16 namespace mojo { | 16 namespace mojo { |
| 17 namespace shell { | 17 namespace shell { |
| 18 | 18 |
| 19 InProcessDynamicServiceRunner::InProcessDynamicServiceRunner( | 19 InProcessDynamicServiceRunner::InProcessDynamicServiceRunner( |
| 20 Context* /*context*/) | 20 Context* context) |
| 21 : thread_(this, "app_thread") { | 21 : keep_alive_(context), |
| 22 thread_(this, "app_thread") { |
| 22 } | 23 } |
| 23 | 24 |
| 24 InProcessDynamicServiceRunner::~InProcessDynamicServiceRunner() { | 25 InProcessDynamicServiceRunner::~InProcessDynamicServiceRunner() { |
| 25 if (thread_.HasBeenStarted()) { | 26 if (thread_.HasBeenStarted()) { |
| 26 DCHECK(!thread_.HasBeenJoined()); | 27 DCHECK(!thread_.HasBeenJoined()); |
| 27 thread_.Join(); | 28 thread_.Join(); |
| 28 } | 29 } |
| 29 } | 30 } |
| 30 | 31 |
| 31 void InProcessDynamicServiceRunner::Start( | 32 void InProcessDynamicServiceRunner::Start( |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 LOG(ERROR) << "MojoMain returned an error: " << result; | 93 LOG(ERROR) << "MojoMain returned an error: " << result; |
| 93 } while (false); | 94 } while (false); |
| 94 | 95 |
| 95 bool success = app_completed_callback_runner_.Run(); | 96 bool success = app_completed_callback_runner_.Run(); |
| 96 app_completed_callback_runner_.Reset(); | 97 app_completed_callback_runner_.Reset(); |
| 97 LOG_IF(ERROR, !success) << "Failed post run app_completed_callback"; | 98 LOG_IF(ERROR, !success) << "Failed post run app_completed_callback"; |
| 98 } | 99 } |
| 99 | 100 |
| 100 } // namespace shell | 101 } // namespace shell |
| 101 } // namespace mojo | 102 } // namespace mojo |
| OLD | NEW |