Chromium Code Reviews| 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/common/resource_response.h" | 9 #include "content/common/resource_response.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 145 // something went wrong. Should not happen. | 145 // something went wrong. Should not happen. |
| 146 if (url_request_to_record_.size() > kMaxNumEntries) { | 146 if (url_request_to_record_.size() > kMaxNumEntries) { |
| 147 LOG(WARNING) << "The load timing observer url request count has grown " | 147 LOG(WARNING) << "The load timing observer url request count has grown " |
| 148 "larger than expected, resetting"; | 148 "larger than expected, resetting"; |
| 149 url_request_to_record_.clear(); | 149 url_request_to_record_.clear(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 URLRequestRecord& record = url_request_to_record_[source.id]; | 152 URLRequestRecord& record = url_request_to_record_[source.id]; |
| 153 record.base_ticks = time; | 153 record.base_ticks = time; |
| 154 record.timing = ResourceLoadTimingInfo(); | 154 record.timing = ResourceLoadTimingInfo(); |
| 155 record.timing.base_ticks = time; | |
| 155 record.timing.base_time = TimeTicksToTime(time); | 156 record.timing.base_time = TimeTicksToTime(time); |
|
jar (doing other things)
2011/11/19 03:42:32
It seems a bit strange to save this in to formats.
| |
| 156 } | 157 } |
| 157 return; | 158 return; |
| 158 } else if (type == net::NetLog::TYPE_REQUEST_ALIVE) { | 159 } else if (type == net::NetLog::TYPE_REQUEST_ALIVE) { |
| 159 // Cleanup records based on the TYPE_REQUEST_ALIVE entry. | 160 // Cleanup records based on the TYPE_REQUEST_ALIVE entry. |
| 160 if (is_end) | 161 if (is_end) |
| 161 url_request_to_record_.erase(source.id); | 162 url_request_to_record_.erase(source.id); |
| 162 return; | 163 return; |
| 163 } | 164 } |
| 164 | 165 |
| 165 URLRequestRecord* record = GetURLRequestRecord(source.id); | 166 URLRequestRecord* record = GetURLRequestRecord(source.id); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 367 if (it == socket_to_record_.end()) | 368 if (it == socket_to_record_.end()) |
| 368 return; | 369 return; |
| 369 | 370 |
| 370 if (type == net::NetLog::TYPE_SSL_CONNECT) { | 371 if (type == net::NetLog::TYPE_SSL_CONNECT) { |
| 371 if (is_begin) | 372 if (is_begin) |
| 372 it->second.ssl_start = time; | 373 it->second.ssl_start = time; |
| 373 else if (is_end) | 374 else if (is_end) |
| 374 it->second.ssl_end = time; | 375 it->second.ssl_end = time; |
| 375 } | 376 } |
| 376 } | 377 } |
| OLD | NEW |