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

Side by Side Diff: Source/core/inspector/InspectorResourceAgent.cpp

Issue 916273002: Make DocumentLoader::timing return a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase against ToT Created 5 years, 10 months 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
« no previous file with comments | « Source/core/frame/LocalDOMWindow.cpp ('k') | Source/core/loader/DocumentLoader.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 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 269
270 void InspectorResourceAgent::restore() 270 void InspectorResourceAgent::restore()
271 { 271 {
272 if (m_state->getBoolean(ResourceAgentState::resourceAgentEnabled)) 272 if (m_state->getBoolean(ResourceAgentState::resourceAgentEnabled))
273 enable(); 273 enable();
274 } 274 }
275 275
276 static PassRefPtr<TypeBuilder::Network::ResourceTiming> buildObjectForTiming(con st ResourceLoadTiming& timing, DocumentLoader* loader) 276 static PassRefPtr<TypeBuilder::Network::ResourceTiming> buildObjectForTiming(con st ResourceLoadTiming& timing, DocumentLoader* loader)
277 { 277 {
278 return TypeBuilder::Network::ResourceTiming::create() 278 return TypeBuilder::Network::ResourceTiming::create()
279 .setRequestTime(loader->timing()->monotonicTimeToPseudoWallTime(timing.r equestTime())) 279 .setRequestTime(loader->timing().monotonicTimeToPseudoWallTime(timing.re questTime()))
280 .setProxyStart(timing.calculateMillisecondDelta(timing.proxyStart())) 280 .setProxyStart(timing.calculateMillisecondDelta(timing.proxyStart()))
281 .setProxyEnd(timing.calculateMillisecondDelta(timing.proxyEnd())) 281 .setProxyEnd(timing.calculateMillisecondDelta(timing.proxyEnd()))
282 .setDnsStart(timing.calculateMillisecondDelta(timing.dnsStart())) 282 .setDnsStart(timing.calculateMillisecondDelta(timing.dnsStart()))
283 .setDnsEnd(timing.calculateMillisecondDelta(timing.dnsEnd())) 283 .setDnsEnd(timing.calculateMillisecondDelta(timing.dnsEnd()))
284 .setConnectStart(timing.calculateMillisecondDelta(timing.connectStart()) ) 284 .setConnectStart(timing.calculateMillisecondDelta(timing.connectStart()) )
285 .setConnectEnd(timing.calculateMillisecondDelta(timing.connectEnd())) 285 .setConnectEnd(timing.calculateMillisecondDelta(timing.connectEnd()))
286 .setSslStart(timing.calculateMillisecondDelta(timing.sslStart())) 286 .setSslStart(timing.calculateMillisecondDelta(timing.sslStart()))
287 .setSslEnd(timing.calculateMillisecondDelta(timing.sslEnd())) 287 .setSslEnd(timing.calculateMillisecondDelta(timing.sslEnd()))
288 .setServiceWorkerFetchStart(timing.calculateMillisecondDelta(timing.serv iceWorkerFetchStart())) 288 .setServiceWorkerFetchStart(timing.calculateMillisecondDelta(timing.serv iceWorkerFetchStart()))
289 .setServiceWorkerFetchReady(timing.calculateMillisecondDelta(timing.serv iceWorkerFetchReady())) 289 .setServiceWorkerFetchReady(timing.calculateMillisecondDelta(timing.serv iceWorkerFetchReady()))
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 } 534 }
535 535
536 m_frontend->dataReceived(requestId, currentTime(), dataLength, encodedDataLe ngth); 536 m_frontend->dataReceived(requestId, currentTime(), dataLength, encodedDataLe ngth);
537 } 537 }
538 538
539 void InspectorResourceAgent::didFinishLoading(unsigned long identifier, Document Loader* loader, double monotonicFinishTime, int64_t encodedDataLength) 539 void InspectorResourceAgent::didFinishLoading(unsigned long identifier, Document Loader* loader, double monotonicFinishTime, int64_t encodedDataLength)
540 { 540 {
541 double finishTime = 0.0; 541 double finishTime = 0.0;
542 // FIXME: Expose all of the timing details to inspector and have it calculat e finishTime. 542 // FIXME: Expose all of the timing details to inspector and have it calculat e finishTime.
543 if (monotonicFinishTime) 543 if (monotonicFinishTime)
544 finishTime = loader->timing()->monotonicTimeToPseudoWallTime(monotonicFi nishTime); 544 finishTime = loader->timing().monotonicTimeToPseudoWallTime(monotonicFin ishTime);
545 545
546 String requestId = IdentifiersFactory::requestId(identifier); 546 String requestId = IdentifiersFactory::requestId(identifier);
547 m_resourcesData->maybeDecodeDataToContent(requestId); 547 m_resourcesData->maybeDecodeDataToContent(requestId);
548 if (!finishTime) 548 if (!finishTime)
549 finishTime = currentTime(); 549 finishTime = currentTime();
550 m_frontend->loadingFinished(requestId, finishTime, encodedDataLength); 550 m_frontend->loadingFinished(requestId, finishTime, encodedDataLength);
551 } 551 }
552 552
553 void InspectorResourceAgent::didReceiveCORSRedirectResponse(LocalFrame* frame, u nsigned long identifier, DocumentLoader* loader, const ResourceResponse& respons e, ResourceLoader* resourceLoader) 553 void InspectorResourceAgent::didReceiveCORSRedirectResponse(LocalFrame* frame, u nsigned long identifier, DocumentLoader* loader, const ResourceResponse& respons e, ResourceLoader* resourceLoader)
554 { 554 {
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish edReplayXHRFired) 1031 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish edReplayXHRFired)
1032 { 1032 {
1033 } 1033 }
1034 1034
1035 bool InspectorResourceAgent::shouldForceCORSPreflight() 1035 bool InspectorResourceAgent::shouldForceCORSPreflight()
1036 { 1036 {
1037 return m_state->getBoolean(ResourceAgentState::cacheDisabled); 1037 return m_state->getBoolean(ResourceAgentState::cacheDisabled);
1038 } 1038 }
1039 1039
1040 } // namespace blink 1040 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/LocalDOMWindow.cpp ('k') | Source/core/loader/DocumentLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698