| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/client_socket_pool_base.h" | 5 #include "net/socket/client_socket_pool_base.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" |
| 11 #include "base/format_macros.h" | 11 #include "base/format_macros.h" |
| 12 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/metrics/histogram_macros.h" | 14 #include "base/metrics/histogram_macros.h" |
| 15 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
| 16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 17 #include "base/threading/thread_task_runner_handle.h" | 17 #include "base/threading/thread_task_runner_handle.h" |
| 18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 #include "base/trace_event/trace_event.h" | 19 #include "base/trace_event/trace_event.h" |
| 20 #include "base/values.h" | 20 #include "base/values.h" |
| 21 #include "net/base/net_errors.h" | 21 #include "net/base/net_errors.h" |
| 22 #include "net/base/trace_constants.h" |
| 22 #include "net/log/net_log.h" | 23 #include "net/log/net_log.h" |
| 23 #include "net/log/net_log_event_type.h" | 24 #include "net/log/net_log_event_type.h" |
| 24 #include "net/log/net_log_source.h" | 25 #include "net/log/net_log_source.h" |
| 25 | 26 |
| 26 using base::TimeDelta; | 27 using base::TimeDelta; |
| 27 | 28 |
| 28 namespace net { | 29 namespace net { |
| 29 | 30 |
| 30 namespace { | 31 namespace { |
| 31 | 32 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 122 |
| 122 void ConnectJob::SetSocket(std::unique_ptr<StreamSocket> socket) { | 123 void ConnectJob::SetSocket(std::unique_ptr<StreamSocket> socket) { |
| 123 if (socket) { | 124 if (socket) { |
| 124 net_log().AddEvent(NetLogEventType::CONNECT_JOB_SET_SOCKET, | 125 net_log().AddEvent(NetLogEventType::CONNECT_JOB_SET_SOCKET, |
| 125 socket->NetLog().source().ToEventParametersCallback()); | 126 socket->NetLog().source().ToEventParametersCallback()); |
| 126 } | 127 } |
| 127 socket_ = std::move(socket); | 128 socket_ = std::move(socket); |
| 128 } | 129 } |
| 129 | 130 |
| 130 void ConnectJob::NotifyDelegateOfCompletion(int rv) { | 131 void ConnectJob::NotifyDelegateOfCompletion(int rv) { |
| 131 TRACE_EVENT0("net", "ConnectJob::NotifyDelegateOfCompletion"); | 132 TRACE_EVENT0(kNetTracingCategory, "ConnectJob::NotifyDelegateOfCompletion"); |
| 132 // The delegate will own |this|. | 133 // The delegate will own |this|. |
| 133 Delegate* delegate = delegate_; | 134 Delegate* delegate = delegate_; |
| 134 delegate_ = NULL; | 135 delegate_ = NULL; |
| 135 | 136 |
| 136 LogConnectCompletion(rv); | 137 LogConnectCompletion(rv); |
| 137 delegate->OnConnectJobComplete(rv, this); | 138 delegate->OnConnectJobComplete(rv, this); |
| 138 } | 139 } |
| 139 | 140 |
| 140 void ConnectJob::ResetTimer(base::TimeDelta remaining_time) { | 141 void ConnectJob::ResetTimer(base::TimeDelta remaining_time) { |
| 141 timer_.Stop(); | 142 timer_.Stop(); |
| (...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1381 // If there are no more requests, kill the backup timer. | 1382 // If there are no more requests, kill the backup timer. |
| 1382 if (pending_requests_.empty()) | 1383 if (pending_requests_.empty()) |
| 1383 backup_job_timer_.Stop(); | 1384 backup_job_timer_.Stop(); |
| 1384 request->CrashIfInvalid(); | 1385 request->CrashIfInvalid(); |
| 1385 return request; | 1386 return request; |
| 1386 } | 1387 } |
| 1387 | 1388 |
| 1388 } // namespace internal | 1389 } // namespace internal |
| 1389 | 1390 |
| 1390 } // namespace net | 1391 } // namespace net |
| OLD | NEW |