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/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
17 #include "base/thread_task_runner_handle.h" | 17 #include "base/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/values.h" | 20 #include "base/values.h" |
20 #include "net/base/net_errors.h" | 21 #include "net/base/net_errors.h" |
21 #include "net/log/net_log.h" | 22 #include "net/log/net_log.h" |
22 | 23 |
23 using base::TimeDelta; | 24 using base::TimeDelta; |
24 | 25 |
25 namespace net { | 26 namespace net { |
26 | 27 |
27 namespace { | 28 namespace { |
28 | 29 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 98 |
98 void ConnectJob::SetSocket(scoped_ptr<StreamSocket> socket) { | 99 void ConnectJob::SetSocket(scoped_ptr<StreamSocket> socket) { |
99 if (socket) { | 100 if (socket) { |
100 net_log().AddEvent(NetLog::TYPE_CONNECT_JOB_SET_SOCKET, | 101 net_log().AddEvent(NetLog::TYPE_CONNECT_JOB_SET_SOCKET, |
101 socket->NetLog().source().ToEventParametersCallback()); | 102 socket->NetLog().source().ToEventParametersCallback()); |
102 } | 103 } |
103 socket_ = std::move(socket); | 104 socket_ = std::move(socket); |
104 } | 105 } |
105 | 106 |
106 void ConnectJob::NotifyDelegateOfCompletion(int rv) { | 107 void ConnectJob::NotifyDelegateOfCompletion(int rv) { |
| 108 TRACE_EVENT0("net", "ConnectJob::NotifyDelegateOfCompletion"); |
107 // The delegate will own |this|. | 109 // The delegate will own |this|. |
108 Delegate* delegate = delegate_; | 110 Delegate* delegate = delegate_; |
109 delegate_ = NULL; | 111 delegate_ = NULL; |
110 | 112 |
111 LogConnectCompletion(rv); | 113 LogConnectCompletion(rv); |
112 delegate->OnConnectJobComplete(rv, this); | 114 delegate->OnConnectJobComplete(rv, this); |
113 } | 115 } |
114 | 116 |
115 void ConnectJob::ResetTimer(base::TimeDelta remaining_time) { | 117 void ConnectJob::ResetTimer(base::TimeDelta remaining_time) { |
116 timer_.Stop(); | 118 timer_.Stop(); |
(...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1350 // If there are no more requests, kill the backup timer. | 1352 // If there are no more requests, kill the backup timer. |
1351 if (pending_requests_.empty()) | 1353 if (pending_requests_.empty()) |
1352 backup_job_timer_.Stop(); | 1354 backup_job_timer_.Stop(); |
1353 request->CrashIfInvalid(); | 1355 request->CrashIfInvalid(); |
1354 return request; | 1356 return request; |
1355 } | 1357 } |
1356 | 1358 |
1357 } // namespace internal | 1359 } // namespace internal |
1358 | 1360 |
1359 } // namespace net | 1361 } // namespace net |
OLD | NEW |