Index: ppapi/nacl_irt/plugin_startup.cc |
diff --git a/ppapi/nacl_irt/plugin_startup.cc b/ppapi/nacl_irt/plugin_startup.cc |
index d234a2d8e0c2d952b66ec51f9e33f9eef5ccf6da..2b9270ef302544ba577420cea49dcf61c7ba286c 100644 |
--- a/ppapi/nacl_irt/plugin_startup.cc |
+++ b/ppapi/nacl_irt/plugin_startup.cc |
@@ -65,13 +65,17 @@ void SetIPCChannelHandles( |
g_manifest_service_handle = new IPC::ChannelHandle(manifest_service_handle); |
} |
-void StartUpPlugin() { |
+void StartUpPlugin(bool initialize_mojo) { |
// The start up must be called only once. |
DCHECK(!g_shutdown_event); |
DCHECK(!g_io_thread); |
- // The Mojo EDK must be initialized before using IPC. |
- mojo::edk::Init(); |
+ // In some cases, Mojo has already been initialized, so we need to avoid |
+ // double-initializing it. |
+ if (initialize_mojo) { |
+ // The Mojo EDK must be initialized before using IPC. |
+ mojo::edk::Init(); |
+ } |
g_shutdown_event = |
new base::WaitableEvent(base::WaitableEvent::ResetPolicy::MANUAL, |