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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp

Issue 2799093004: Enable ServerTiming support
Patch Set: updates for Patch Set 7 Created 3 years, 7 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
OLDNEW
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 #include "core/loader/ProgressTracker.h" 57 #include "core/loader/ProgressTracker.h"
58 #include "core/loader/SubresourceFilter.h" 58 #include "core/loader/SubresourceFilter.h"
59 #include "core/loader/appcache/ApplicationCacheHost.h" 59 #include "core/loader/appcache/ApplicationCacheHost.h"
60 #include "core/loader/private/FrameClientHintsPreferencesContext.h" 60 #include "core/loader/private/FrameClientHintsPreferencesContext.h"
61 #include "core/page/Page.h" 61 #include "core/page/Page.h"
62 #include "core/paint/FirstMeaningfulPaintDetector.h" 62 #include "core/paint/FirstMeaningfulPaintDetector.h"
63 #include "core/probe/CoreProbes.h" 63 #include "core/probe/CoreProbes.h"
64 #include "core/svg/graphics/SVGImageChromeClient.h" 64 #include "core/svg/graphics/SVGImageChromeClient.h"
65 #include "core/timing/DOMWindowPerformance.h" 65 #include "core/timing/DOMWindowPerformance.h"
66 #include "core/timing/Performance.h" 66 #include "core/timing/Performance.h"
67 #include "core/timing/PerformanceBase.h"
67 #include "platform/WebFrameScheduler.h" 68 #include "platform/WebFrameScheduler.h"
68 #include "platform/exported/WrappedResourceRequest.h" 69 #include "platform/exported/WrappedResourceRequest.h"
69 #include "platform/instrumentation/tracing/TracedValue.h" 70 #include "platform/instrumentation/tracing/TracedValue.h"
70 #include "platform/loader/fetch/ClientHintsPreferences.h" 71 #include "platform/loader/fetch/ClientHintsPreferences.h"
71 #include "platform/loader/fetch/FetchInitiatorTypeNames.h" 72 #include "platform/loader/fetch/FetchInitiatorTypeNames.h"
72 #include "platform/loader/fetch/Resource.h" 73 #include "platform/loader/fetch/Resource.h"
73 #include "platform/loader/fetch/ResourceLoadPriority.h" 74 #include "platform/loader/fetch/ResourceLoadPriority.h"
74 #include "platform/loader/fetch/ResourceLoadingLog.h" 75 #include "platform/loader/fetch/ResourceLoadingLog.h"
75 #include "platform/loader/fetch/ResourceTimingInfo.h" 76 #include "platform/loader/fetch/ResourceTimingInfo.h"
76 #include "platform/loader/fetch/UniqueIdentifier.h" 77 #include "platform/loader/fetch/UniqueIdentifier.h"
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 } 504 }
504 505
505 GetFrame()->Loader().Progress().IncrementProgress(identifier, response); 506 GetFrame()->Loader().Progress().IncrementProgress(identifier, response);
506 GetLocalFrameClient()->DispatchDidReceiveResponse(response); 507 GetLocalFrameClient()->DispatchDidReceiveResponse(response);
507 DocumentLoader* document_loader = MasterDocumentLoader(); 508 DocumentLoader* document_loader = MasterDocumentLoader();
508 probe::didReceiveResourceResponse(GetFrame(), identifier, document_loader, 509 probe::didReceiveResourceResponse(GetFrame(), identifier, document_loader,
509 response, resource); 510 response, resource);
510 // It is essential that inspector gets resource response BEFORE console. 511 // It is essential that inspector gets resource response BEFORE console.
511 GetFrame()->Console().ReportResourceResponseReceived(document_loader, 512 GetFrame()->Console().ReportResourceResponseReceived(document_loader,
512 identifier, response); 513 identifier, response);
514
515 // MainResource responses were already added, skip them here.
516 if (RuntimeEnabledFeatures::serverTimingEnabled() &&
517 resource->GetType() != Resource::kMainResource &&
518 GetFrame()->GetDocument() && GetFrame()->GetDocument()->domWindow()) {
519 LocalDOMWindow* localDOMWindow = GetFrame()->GetDocument()->domWindow();
520 DOMWindowPerformance::performance(*localDOMWindow)
521 ->AddServerTiming(response,
522 localDOMWindow->HasLoadEventFired()
523 ? PerformanceBase::ShouldAddToBuffer::Never
524 : PerformanceBase::ShouldAddToBuffer::Always);
525 }
513 } 526 }
514 527
515 void FrameFetchContext::DispatchDidReceiveData(unsigned long identifier, 528 void FrameFetchContext::DispatchDidReceiveData(unsigned long identifier,
516 const char* data, 529 const char* data,
517 int data_length) { 530 int data_length) {
518 GetFrame()->Loader().Progress().IncrementProgress(identifier, data_length); 531 GetFrame()->Loader().Progress().IncrementProgress(identifier, data_length);
519 probe::didReceiveData(GetFrame(), identifier, data, data_length); 532 probe::didReceiveData(GetFrame(), identifier, data, data_length);
520 } 533 }
521 534
522 void FrameFetchContext::DispatchDidReceiveEncodedData(unsigned long identifier, 535 void FrameFetchContext::DispatchDidReceiveEncodedData(unsigned long identifier,
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 RefPtr<WebTaskRunner> FrameFetchContext::LoadingTaskRunner() const { 1042 RefPtr<WebTaskRunner> FrameFetchContext::LoadingTaskRunner() const {
1030 return GetFrame()->FrameScheduler()->LoadingTaskRunner(); 1043 return GetFrame()->FrameScheduler()->LoadingTaskRunner();
1031 } 1044 }
1032 1045
1033 DEFINE_TRACE(FrameFetchContext) { 1046 DEFINE_TRACE(FrameFetchContext) {
1034 visitor->Trace(document_loader_); 1047 visitor->Trace(document_loader_);
1035 BaseFetchContext::Trace(visitor); 1048 BaseFetchContext::Trace(visitor);
1036 } 1049 }
1037 1050
1038 } // namespace blink 1051 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.cpp ('k') | third_party/WebKit/Source/core/timing/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698