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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 &app_library_)) { | 105 &app_library_)) { |
106 // If we have the control thunks, we probably also have the | 106 // If we have the control thunks, we probably also have the |
107 // GLES2 implementation thunks. | 107 // GLES2 implementation thunks. |
108 if (!SetThunks(&MojoMakeGLES2ImplThunks, | 108 if (!SetThunks(&MojoMakeGLES2ImplThunks, |
109 "MojoSetGLES2ImplThunks", | 109 "MojoSetGLES2ImplThunks", |
110 &app_library_)) { | 110 &app_library_)) { |
111 // In the component build, Mojo Apps link against mojo_gles2_impl. | 111 // In the component build, Mojo Apps link against mojo_gles2_impl. |
112 #if !defined(COMPONENT_BUILD) | 112 #if !defined(COMPONENT_BUILD) |
113 // Warn on this really weird case: The library requires the GLES2 | 113 // Warn on this really weird case: The library requires the GLES2 |
114 // control functions, but doesn't require the GLES2 implementation. | 114 // control functions, but doesn't require the GLES2 implementation. |
115 LOG(WARNING) << app_path_.value() | 115 LOG(WARNING) << "App library has MojoSetGLES2ControlThunks, but " |
116 << " has MojoSetGLES2ControlThunks, " | 116 "doesn't have MojoSetGLES2ImplThunks."; |
117 "but doesn't have MojoSetGLES2ImplThunks."; | |
118 #endif | 117 #endif |
119 } | 118 } |
120 | 119 |
121 // If the application is using GLES2 extension points, register those | 120 // If the application is using GLES2 extension points, register those |
122 // thunks. Applications may use or not use any of these, so don't warn if | 121 // thunks. Applications may use or not use any of these, so don't warn if |
123 // they are missing. | 122 // they are missing. |
124 SetThunks(MojoMakeGLES2ImplChromiumTextureMailboxThunks, | 123 SetThunks(MojoMakeGLES2ImplChromiumTextureMailboxThunks, |
125 "MojoSetGLES2ImplChromiumTextureMailboxThunks", | 124 "MojoSetGLES2ImplChromiumTextureMailboxThunks", |
126 &app_library_); | 125 &app_library_); |
127 SetThunks(MojoMakeGLES2ImplChromiumSyncPointThunks, | 126 SetThunks(MojoMakeGLES2ImplChromiumSyncPointThunks, |
(...skipping 10 matching lines...) Expand all Loading... |
138 LOG(ERROR) << "Entrypoint MojoMain not found: " << app_path_.value(); | 137 LOG(ERROR) << "Entrypoint MojoMain not found: " << app_path_.value(); |
139 break; | 138 break; |
140 } | 139 } |
141 | 140 |
142 // |MojoMain()| takes ownership of the service handle. | 141 // |MojoMain()| takes ownership of the service handle. |
143 MojoResult result = main_function(service_handle_.release().value()); | 142 MojoResult result = main_function(service_handle_.release().value()); |
144 if (result < MOJO_RESULT_OK) | 143 if (result < MOJO_RESULT_OK) |
145 LOG(ERROR) << "MojoMain returned an error: " << result; | 144 LOG(ERROR) << "MojoMain returned an error: " << result; |
146 } while (false); | 145 } while (false); |
147 | 146 |
148 app_completed_callback_runner_.Run(); | 147 bool success = app_completed_callback_runner_.Run(); |
149 app_completed_callback_runner_.Reset(); | 148 app_completed_callback_runner_.Reset(); |
| 149 LOG_IF(ERROR, !success) << "Failed post run app_completed_callback"; |
150 } | 150 } |
151 | 151 |
152 } // namespace shell | 152 } // namespace shell |
153 } // namespace mojo | 153 } // namespace mojo |
OLD | NEW |