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

Unified Diff: chrome/browser/apps/app_shim/app_shim_host_mac.cc

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
Index: chrome/browser/apps/app_shim/app_shim_host_mac.cc
diff --git a/chrome/browser/apps/app_shim/app_shim_host_mac.cc b/chrome/browser/apps/app_shim/app_shim_host_mac.cc
index edcce64de6ef6073d4e4529fa3429dba6e4453bf..59ba26db16155660097f98ad60cf72ebc34c7ff6 100644
--- a/chrome/browser/apps/app_shim/app_shim_host_mac.cc
+++ b/chrome/browser/apps/app_shim/app_shim_host_mac.cc
@@ -4,13 +4,17 @@
#include "chrome/browser/apps/app_shim/app_shim_host_mac.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "chrome/browser/apps/app_shim/app_shim_handler_mac.h"
#include "chrome/common/mac/app_shim_messages.h"
#include "content/public/browser/browser_thread.h"
+#include "ipc/ipc_channel_mojo.h"
#include "ipc/ipc_channel_proxy.h"
+#include "mojo/edk/embedder/embedder.h"
AppShimHost::AppShimHost() : initial_launch_finished_(false) {}
@@ -21,11 +25,17 @@ AppShimHost::~AppShimHost() {
handler->OnShimClose(this);
}
-void AppShimHost::ServeChannel(const IPC::ChannelHandle& handle) {
+void AppShimHost::ServeChannel(mojo::edk::ScopedPlatformHandle handle) {
DCHECK(CalledOnValidThread());
DCHECK(!channel_.get());
+
channel_ = IPC::ChannelProxy::Create(
- handle, IPC::Channel::MODE_SERVER, this,
+ IPC::ChannelMojo::CreateServerFactory(
+ mojo::edk::ConnectToPeerProcess(std::move(handle)),
+ content::BrowserThread::GetTaskRunnerForThread(
+ content::BrowserThread::IO)
+ .get()),
+ this,
content::BrowserThread::GetTaskRunnerForThread(content::BrowserThread::IO)
.get());
}

Powered by Google App Engine
This is Rietveld 408576698