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

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

Issue 2837863004: Use base::OneShotTimer instead of base::Timer(false, false)
Patch Set: rebase Created 3 years, 7 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 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 <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 const GURL& first_party_for_cookies, 362 const GURL& first_party_for_cookies,
363 const std::string& additional_headers, 363 const std::string& additional_headers,
364 URLRequestContext* url_request_context, 364 URLRequestContext* url_request_context,
365 const NetLogWithSource& net_log, 365 const NetLogWithSource& net_log,
366 std::unique_ptr<ConnectDelegate> connect_delegate) { 366 std::unique_ptr<ConnectDelegate> connect_delegate) {
367 std::unique_ptr<WebSocketStreamRequestImpl> request( 367 std::unique_ptr<WebSocketStreamRequestImpl> request(
368 new WebSocketStreamRequestImpl( 368 new WebSocketStreamRequestImpl(
369 socket_url, url_request_context, origin, first_party_for_cookies, 369 socket_url, url_request_context, origin, first_party_for_cookies,
370 additional_headers, std::move(connect_delegate), 370 additional_headers, std::move(connect_delegate),
371 std::move(create_helper))); 371 std::move(create_helper)));
372 request->Start(std::unique_ptr<base::Timer>(new base::Timer(false, false))); 372 request->Start(std::unique_ptr<base::Timer>(new base::OneShotTimer()));
373 return std::move(request); 373 return std::move(request);
374 } 374 }
375 375
376 std::unique_ptr<WebSocketStreamRequest> 376 std::unique_ptr<WebSocketStreamRequest>
377 WebSocketStream::CreateAndConnectStreamForTesting( 377 WebSocketStream::CreateAndConnectStreamForTesting(
378 const GURL& socket_url, 378 const GURL& socket_url,
379 std::unique_ptr<WebSocketHandshakeStreamCreateHelper> create_helper, 379 std::unique_ptr<WebSocketHandshakeStreamCreateHelper> create_helper,
380 const url::Origin& origin, 380 const url::Origin& origin,
381 const GURL& first_party_for_cookies, 381 const GURL& first_party_for_cookies,
382 const std::string& additional_headers, 382 const std::string& additional_headers,
(...skipping 18 matching lines...) Expand all
401 DCHECK(connect_delegate); 401 DCHECK(connect_delegate);
402 if (headers.get()) { 402 if (headers.get()) {
403 connect_delegate->OnFinishOpeningHandshake( 403 connect_delegate->OnFinishOpeningHandshake(
404 base::MakeUnique<WebSocketHandshakeResponseInfo>( 404 base::MakeUnique<WebSocketHandshakeResponseInfo>(
405 url, headers->response_code(), headers->GetStatusText(), headers, 405 url, headers->response_code(), headers->GetStatusText(), headers,
406 response_time)); 406 response_time));
407 } 407 }
408 } 408 }
409 409
410 } // namespace net 410 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc ('k') | net/websockets/websocket_stream_create_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698