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

Unified Diff: content/common/mojo/channel_init.cc

Issue 1554443003: Stop linking in the old Mojo EDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge and fix new flaky test Created 4 years, 11 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 | « content/common/mojo/channel_init.h ('k') | content/content_app.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/mojo/channel_init.cc
diff --git a/content/common/mojo/channel_init.cc b/content/common/mojo/channel_init.cc
index 967fb10be605c4e8e32d7e03709e5946a02b5a87..f27d1e6388e1499d39f29a567364d94c7c6191ed 100644
--- a/content/common/mojo/channel_init.cc
+++ b/content/common/mojo/channel_init.cc
@@ -11,52 +11,23 @@
#include "base/lazy_instance.h"
#include "base/message_loop/message_loop.h"
#include "base/thread_task_runner_handle.h"
-#include "third_party/mojo/src/mojo/edk/embedder/embedder.h"
+#include "mojo/edk/embedder/embedder.h"
+#include "mojo/edk/embedder/scoped_platform_handle.h"
namespace content {
-ChannelInit::ChannelInit() : channel_info_(nullptr), weak_factory_(this) {}
+ChannelInit::ChannelInit() {
+}
ChannelInit::~ChannelInit() {
- if (channel_info_)
- mojo::embedder::DestroyChannel(channel_info_,
- base::Bind(&base::DoNothing), nullptr);
}
mojo::ScopedMessagePipeHandle ChannelInit::Init(
base::PlatformFile file,
scoped_refptr<base::TaskRunner> io_thread_task_runner) {
- scoped_ptr<IPC::ScopedIPCSupport> ipc_support(
- new IPC::ScopedIPCSupport(io_thread_task_runner));
- mojo::ScopedMessagePipeHandle message_pipe = mojo::embedder::CreateChannel(
- mojo::embedder::ScopedPlatformHandle(
- mojo::embedder::PlatformHandle(file)),
- base::Bind(&ChannelInit::OnCreatedChannel, weak_factory_.GetWeakPtr(),
- base::Passed(&ipc_support)),
- base::ThreadTaskRunnerHandle::Get());
- return message_pipe;
-}
-
-void ChannelInit::WillDestroySoon() {
- if (channel_info_)
- mojo::embedder::WillDestroyChannelSoon(channel_info_);
-}
-
-// static
-void ChannelInit::OnCreatedChannel(
- base::WeakPtr<ChannelInit> self,
- scoped_ptr<IPC::ScopedIPCSupport> ipc_support,
- mojo::embedder::ChannelInfo* channel) {
- // If |self| was already destroyed, shut the channel down.
- if (!self) {
- mojo::embedder::DestroyChannel(channel,
- base::Bind(&base::DoNothing), nullptr);
- return;
- }
-
- DCHECK(!self->channel_info_);
- self->channel_info_ = channel;
- self->ipc_support_ = std::move(ipc_support);
+ ipc_support_.reset(new IPC::ScopedIPCSupport(io_thread_task_runner));
+ return mojo::edk::CreateMessagePipe(
+ mojo::edk::ScopedPlatformHandle(mojo::edk::PlatformHandle(file)));
}
} // namespace content
« no previous file with comments | « content/common/mojo/channel_init.h ('k') | content/content_app.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698