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

Side by Side Diff: chrome/browser/net/load_timing_observer.cc

Issue 7602023: Use a monotonic clock (TimeTicks) to report network times to WebCore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync & Merge Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/common/extensions/extension_localization_peer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/extension_localization_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698