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

Unified Diff: mojo/system/channel.cc

Issue 223783006: Mojo: Make Channel take a RawChannel rather than creating it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/system/channel.h ('k') | mojo/system/multiprocess_message_pipe_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/channel.cc
diff --git a/mojo/system/channel.cc b/mojo/system/channel.cc
index d7a720eb9b56c1ec69b3db159dbfb428510b1336..14923e2bd8fce1a236de97387ddf0e56d18cf86e 100644
--- a/mojo/system/channel.cc
+++ b/mojo/system/channel.cc
@@ -8,7 +8,6 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
-#include "base/message_loop/message_loop.h"
#include "base/strings/stringprintf.h"
#include "mojo/system/message_pipe_endpoint.h"
@@ -38,18 +37,16 @@ Channel::Channel()
: next_local_id_(kBootstrapEndpointId) {
}
-bool Channel::Init(embedder::ScopedPlatformHandle handle) {
+bool Channel:: Init(scoped_ptr<RawChannel> raw_channel) {
sky 2014/04/03 22:34:29 nit: spurious space.
DCHECK(creation_thread_checker_.CalledOnValidThread());
+ DCHECK(raw_channel);
// No need to take |lock_|, since this must be called before this object
// becomes thread-safe.
- DCHECK(!raw_channel_.get());
+ DCHECK(!raw_channel_);
+ raw_channel_ = raw_channel.Pass();
- CHECK_EQ(base::MessageLoop::current()->type(), base::MessageLoop::TYPE_IO);
- raw_channel_.reset(RawChannel::Create(handle.Pass(), this,
- static_cast<base::MessageLoopForIO*>(
- base::MessageLoop::current())));
- if (!raw_channel_->Init()) {
+ if (!raw_channel_->Init(this)) {
raw_channel_.reset();
return false;
}
« no previous file with comments | « mojo/system/channel.h ('k') | mojo/system/multiprocess_message_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698