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

Side by Side Diff: net/websockets/websocket_stream.cc

Issue 657013003: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « net/websockets/websocket_channel_test.cc ('k') | net/websockets/websocket_stream_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "net/websockets/websocket_stream.h" 5 #include "net/websockets/websocket_stream.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/metrics/sparse_histogram.h" 10 #include "base/metrics/sparse_histogram.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 scoped_ptr<WebSocketHandshakeStreamCreateHelper> create_helper( 309 scoped_ptr<WebSocketHandshakeStreamCreateHelper> create_helper(
310 new WebSocketHandshakeStreamCreateHelper(connect_delegate.get(), 310 new WebSocketHandshakeStreamCreateHelper(connect_delegate.get(),
311 requested_subprotocols)); 311 requested_subprotocols));
312 scoped_ptr<StreamRequestImpl> request( 312 scoped_ptr<StreamRequestImpl> request(
313 new StreamRequestImpl(socket_url, 313 new StreamRequestImpl(socket_url,
314 url_request_context, 314 url_request_context,
315 origin, 315 origin,
316 connect_delegate.Pass(), 316 connect_delegate.Pass(),
317 create_helper.Pass())); 317 create_helper.Pass()));
318 request->Start(scoped_ptr<base::Timer>(new base::Timer(false, false))); 318 request->Start(scoped_ptr<base::Timer>(new base::Timer(false, false)));
319 return request.PassAs<WebSocketStreamRequest>(); 319 return request.Pass();
320 } 320 }
321 321
322 // This is declared in websocket_test_util.h. 322 // This is declared in websocket_test_util.h.
323 scoped_ptr<WebSocketStreamRequest> CreateAndConnectStreamForTesting( 323 scoped_ptr<WebSocketStreamRequest> CreateAndConnectStreamForTesting(
324 const GURL& socket_url, 324 const GURL& socket_url,
325 scoped_ptr<WebSocketHandshakeStreamCreateHelper> create_helper, 325 scoped_ptr<WebSocketHandshakeStreamCreateHelper> create_helper,
326 const url::Origin& origin, 326 const url::Origin& origin,
327 URLRequestContext* url_request_context, 327 URLRequestContext* url_request_context,
328 const BoundNetLog& net_log, 328 const BoundNetLog& net_log,
329 scoped_ptr<WebSocketStream::ConnectDelegate> connect_delegate, 329 scoped_ptr<WebSocketStream::ConnectDelegate> connect_delegate,
330 scoped_ptr<base::Timer> timer) { 330 scoped_ptr<base::Timer> timer) {
331 scoped_ptr<StreamRequestImpl> request( 331 scoped_ptr<StreamRequestImpl> request(
332 new StreamRequestImpl(socket_url, 332 new StreamRequestImpl(socket_url,
333 url_request_context, 333 url_request_context,
334 origin, 334 origin,
335 connect_delegate.Pass(), 335 connect_delegate.Pass(),
336 create_helper.Pass())); 336 create_helper.Pass()));
337 request->Start(timer.Pass()); 337 request->Start(timer.Pass());
338 return request.PassAs<WebSocketStreamRequest>(); 338 return request.Pass();
339 } 339 }
340 340
341 void WebSocketDispatchOnFinishOpeningHandshake( 341 void WebSocketDispatchOnFinishOpeningHandshake(
342 WebSocketStream::ConnectDelegate* connect_delegate, 342 WebSocketStream::ConnectDelegate* connect_delegate,
343 const GURL& url, 343 const GURL& url,
344 const scoped_refptr<HttpResponseHeaders>& headers, 344 const scoped_refptr<HttpResponseHeaders>& headers,
345 base::Time response_time) { 345 base::Time response_time) {
346 DCHECK(connect_delegate); 346 DCHECK(connect_delegate);
347 if (headers.get()) { 347 if (headers.get()) {
348 connect_delegate->OnFinishOpeningHandshake(make_scoped_ptr( 348 connect_delegate->OnFinishOpeningHandshake(make_scoped_ptr(
349 new WebSocketHandshakeResponseInfo(url, 349 new WebSocketHandshakeResponseInfo(url,
350 headers->response_code(), 350 headers->response_code(),
351 headers->GetStatusText(), 351 headers->GetStatusText(),
352 headers, 352 headers,
353 response_time))); 353 response_time)));
354 } 354 }
355 } 355 }
356 356
357 } // namespace net 357 } // namespace net
OLDNEW
« no previous file with comments | « net/websockets/websocket_channel_test.cc ('k') | net/websockets/websocket_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698