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

Unified Diff: mojo/embedder/channel_init.cc

Issue 621153003: Move mojo edk into mojo/edk (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix checkdeps Created 6 years, 2 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 | « mojo/embedder/channel_init.h ('k') | mojo/embedder/embedder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/embedder/channel_init.cc
diff --git a/mojo/embedder/channel_init.cc b/mojo/embedder/channel_init.cc
deleted file mode 100644
index 4c15c83bfbe0a469971ecffc2fcbe2d68c685ee6..0000000000000000000000000000000000000000
--- a/mojo/embedder/channel_init.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "mojo/embedder/channel_init.h"
-
-#include "base/bind.h"
-#include "base/message_loop/message_loop.h"
-#include "mojo/embedder/embedder.h"
-
-namespace mojo {
-namespace embedder {
-
-ChannelInit::ChannelInit() : channel_info_(nullptr), weak_factory_(this) {
-}
-
-ChannelInit::~ChannelInit() {
- if (channel_info_)
- DestroyChannel(channel_info_);
-}
-
-ScopedMessagePipeHandle ChannelInit::Init(
- base::PlatformFile file,
- scoped_refptr<base::TaskRunner> io_thread_task_runner) {
- DCHECK(!io_thread_task_runner_.get()); // Should only init once.
- io_thread_task_runner_ = io_thread_task_runner;
- ScopedMessagePipeHandle message_pipe =
- CreateChannel(ScopedPlatformHandle(PlatformHandle(file)),
- io_thread_task_runner,
- base::Bind(&ChannelInit::OnCreatedChannel,
- weak_factory_.GetWeakPtr(),
- io_thread_task_runner),
- base::MessageLoop::current()->message_loop_proxy()).Pass();
- return message_pipe.Pass();
-}
-
-void ChannelInit::WillDestroySoon() {
- if (channel_info_)
- WillDestroyChannelSoon(channel_info_);
-}
-
-// static
-void ChannelInit::OnCreatedChannel(base::WeakPtr<ChannelInit> self,
- scoped_refptr<base::TaskRunner> io_thread,
- ChannelInfo* channel) {
- // If |self| was already destroyed, shut the channel down.
- if (!self) {
- DestroyChannel(channel);
- return;
- }
-
- self->channel_info_ = channel;
-}
-
-} // namespace embedder
-} // namespace mojo
« no previous file with comments | « mojo/embedder/channel_init.h ('k') | mojo/embedder/embedder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698