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

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: Cleanup 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
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..72d41c169e518a354b71f72df9861096df00797b 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/mojo_core.h"
namespace mojo {
namespace shell {
@@ -63,6 +64,21 @@ void InProcessDynamicServiceRunner::Run() {
break;
}
+ typedef MojoResult (*SetMojoCoreFn)(MojoCore*);
+ SetMojoCoreFn set_mojo_core_fn = reinterpret_cast<SetMojoCoreFn>(
viettrungluu 2014/04/09 20:26:52 static_cast
DaveMoore 2014/04/09 22:49:08 static_casts aren't allowed on things like this:
+ app_library.GetFunctionPointer("SetMojoCore"));
+ if (!set_mojo_core_fn) {
+ LOG(ERROR) << "Entrypoint SetMojoCore not found";
+ break;
+ }
+ MojoCore mojo_core_impl = GetMojoCoreImpl();
+ MojoResult set_result = set_mojo_core_fn(&mojo_core_impl);
+ if (set_result != MOJO_RESULT_OK) {
+ LOG(ERROR)
+ << "Invalid DSO. Expected MojoCore size: "
+ << mojo_core_impl.size;
+ }
+
typedef MojoResult (*MojoMainFunction)(MojoHandle);
MojoMainFunction main_function = reinterpret_cast<MojoMainFunction>(
app_library.GetFunctionPointer("MojoMain"));

Powered by Google App Engine
This is Rietveld 408576698