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

Side by Side Diff: mojo/system/channel.cc

Issue 137063010: Mojo: Move platform handle/channel stuff in system to embedder namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/system/channel.h ('k') | mojo/system/embedder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/system/channel.h" 5 #include "mojo/system/channel.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 19 matching lines...) Expand all
30 port(port) { 30 port(port) {
31 } 31 }
32 32
33 Channel::EndpointInfo::~EndpointInfo() { 33 Channel::EndpointInfo::~EndpointInfo() {
34 } 34 }
35 35
36 Channel::Channel() 36 Channel::Channel()
37 : next_local_id_(kBootstrapEndpointId) { 37 : next_local_id_(kBootstrapEndpointId) {
38 } 38 }
39 39
40 bool Channel::Init(ScopedPlatformHandle handle) { 40 bool Channel::Init(embedder::ScopedPlatformHandle handle) {
41 DCHECK(creation_thread_checker_.CalledOnValidThread()); 41 DCHECK(creation_thread_checker_.CalledOnValidThread());
42 42
43 // No need to take |lock_|, since this must be called before this object 43 // No need to take |lock_|, since this must be called before this object
44 // becomes thread-safe. 44 // becomes thread-safe.
45 DCHECK(!raw_channel_.get()); 45 DCHECK(!raw_channel_.get());
46 46
47 raw_channel_.reset( 47 raw_channel_.reset(
48 RawChannel::Create(handle.Pass(), this, base::MessageLoop::current())); 48 RawChannel::Create(handle.Pass(), this, base::MessageLoop::current()));
49 if (!raw_channel_->Init()) { 49 if (!raw_channel_->Init()) {
50 raw_channel_.reset(); 50 raw_channel_.reset();
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 LOG(WARNING) << error_message; 206 LOG(WARNING) << error_message;
207 } 207 }
208 208
209 void Channel::HandleLocalError(const base::StringPiece& error_message) { 209 void Channel::HandleLocalError(const base::StringPiece& error_message) {
210 // TODO(vtl): Is this how we really want to handle this? 210 // TODO(vtl): Is this how we really want to handle this?
211 LOG(FATAL) << error_message; 211 LOG(FATAL) << error_message;
212 } 212 }
213 213
214 } // namespace system 214 } // namespace system
215 } // namespace mojo 215 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/system/channel.h ('k') | mojo/system/embedder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698