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

Unified Diff: chrome/app_shim/chrome_main_app_mode_mac.mm

Issue 2295063002: Use ChannelMojo between app shims and the browser process. (Closed)
Patch Set: Created 4 years, 3 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 | « chrome/app_shim/DEPS ('k') | chrome/browser/apps/app_shim/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app_shim/chrome_main_app_mode_mac.mm
diff --git a/chrome/app_shim/chrome_main_app_mode_mac.mm b/chrome/app_shim/chrome_main_app_mode_mac.mm
index 5bc6a5e0ed4cb1e2d7025ad679486f2e480bd994..e3f8355f84efe708ae62999162662ee8dd4d7f59 100644
--- a/chrome/app_shim/chrome_main_app_mode_mac.mm
+++ b/chrome/app_shim/chrome_main_app_mode_mac.mm
@@ -34,9 +34,15 @@
#include "chrome/common/mac/app_mode_common.h"
#include "chrome/common/mac/app_shim_messages.h"
#include "chrome/grit/generated_resources.h"
+#include "ipc/ipc_channel_mojo.h"
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_message.h"
+#include "mojo/edk/embedder/embedder.h"
+#include "mojo/edk/embedder/named_platform_handle.h"
+#include "mojo/edk/embedder/named_platform_handle_utils.h"
+#include "mojo/edk/embedder/scoped_ipc_support.h"
+#include "mojo/edk/embedder/scoped_platform_handle.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
@@ -212,9 +218,12 @@ void AppShimController::Init() {
void AppShimController::CreateChannelAndSendLaunchApp(
const base::FilePath& socket_path) {
- IPC::ChannelHandle handle(socket_path.value());
- channel_ = IPC::ChannelProxy::Create(handle, IPC::Channel::MODE_NAMED_CLIENT,
- this, g_io_thread->task_runner().get());
+ channel_ = IPC::ChannelProxy::Create(
+ IPC::ChannelMojo::CreateClientFactory(
+ mojo::edk::ConnectToPeerProcess(mojo::edk::CreateClientHandle(
+ mojo::edk::NamedPlatformHandle(socket_path.value()))),
+ g_io_thread->task_runner().get()),
+ this, g_io_thread->task_runner().get());
bool launched_by_chrome = base::CommandLine::ForCurrentProcess()->HasSwitch(
app_mode::kLaunchedByChromeProcessId);
@@ -629,6 +638,9 @@ int ChromeAppModeStart_v4(const app_mode::ChromeAppModeInfo* info) {
io_thread->StartWithOptions(io_thread_options);
g_io_thread = io_thread;
+ mojo::edk::Init();
+ mojo::edk::ScopedIPCSupport ipc_support(io_thread->task_runner());
+
// Find already running instances of Chrome.
pid_t pid = -1;
std::string chrome_process_id =
« no previous file with comments | « chrome/app_shim/DEPS ('k') | chrome/browser/apps/app_shim/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698