| Index: chrome/browser/net/load_timing_observer.cc
|
| ===================================================================
|
| --- chrome/browser/net/load_timing_observer.cc (revision 65207)
|
| +++ chrome/browser/net/load_timing_observer.cc (working copy)
|
| @@ -44,7 +44,7 @@
|
| (time_ticks - record->base_ticks).InMillisecondsRoundedUp());
|
| }
|
|
|
| -}
|
| +} // namespace
|
|
|
| LoadTimingObserver::URLRequestRecord::URLRequestRecord()
|
| : connect_job_id(net::NetLog::Source::kInvalidId),
|
| @@ -53,7 +53,7 @@
|
| }
|
|
|
| LoadTimingObserver::LoadTimingObserver()
|
| - : Observer(net::NetLog::LOG_BASIC),
|
| + : ThreadSafeObserver(net::NetLog::LOG_BASIC),
|
| last_connect_job_id_(net::NetLog::Source::kInvalidId) {
|
| }
|
|
|
| @@ -73,6 +73,9 @@
|
| const net::NetLog::Source& source,
|
| net::NetLog::EventPhase phase,
|
| net::NetLog::EventParameters* params) {
|
| + // The events that the Observer is interested in only occur on the IO thread.
|
| + if (!BrowserThread::CurrentlyOn(BrowserThread::IO))
|
| + return;
|
| if (source.type == net::NetLog::SOURCE_URL_REQUEST)
|
| OnAddURLRequestEntry(type, time, source, phase, params);
|
| else if (source.type == net::NetLog::SOURCE_CONNECT_JOB)
|
| @@ -84,6 +87,7 @@
|
| // static
|
| void LoadTimingObserver::PopulateTimingInfo(URLRequest* request,
|
| ResourceResponse* response) {
|
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| if (!(request->load_flags() & net::LOAD_ENABLE_LOAD_TIMING))
|
| return;
|
|
|
| @@ -109,6 +113,8 @@
|
| const net::NetLog::Source& source,
|
| net::NetLog::EventPhase phase,
|
| net::NetLog::EventParameters* params) {
|
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| +
|
| bool is_begin = phase == net::NetLog::PHASE_BEGIN;
|
| bool is_end = phase == net::NetLog::PHASE_END;
|
|
|
| @@ -210,6 +216,8 @@
|
| const net::NetLog::Source& source,
|
| net::NetLog::EventPhase phase,
|
| net::NetLog::EventParameters* params) {
|
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| +
|
| bool is_begin = phase == net::NetLog::PHASE_BEGIN;
|
| bool is_end = phase == net::NetLog::PHASE_END;
|
|
|
| @@ -253,6 +261,8 @@
|
| const net::NetLog::Source& source,
|
| net::NetLog::EventPhase phase,
|
| net::NetLog::EventParameters* params) {
|
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| +
|
| bool is_begin = phase == net::NetLog::PHASE_BEGIN;
|
| bool is_end = phase == net::NetLog::PHASE_END;
|
|
|
|
|