| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/cast_channel/cast_transport.h" | 5 #include "extensions/browser/api/cast_channel/cast_transport.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 case CHANNEL_ERROR_CONNECT_TIMEOUT: | 137 case CHANNEL_ERROR_CONNECT_TIMEOUT: |
| 138 return proto::CHANNEL_ERROR_CONNECT_TIMEOUT; | 138 return proto::CHANNEL_ERROR_CONNECT_TIMEOUT; |
| 139 case CHANNEL_ERROR_UNKNOWN: | 139 case CHANNEL_ERROR_UNKNOWN: |
| 140 return proto::CHANNEL_ERROR_UNKNOWN; | 140 return proto::CHANNEL_ERROR_UNKNOWN; |
| 141 default: | 141 default: |
| 142 NOTREACHED(); | 142 NOTREACHED(); |
| 143 return proto::CHANNEL_ERROR_NONE; | 143 return proto::CHANNEL_ERROR_NONE; |
| 144 } | 144 } |
| 145 } | 145 } |
| 146 | 146 |
| 147 void CastTransportImpl::SetReadDelegate(scoped_ptr<Delegate> delegate) { | 147 void CastTransportImpl::SetReadDelegate(std::unique_ptr<Delegate> delegate) { |
| 148 DCHECK(CalledOnValidThread()); | 148 DCHECK(CalledOnValidThread()); |
| 149 DCHECK(delegate); | 149 DCHECK(delegate); |
| 150 delegate_ = std::move(delegate); | 150 delegate_ = std::move(delegate); |
| 151 if (started_) { | 151 if (started_) { |
| 152 delegate_->Start(); | 152 delegate_->Start(); |
| 153 } | 153 } |
| 154 } | 154 } |
| 155 | 155 |
| 156 void CastTransportImpl::FlushWriteQueue() { | 156 void CastTransportImpl::FlushWriteQueue() { |
| 157 for (; !write_queue_.empty(); write_queue_.pop()) { | 157 for (; !write_queue_.empty(); write_queue_.pop()) { |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 VLOG_WITH_CONNECTION(2) << "DoReadHandleError"; | 468 VLOG_WITH_CONNECTION(2) << "DoReadHandleError"; |
| 469 DCHECK_NE(CHANNEL_ERROR_NONE, error_state_); | 469 DCHECK_NE(CHANNEL_ERROR_NONE, error_state_); |
| 470 DCHECK_LE(result, 0); | 470 DCHECK_LE(result, 0); |
| 471 SetReadState(READ_STATE_ERROR); | 471 SetReadState(READ_STATE_ERROR); |
| 472 return net::ERR_FAILED; | 472 return net::ERR_FAILED; |
| 473 } | 473 } |
| 474 | 474 |
| 475 } // namespace cast_channel | 475 } // namespace cast_channel |
| 476 } // namespace api | 476 } // namespace api |
| 477 } // namespace extensions | 477 } // namespace extensions |
| OLD | NEW |