| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 << "Destroying Channel with " << local_id_to_endpoint_info_map_.size() | 132 << "Destroying Channel with " << local_id_to_endpoint_info_map_.size() |
| 133 << " endpoints still present"; | 133 << " endpoints still present"; |
| 134 } | 134 } |
| 135 | 135 |
| 136 void Channel::OnReadMessage(const MessageInTransit& message) { | 136 void Channel::OnReadMessage(const MessageInTransit& message) { |
| 137 switch (message.type()) { | 137 switch (message.type()) { |
| 138 case MessageInTransit::kTypeMessagePipeEndpoint: | 138 case MessageInTransit::kTypeMessagePipeEndpoint: |
| 139 case MessageInTransit::kTypeMessagePipe: | 139 case MessageInTransit::kTypeMessagePipe: |
| 140 OnReadMessageForDownstream(message); | 140 OnReadMessageForDownstream(message); |
| 141 break; | 141 break; |
| 142 case MessageInTransit::TYPE_CHANNEL: | 142 case MessageInTransit::kTypeChannel: |
| 143 OnReadMessageForChannel(message); | 143 OnReadMessageForChannel(message); |
| 144 break; | 144 break; |
| 145 default: | 145 default: |
| 146 HandleRemoteError(base::StringPrintf( | 146 HandleRemoteError(base::StringPrintf( |
| 147 "Received message of invalid type %u", | 147 "Received message of invalid type %u", |
| 148 static_cast<unsigned>(message.type()))); | 148 static_cast<unsigned>(message.type()))); |
| 149 break; | 149 break; |
| 150 } | 150 } |
| 151 } | 151 } |
| 152 | 152 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 LOG(WARNING) << error_message; | 215 LOG(WARNING) << error_message; |
| 216 } | 216 } |
| 217 | 217 |
| 218 void Channel::HandleLocalError(const base::StringPiece& error_message) { | 218 void Channel::HandleLocalError(const base::StringPiece& error_message) { |
| 219 // TODO(vtl): Is this how we really want to handle this? | 219 // TODO(vtl): Is this how we really want to handle this? |
| 220 LOG(FATAL) << error_message; | 220 LOG(FATAL) << error_message; |
| 221 } | 221 } |
| 222 | 222 |
| 223 } // namespace system | 223 } // namespace system |
| 224 } // namespace mojo | 224 } // namespace mojo |
| OLD | NEW |