Index: mojo/shell/app_child_process.cc |
diff --git a/mojo/shell/app_child_process.cc b/mojo/shell/app_child_process.cc |
index 79aaa49e8040492381a2e53cb49db160f6af3751..8690e308d243a21f3042943526218d417c442901 100644 |
--- a/mojo/shell/app_child_process.cc |
+++ b/mojo/shell/app_child_process.cc |
@@ -23,6 +23,7 @@ |
#include "mojo/edk/embedder/simple_platform_support.h" |
#include "mojo/public/cpp/system/core.h" |
#include "mojo/shell/app_child_process.mojom.h" |
+#include "mojo/shell/dynamic_service_runner.h" |
namespace mojo { |
namespace shell { |
@@ -226,30 +227,8 @@ class AppChildControllerImpl : public InterfaceImpl<AppChildController> { |
DVLOG(2) << "Loading/running Mojo app from " << app_path.value() |
<< " out of process"; |
- do { |
- base::NativeLibraryLoadError load_error; |
- base::ScopedNativeLibrary app_library( |
- base::LoadNativeLibrary(app_path, &load_error)); |
- if (!app_library.is_valid()) { |
- LOG(ERROR) << "Failed to load library (error: " << load_error.ToString() |
- << ")"; |
- break; |
- } |
- |
- typedef MojoResult (*MojoMainFunction)(MojoHandle); |
- MojoMainFunction main_function = reinterpret_cast<MojoMainFunction>( |
- app_library.GetFunctionPointer("MojoMain")); |
- if (!main_function) { |
- LOG(ERROR) << "Entrypoint MojoMain not found"; |
- break; |
- } |
- |
- // TODO(vtl): Report the result back to our parent process. |
- // |MojoMain()| takes ownership of the service handle. |
- MojoResult result = main_function(service.release().value()); |
- if (result < MOJO_RESULT_OK) |
- LOG(ERROR) << "MojoMain returned an error: " << result; |
- } while (false); |
+ base::ScopedNativeLibrary app_library( |
DaveMoore
2014/10/29 22:15:13
This keeps the semantics of unloading the library.
viettrungluu
2014/10/29 23:11:43
We probably shouldn't. (I don't know if TLS destru
DaveMoore
2014/10/30 15:32:56
Done.
|
+ DynamicServiceRunner::LoadAndRunService(app_path, service.Pass())); |
} |
base::ThreadChecker thread_checker_; |