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

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

Issue 1676913002: [mojo] Delete third_party/mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 10 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: content/common/mojo/channel_init.cc
diff --git a/content/common/mojo/channel_init.cc b/content/common/mojo/channel_init.cc
index 8eb156a044ee8d3379fda026bac7cc2e7f2e9fda..5249ccaf9eb490a968b9e478778acd11b8439dea 100644
--- a/content/common/mojo/channel_init.cc
+++ b/content/common/mojo/channel_init.cc
@@ -15,7 +15,6 @@
#include "base/task_runner.h"
#include "base/thread_task_runner_handle.h"
#include "mojo/edk/embedder/embedder.h"
-#include "third_party/mojo/src/mojo/edk/embedder/embedder.h"
namespace content {
@@ -30,13 +29,9 @@ void CallMessagePipeCallbackOnThread(
} // namespace
-ChannelInit::ChannelInit() : channel_info_(nullptr), weak_factory_(this) {}
+ChannelInit::ChannelInit() : weak_factory_(this) {}
-ChannelInit::~ChannelInit() {
- if (channel_info_)
- mojo::embedder::DestroyChannel(channel_info_,
- base::Bind(&base::DoNothing), nullptr);
-}
+ChannelInit::~ChannelInit() {}
void ChannelInit::Init(
base::PlatformFile file,
@@ -44,46 +39,13 @@ void ChannelInit::Init(
const base::Callback<void(mojo::ScopedMessagePipeHandle)>& callback) {
scoped_ptr<IPC::ScopedIPCSupport> ipc_support(
new IPC::ScopedIPCSupport(io_thread_task_runner));
- if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk")) {
- mojo::edk::CreateMessagePipe(
- mojo::edk::ScopedPlatformHandle(mojo::edk::PlatformHandle(file)),
- base::Bind(&CallMessagePipeCallbackOnThread,
- base::Bind(&ChannelInit::OnCreateMessagePipe,
- weak_factory_.GetWeakPtr(),
- base::Passed(&ipc_support),
- callback),
- base::ThreadTaskRunnerHandle::Get()));
- } else {
- 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());
- callback.Run(std::move(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);
+ mojo::edk::CreateMessagePipe(
+ mojo::edk::ScopedPlatformHandle(mojo::edk::PlatformHandle(file)),
+ base::Bind(&CallMessagePipeCallbackOnThread,
+ base::Bind(&ChannelInit::OnCreateMessagePipe,
+ weak_factory_.GetWeakPtr(),
+ base::Passed(&ipc_support), callback),
+ base::ThreadTaskRunnerHandle::Get()));
}
void ChannelInit::OnCreateMessagePipe(

Powered by Google App Engine
This is Rietveld 408576698