| Index: content/ppapi_plugin/ppapi_thread.cc
|
| diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc
|
| index 85b2c6cb1995e66e9669e38a5b6e769f717a3f9c..efdbbc32a8e4baef39eff7f24c9129bcef61095b 100644
|
| --- a/content/ppapi_plugin/ppapi_thread.cc
|
| +++ b/content/ppapi_plugin/ppapi_thread.cc
|
| @@ -36,6 +36,7 @@
|
| #include "content/public/common/content_switches.h"
|
| #include "content/public/common/pepper_plugin_info.h"
|
| #include "content/public/common/sandbox_init.h"
|
| +#include "content/public/common/service_manager_connection.h"
|
| #include "ipc/ipc_channel_handle.h"
|
| #include "ipc/ipc_platform_file.h"
|
| #include "ipc/ipc_sync_channel.h"
|
| @@ -48,7 +49,9 @@
|
| #include "ppapi/proxy/plugin_message_filter.h"
|
| #include "ppapi/proxy/ppapi_messages.h"
|
| #include "ppapi/proxy/resource_reply_thread_registrar.h"
|
| +#include "services/service_manager/public/cpp/connector.h"
|
| #include "services/service_manager/public/cpp/interface_provider.h"
|
| +#include "services/ui/public/interfaces/constants.mojom.h"
|
| #include "third_party/WebKit/public/web/WebKit.h"
|
| #include "ui/base/ui_base_switches.h"
|
|
|
| @@ -102,6 +105,13 @@ static void WarmupWindowsLocales(const ppapi::PpapiPermissions& permissions) {
|
|
|
| #endif
|
|
|
| +#if defined(USE_AURA)
|
| +static bool IsRunningInMash() {
|
| + const base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
|
| + return cmdline->HasSwitch(switches::kIsRunningInMash);
|
| +}
|
| +#endif
|
| +
|
| namespace content {
|
|
|
| typedef int32_t (*InitializeBrokerFunc)
|
| @@ -133,8 +143,18 @@ PpapiThread::PpapiThread(const base::CommandLine& command_line, bool is_broker)
|
| // allocator.
|
| if (!command_line.HasSwitch(switches::kSingleProcess)) {
|
| discardable_memory::mojom::DiscardableSharedMemoryManagerPtr manager_ptr;
|
| - ChildThread::Get()->GetRemoteInterfaces()->GetInterface(
|
| - mojo::GetProxy(&manager_ptr));
|
| + bool manager_initialized = false;
|
| +#if defined(USE_AURA)
|
| + if (IsRunningInMash()) {
|
| + GetServiceManagerConnection()->GetConnector()->ConnectToInterface(
|
| + ui::mojom::kServiceName, &manager_ptr);
|
| + manager_initialized = true;
|
| + }
|
| +#endif
|
| + if (!manager_initialized) {
|
| + ChildThread::Get()->GetRemoteInterfaces()->GetInterface(
|
| + mojo::GetProxy(&manager_ptr));
|
| + }
|
| discardable_shared_memory_manager_ = base::MakeUnique<
|
| discardable_memory::ClientDiscardableSharedMemoryManager>(
|
| std::move(manager_ptr), GetIOTaskRunner());
|
|
|