| Index: mojo/shell/in_process_dynamic_service_runner.cc
|
| diff --git a/mojo/shell/in_process_dynamic_service_runner.cc b/mojo/shell/in_process_dynamic_service_runner.cc
|
| index 9030d59927604cc4c33d5795f78e63f661217603..949e7c41d1e19fa8c2d3024558b0cedbde94949b 100644
|
| --- a/mojo/shell/in_process_dynamic_service_runner.cc
|
| +++ b/mojo/shell/in_process_dynamic_service_runner.cc
|
| @@ -11,6 +11,7 @@
|
| #include "base/logging.h"
|
| #include "base/message_loop/message_loop_proxy.h"
|
| #include "base/scoped_native_library.h"
|
| +#include "mojo/public/platform/native/system_thunks.h"
|
|
|
| namespace mojo {
|
| namespace shell {
|
| @@ -63,6 +64,22 @@ void InProcessDynamicServiceRunner::Run() {
|
| break;
|
| }
|
|
|
| + MojoSetSystemThunksFn mojo_set_system_thunks_fn =
|
| + reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer(
|
| + "MojoSetSystemThunks"));
|
| + if (!mojo_set_system_thunks_fn) {
|
| + LOG(ERROR) << "Entrypoint MojoSetSystemThunks not found";
|
| + break;
|
| + }
|
| + MojoSystemThunks system_thunks = MojoMakeSystemThunks();
|
| + size_t expected_size = mojo_set_system_thunks_fn(&system_thunks);
|
| + if (expected_size > sizeof(MojoSystemThunks)) {
|
| + LOG(ERROR)
|
| + << "Invalid DSO. Expected MojoSystemThunks size: "
|
| + << expected_size;
|
| + break;
|
| + }
|
| +
|
| typedef MojoResult (*MojoMainFunction)(MojoHandle);
|
| MojoMainFunction main_function = reinterpret_cast<MojoMainFunction>(
|
| app_library.GetFunctionPointer("MojoMain"));
|
|
|