| 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/app_child_process.h" | 5 #include "mojo/shell/app_child_process.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/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 static void StartAppOnMainThread(const base::FilePath& app_path, | 226 static void StartAppOnMainThread(const base::FilePath& app_path, |
| 227 ScopedMessagePipeHandle service) { | 227 ScopedMessagePipeHandle service) { |
| 228 // TODO(vtl): This is copied from in_process_dynamic_service_runner.cc. | 228 // TODO(vtl): This is copied from in_process_dynamic_service_runner.cc. |
| 229 DVLOG(2) << "Loading/running Mojo app from " << app_path.value() | 229 DVLOG(2) << "Loading/running Mojo app from " << app_path.value() |
| 230 << " out of process"; | 230 << " out of process"; |
| 231 | 231 |
| 232 base::ScopedClosureRunner app_deleter( | 232 base::ScopedClosureRunner app_deleter( |
| 233 base::Bind(base::IgnoreResult(&base::DeleteFile), app_path, false)); | 233 base::Bind(base::IgnoreResult(&base::DeleteFile), app_path, false)); |
| 234 | 234 |
| 235 do { | 235 do { |
| 236 std::string load_error; | 236 base::NativeLibraryLoadError load_error; |
| 237 base::ScopedNativeLibrary app_library( | 237 base::ScopedNativeLibrary app_library( |
| 238 base::LoadNativeLibrary(app_path, &load_error)); | 238 base::LoadNativeLibrary(app_path, &load_error)); |
| 239 if (!app_library.is_valid()) { | 239 if (!app_library.is_valid()) { |
| 240 LOG(ERROR) << "Failed to load library (error: " << load_error << ")"; | 240 LOG(ERROR) << "Failed to load library (error: " << load_error.ToString() |
| 241 << ")"; |
| 241 break; | 242 break; |
| 242 } | 243 } |
| 243 | 244 |
| 244 typedef MojoResult (*MojoMainFunction)(MojoHandle); | 245 typedef MojoResult (*MojoMainFunction)(MojoHandle); |
| 245 MojoMainFunction main_function = reinterpret_cast<MojoMainFunction>( | 246 MojoMainFunction main_function = reinterpret_cast<MojoMainFunction>( |
| 246 app_library.GetFunctionPointer("MojoMain")); | 247 app_library.GetFunctionPointer("MojoMain")); |
| 247 if (!main_function) { | 248 if (!main_function) { |
| 248 LOG(ERROR) << "Entrypoint MojoMain not found"; | 249 LOG(ERROR) << "Entrypoint MojoMain not found"; |
| 249 break; | 250 break; |
| 250 } | 251 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 blocker.Block(); | 293 blocker.Block(); |
| 293 | 294 |
| 294 app_context.controller_runner()->PostTask( | 295 app_context.controller_runner()->PostTask( |
| 295 FROM_HERE, | 296 FROM_HERE, |
| 296 base::Bind(&AppChildControllerImpl::Shutdown, | 297 base::Bind(&AppChildControllerImpl::Shutdown, |
| 297 base::Unretained(app_context.controller()))); | 298 base::Unretained(app_context.controller()))); |
| 298 } | 299 } |
| 299 | 300 |
| 300 } // namespace shell | 301 } // namespace shell |
| 301 } // namespace mojo | 302 } // namespace mojo |
| OLD | NEW |