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

Side by Side Diff: extensions/browser/api/cast_channel/cast_transport.cc

Issue 1902873002: Convert //extensions/browser/api from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « extensions/browser/api/cast_channel/cast_transport.h ('k') | extensions/browser/api/cast_channel/cast_transport_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698