OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/net/load_timing_observer.h" | 5 #include "chrome/browser/net/load_timing_observer.h" |
6 | 6 |
7 #include "base/time.h" | 7 #include "base/time.h" |
8 #include "chrome/browser/net/chrome_net_log.h" | 8 #include "chrome/browser/net/chrome_net_log.h" |
9 #include "content/public/common/resource_response.h" | 9 #include "content/public/common/resource_response.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // something went wrong. Should not happen. | 146 // something went wrong. Should not happen. |
147 if (url_request_to_record_.size() > kMaxNumEntries) { | 147 if (url_request_to_record_.size() > kMaxNumEntries) { |
148 LOG(WARNING) << "The load timing observer url request count has grown " | 148 LOG(WARNING) << "The load timing observer url request count has grown " |
149 "larger than expected, resetting"; | 149 "larger than expected, resetting"; |
150 url_request_to_record_.clear(); | 150 url_request_to_record_.clear(); |
151 } | 151 } |
152 | 152 |
153 URLRequestRecord& record = url_request_to_record_[source.id]; | 153 URLRequestRecord& record = url_request_to_record_[source.id]; |
154 record.base_ticks = time; | 154 record.base_ticks = time; |
155 record.timing = ResourceLoadTimingInfo(); | 155 record.timing = ResourceLoadTimingInfo(); |
| 156 record.timing.base_ticks = time; |
156 record.timing.base_time = TimeTicksToTime(time); | 157 record.timing.base_time = TimeTicksToTime(time); |
157 } | 158 } |
158 return; | 159 return; |
159 } else if (type == net::NetLog::TYPE_REQUEST_ALIVE) { | 160 } else if (type == net::NetLog::TYPE_REQUEST_ALIVE) { |
160 // Cleanup records based on the TYPE_REQUEST_ALIVE entry. | 161 // Cleanup records based on the TYPE_REQUEST_ALIVE entry. |
161 if (is_end) | 162 if (is_end) |
162 url_request_to_record_.erase(source.id); | 163 url_request_to_record_.erase(source.id); |
163 return; | 164 return; |
164 } | 165 } |
165 | 166 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 if (it == socket_to_record_.end()) | 369 if (it == socket_to_record_.end()) |
369 return; | 370 return; |
370 | 371 |
371 if (type == net::NetLog::TYPE_SSL_CONNECT) { | 372 if (type == net::NetLog::TYPE_SSL_CONNECT) { |
372 if (is_begin) | 373 if (is_begin) |
373 it->second.ssl_start = time; | 374 it->second.ssl_start = time; |
374 else if (is_end) | 375 else if (is_end) |
375 it->second.ssl_end = time; | 376 it->second.ssl_end = time; |
376 } | 377 } |
377 } | 378 } |
OLD | NEW |