| 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/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 "MojoSetGLES2ImplChromiumSyncPointThunks", | 128 "MojoSetGLES2ImplChromiumSyncPointThunks", |
| 129 &app_library_); | 129 &app_library_); |
| 130 } | 130 } |
| 131 // Unlike system thunks, we don't warn on a lack of GLES2 thunks because | 131 // Unlike system thunks, we don't warn on a lack of GLES2 thunks because |
| 132 // not everything is a visual app. | 132 // not everything is a visual app. |
| 133 | 133 |
| 134 typedef MojoResult (*MojoMainFunction)(MojoHandle); | 134 typedef MojoResult (*MojoMainFunction)(MojoHandle); |
| 135 MojoMainFunction main_function = reinterpret_cast<MojoMainFunction>( | 135 MojoMainFunction main_function = reinterpret_cast<MojoMainFunction>( |
| 136 app_library_.GetFunctionPointer("MojoMain")); | 136 app_library_.GetFunctionPointer("MojoMain")); |
| 137 if (!main_function) { | 137 if (!main_function) { |
| 138 LOG(ERROR) << "Entrypoint MojoMain not found"; | 138 LOG(ERROR) << "Entrypoint MojoMain not found: " << app_path_.value(); |
| 139 break; | 139 break; |
| 140 } | 140 } |
| 141 | 141 |
| 142 // |MojoMain()| takes ownership of the service handle. | 142 // |MojoMain()| takes ownership of the service handle. |
| 143 MojoResult result = main_function(service_handle_.release().value()); | 143 MojoResult result = main_function(service_handle_.release().value()); |
| 144 if (result < MOJO_RESULT_OK) | 144 if (result < MOJO_RESULT_OK) |
| 145 LOG(ERROR) << "MojoMain returned an error: " << result; | 145 LOG(ERROR) << "MojoMain returned an error: " << result; |
| 146 } while (false); | 146 } while (false); |
| 147 | 147 |
| 148 bool success = app_completed_callback_runner_.Run(); | 148 bool success = app_completed_callback_runner_.Run(); |
| 149 app_completed_callback_runner_.Reset(); | 149 app_completed_callback_runner_.Reset(); |
| 150 LOG_IF(ERROR, !success) << "Failed post run app_completed_callback"; | 150 LOG_IF(ERROR, !success) << "Failed post run app_completed_callback"; |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace shell | 153 } // namespace shell |
| 154 } // namespace mojo | 154 } // namespace mojo |
| OLD | NEW |