Index: ppapi/nacl_irt/plugin_startup.cc |
diff --git a/ppapi/nacl_irt/plugin_startup.cc b/ppapi/nacl_irt/plugin_startup.cc |
index c7b818dd11ad4e392186fc86ba7dc62444003e1c..66521e306370b98eb2e22fd9e30a9072a537ebb5 100644 |
--- a/ppapi/nacl_irt/plugin_startup.cc |
+++ b/ppapi/nacl_irt/plugin_startup.cc |
@@ -59,13 +59,17 @@ void SetIPCFileDescriptors( |
g_manifest_service_fd = manifest_service_fd; |
} |
-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, |