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 "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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 ChromeNetLog* chrome_net_log = static_cast<ChromeNetLog*>( | 112 ChromeNetLog* chrome_net_log = static_cast<ChromeNetLog*>( |
113 request->net_log().net_log()); | 113 request->net_log().net_log()); |
114 if (chrome_net_log == NULL) | 114 if (chrome_net_log == NULL) |
115 return; | 115 return; |
116 | 116 |
117 uint32 source_id = request->net_log().source().id; | 117 uint32 source_id = request->net_log().source().id; |
118 LoadTimingObserver* observer = chrome_net_log->load_timing_observer(); | 118 LoadTimingObserver* observer = chrome_net_log->load_timing_observer(); |
119 LoadTimingObserver::URLRequestRecord* record = | 119 LoadTimingObserver::URLRequestRecord* record = |
120 observer->GetURLRequestRecord(source_id); | 120 observer->GetURLRequestRecord(source_id); |
121 if (record) { | 121 if (record) { |
122 response->connection_id = record->socket_log_id; | 122 response->data.connection_id = record->socket_log_id; |
123 response->connection_reused = record->socket_reused; | 123 response->data.connection_reused = record->socket_reused; |
124 response->load_timing = record->timing; | 124 response->data.load_timing = record->timing; |
125 } | 125 } |
126 } | 126 } |
127 | 127 |
128 void LoadTimingObserver::OnAddURLRequestEntry( | 128 void LoadTimingObserver::OnAddURLRequestEntry( |
129 net::NetLog::EventType type, | 129 net::NetLog::EventType type, |
130 const base::TimeTicks& time, | 130 const base::TimeTicks& time, |
131 const net::NetLog::Source& source, | 131 const net::NetLog::Source& source, |
132 net::NetLog::EventPhase phase, | 132 net::NetLog::EventPhase phase, |
133 net::NetLog::EventParameters* params) { | 133 net::NetLog::EventParameters* params) { |
134 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 134 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 if (it == socket_to_record_.end()) | 372 if (it == socket_to_record_.end()) |
373 return; | 373 return; |
374 | 374 |
375 if (type == net::NetLog::TYPE_SSL_CONNECT) { | 375 if (type == net::NetLog::TYPE_SSL_CONNECT) { |
376 if (is_begin) | 376 if (is_begin) |
377 it->second.ssl_start = time; | 377 it->second.ssl_start = time; |
378 else if (is_end) | 378 else if (is_end) |
379 it->second.ssl_end = time; | 379 it->second.ssl_end = time; |
380 } | 380 } |
381 } | 381 } |
OLD | NEW |