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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 } | 29 } |
30 | 30 |
31 Channel::EndpointInfo::EndpointInfo(scoped_refptr<MessagePipe> message_pipe, | 31 Channel::EndpointInfo::EndpointInfo(scoped_refptr<MessagePipe> message_pipe, |
32 unsigned port) | 32 unsigned port) |
33 : state(STATE_NORMAL), message_pipe(message_pipe), port(port) { | 33 : state(STATE_NORMAL), message_pipe(message_pipe), port(port) { |
34 } | 34 } |
35 | 35 |
36 Channel::EndpointInfo::~EndpointInfo() { | 36 Channel::EndpointInfo::~EndpointInfo() { |
37 } | 37 } |
38 | 38 |
39 Channel::Channel() | 39 Channel::Channel(embedder::PlatformSupport* platform_support) |
40 : is_running_(false), | 40 : platform_support_(platform_support), |
| 41 is_running_(false), |
41 is_shutting_down_(false), | 42 is_shutting_down_(false), |
42 next_local_id_(kBootstrapEndpointId) { | 43 next_local_id_(kBootstrapEndpointId) { |
43 } | 44 } |
44 | 45 |
45 bool Channel::Init(scoped_ptr<RawChannel> raw_channel) { | 46 bool Channel::Init(scoped_ptr<RawChannel> raw_channel) { |
46 DCHECK(creation_thread_checker_.CalledOnValidThread()); | 47 DCHECK(creation_thread_checker_.CalledOnValidThread()); |
47 DCHECK(raw_channel); | 48 DCHECK(raw_channel); |
48 | 49 |
49 // No need to take |lock_|, since this must be called before this object | 50 // No need to take |lock_|, since this must be called before this object |
50 // becomes thread-safe. | 51 // becomes thread-safe. |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 // TODO(vtl): Is this how we really want to handle this? | 524 // TODO(vtl): Is this how we really want to handle this? |
524 // Sometimes we'll want to propagate the error back to the message pipe | 525 // Sometimes we'll want to propagate the error back to the message pipe |
525 // (endpoint), and notify it that the remote is (effectively) closed. | 526 // (endpoint), and notify it that the remote is (effectively) closed. |
526 // Sometimes we'll want to kill the channel (and notify all the endpoints that | 527 // Sometimes we'll want to kill the channel (and notify all the endpoints that |
527 // their remotes are dead. | 528 // their remotes are dead. |
528 LOG(WARNING) << error_message; | 529 LOG(WARNING) << error_message; |
529 } | 530 } |
530 | 531 |
531 } // namespace system | 532 } // namespace system |
532 } // namespace mojo | 533 } // namespace mojo |
OLD | NEW |