OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 #include "core/loader/ProgressTracker.h" | 58 #include "core/loader/ProgressTracker.h" |
59 #include "core/loader/SubresourceFilter.h" | 59 #include "core/loader/SubresourceFilter.h" |
60 #include "core/loader/appcache/ApplicationCacheHost.h" | 60 #include "core/loader/appcache/ApplicationCacheHost.h" |
61 #include "core/loader/private/FrameClientHintsPreferencesContext.h" | 61 #include "core/loader/private/FrameClientHintsPreferencesContext.h" |
62 #include "core/page/Page.h" | 62 #include "core/page/Page.h" |
63 #include "core/paint/FirstMeaningfulPaintDetector.h" | 63 #include "core/paint/FirstMeaningfulPaintDetector.h" |
64 #include "core/probe/CoreProbes.h" | 64 #include "core/probe/CoreProbes.h" |
65 #include "core/svg/graphics/SVGImageChromeClient.h" | 65 #include "core/svg/graphics/SVGImageChromeClient.h" |
66 #include "core/timing/DOMWindowPerformance.h" | 66 #include "core/timing/DOMWindowPerformance.h" |
67 #include "core/timing/Performance.h" | 67 #include "core/timing/Performance.h" |
| 68 #include "core/timing/PerformanceBase.h" |
68 #include "platform/WebFrameScheduler.h" | 69 #include "platform/WebFrameScheduler.h" |
69 #include "platform/exported/WrappedResourceRequest.h" | 70 #include "platform/exported/WrappedResourceRequest.h" |
70 #include "platform/instrumentation/tracing/TracedValue.h" | 71 #include "platform/instrumentation/tracing/TracedValue.h" |
71 #include "platform/loader/fetch/ClientHintsPreferences.h" | 72 #include "platform/loader/fetch/ClientHintsPreferences.h" |
72 #include "platform/loader/fetch/FetchInitiatorTypeNames.h" | 73 #include "platform/loader/fetch/FetchInitiatorTypeNames.h" |
73 #include "platform/loader/fetch/Resource.h" | 74 #include "platform/loader/fetch/Resource.h" |
74 #include "platform/loader/fetch/ResourceLoadPriority.h" | 75 #include "platform/loader/fetch/ResourceLoadPriority.h" |
75 #include "platform/loader/fetch/ResourceLoadingLog.h" | 76 #include "platform/loader/fetch/ResourceLoadingLog.h" |
76 #include "platform/loader/fetch/ResourceTimingInfo.h" | 77 #include "platform/loader/fetch/ResourceTimingInfo.h" |
77 #include "platform/loader/fetch/UniqueIdentifier.h" | 78 #include "platform/loader/fetch/UniqueIdentifier.h" |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 } | 530 } |
530 | 531 |
531 frame()->loader().progress().incrementProgress(identifier, response); | 532 frame()->loader().progress().incrementProgress(identifier, response); |
532 localFrameClient()->dispatchDidReceiveResponse(response); | 533 localFrameClient()->dispatchDidReceiveResponse(response); |
533 DocumentLoader* documentLoader = masterDocumentLoader(); | 534 DocumentLoader* documentLoader = masterDocumentLoader(); |
534 probe::didReceiveResourceResponse(frame(), identifier, documentLoader, | 535 probe::didReceiveResourceResponse(frame(), identifier, documentLoader, |
535 response, resource); | 536 response, resource); |
536 // It is essential that inspector gets resource response BEFORE console. | 537 // It is essential that inspector gets resource response BEFORE console. |
537 frame()->console().reportResourceResponseReceived(documentLoader, identifier, | 538 frame()->console().reportResourceResponseReceived(documentLoader, identifier, |
538 response); | 539 response); |
| 540 |
| 541 // MainResource responses were already added, skip them here. |
| 542 if (RuntimeEnabledFeatures::serverTimingEnabled() && |
| 543 resource->getType() != Resource::MainResource && frame()->document() && |
| 544 frame()->document()->domWindow()) { |
| 545 LocalDOMWindow* localDOMWindow = frame()->document()->domWindow(); |
| 546 DOMWindowPerformance::performance(*localDOMWindow) |
| 547 ->addServerTiming(response, |
| 548 localDOMWindow->hasLoadEventFired() |
| 549 ? PerformanceBase::ShouldAddToBuffer::Never |
| 550 : PerformanceBase::ShouldAddToBuffer::Always); |
| 551 } |
539 } | 552 } |
540 | 553 |
541 void FrameFetchContext::dispatchDidReceiveData(unsigned long identifier, | 554 void FrameFetchContext::dispatchDidReceiveData(unsigned long identifier, |
542 const char* data, | 555 const char* data, |
543 int dataLength) { | 556 int dataLength) { |
544 frame()->loader().progress().incrementProgress(identifier, dataLength); | 557 frame()->loader().progress().incrementProgress(identifier, dataLength); |
545 probe::didReceiveData(frame(), identifier, data, dataLength); | 558 probe::didReceiveData(frame(), identifier, data, dataLength); |
546 } | 559 } |
547 | 560 |
548 void FrameFetchContext::dispatchDidReceiveEncodedData(unsigned long identifier, | 561 void FrameFetchContext::dispatchDidReceiveEncodedData(unsigned long identifier, |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 return frame()->frameScheduler()->loadingTaskRunner(); | 1077 return frame()->frameScheduler()->loadingTaskRunner(); |
1065 } | 1078 } |
1066 | 1079 |
1067 DEFINE_TRACE(FrameFetchContext) { | 1080 DEFINE_TRACE(FrameFetchContext) { |
1068 visitor->trace(m_document); | 1081 visitor->trace(m_document); |
1069 visitor->trace(m_documentLoader); | 1082 visitor->trace(m_documentLoader); |
1070 FetchContext::trace(visitor); | 1083 FetchContext::trace(visitor); |
1071 } | 1084 } |
1072 | 1085 |
1073 } // namespace blink | 1086 } // namespace blink |
OLD | NEW |