Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1446)

Unified Diff: mojo/shell/in_process_dynamic_service_runner.cc

Issue 231353002: Make mojo_system static and mojo_system_impl a component, never use both (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix the mac loader path dependencies Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/system/core_private.cc ('k') | mojo/system/core.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..660418083c31cf94f7737bd074893dea4103d874 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,20 @@ void InProcessDynamicServiceRunner::Run() {
break;
}
+ MojoSetSystemThunksFn mojo_set_system_thunks_fn =
+ reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer(
+ "MojoSetSystemThunks"));
+ if (mojo_set_system_thunks_fn) {
+ 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"));
« no previous file with comments | « mojo/public/system/core_private.cc ('k') | mojo/system/core.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698