OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |