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

Side by Side Diff: net/socket/websocket_transport_client_socket_pool.cc

Issue 2533063002: Fix Net.Socket.IdleSocketTimeSaving histogram (Closed)
Patch Set: self review Created 4 years 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 "net/socket/websocket_transport_client_socket_pool.h" 5 #include "net/socket/websocket_transport_client_socket_pool.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 } 390 }
391 391
392 void WebSocketTransportClientSocketPool::CancelRequest( 392 void WebSocketTransportClientSocketPool::CancelRequest(
393 const std::string& group_name, 393 const std::string& group_name,
394 ClientSocketHandle* handle) { 394 ClientSocketHandle* handle) {
395 DCHECK(!handle->is_initialized()); 395 DCHECK(!handle->is_initialized());
396 if (DeleteStalledRequest(handle)) 396 if (DeleteStalledRequest(handle))
397 return; 397 return;
398 std::unique_ptr<StreamSocket> socket = handle->PassSocket(); 398 std::unique_ptr<StreamSocket> socket = handle->PassSocket();
399 if (socket) 399 if (socket)
400 ReleaseSocket(handle->group_name(), std::move(socket), handle->id()); 400 ReleaseSocket(handle->group_name(), std::move(socket), handle->id(),
401 handle->connect_timing());
401 if (!DeleteJob(handle)) 402 if (!DeleteJob(handle))
402 pending_callbacks_.erase(handle); 403 pending_callbacks_.erase(handle);
403 404
404 ActivateStalledRequest(); 405 ActivateStalledRequest();
405 } 406 }
406 407
407 void WebSocketTransportClientSocketPool::ReleaseSocket( 408 void WebSocketTransportClientSocketPool::ReleaseSocket(
408 const std::string& group_name, 409 const std::string& group_name,
409 std::unique_ptr<StreamSocket> socket, 410 std::unique_ptr<StreamSocket> socket,
410 int id) { 411 int id,
412 const LoadTimingInfo::ConnectTiming& connect_timing) {
411 WebSocketEndpointLockManager::GetInstance()->UnlockSocket(socket.get()); 413 WebSocketEndpointLockManager::GetInstance()->UnlockSocket(socket.get());
412 CHECK_GT(handed_out_socket_count_, 0); 414 CHECK_GT(handed_out_socket_count_, 0);
413 --handed_out_socket_count_; 415 --handed_out_socket_count_;
414 416
415 ActivateStalledRequest(); 417 ActivateStalledRequest();
416 } 418 }
417 419
418 void WebSocketTransportClientSocketPool::FlushWithError(int error) { 420 void WebSocketTransportClientSocketPool::FlushWithError(int error) {
419 DCHECK_NE(error, OK); 421 DCHECK_NE(error, OK);
420 422
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 handle(handle), 696 handle(handle),
695 callback(callback), 697 callback(callback),
696 net_log(net_log) {} 698 net_log(net_log) {}
697 699
698 WebSocketTransportClientSocketPool::StalledRequest::StalledRequest( 700 WebSocketTransportClientSocketPool::StalledRequest::StalledRequest(
699 const StalledRequest& other) = default; 701 const StalledRequest& other) = default;
700 702
701 WebSocketTransportClientSocketPool::StalledRequest::~StalledRequest() {} 703 WebSocketTransportClientSocketPool::StalledRequest::~StalledRequest() {}
702 704
703 } // namespace net 705 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/websocket_transport_client_socket_pool.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698