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

Unified Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp

Issue 2925963002: Create NetworkQuietDetector. (Closed)
Patch Set: Send network idle signal to GRC Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
index 92e76b7a0daddc290f6d349084370051bb31f948..4b15b5e5d03f2d7348a0447acbe406ead1bbfbd1 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -172,13 +172,15 @@ WebCachePolicy DetermineFrameWebCachePolicy(Frame* frame,
FrameFetchContext::FrameFetchContext(DocumentLoader* loader, Document* document)
: document_loader_(loader), document_(document) {
DCHECK(GetFrame());
+ if (document)
+ network_quiet_detector_ = new NetworkQuietDetector(document);
zhenw 2017/06/07 17:32:56 I think there is a question about whether NetworkQ
lpy 2017/06/07 18:32:45 Done.
}
void FrameFetchContext::ProvideDocumentToContext(FetchContext& context,
Document* document) {
DCHECK(document);
CHECK(context.IsFrameFetchContext());
- static_cast<FrameFetchContext&>(context).document_ = document;
+ static_cast<FrameFetchContext&>(context).SetDocument(document);
}
FrameFetchContext::~FrameFetchContext() {
@@ -203,6 +205,12 @@ Document* FrameFetchContext::GetDocument() const {
return document_;
}
+void FrameFetchContext::SetDocument(Document* document) {
+ document_ = document;
+ if (document)
+ network_quiet_detector_ = new NetworkQuietDetector(document);
+}
+
LocalFrame* FrameFetchContext::GetFrame() const {
if (!document_loader_)
return FrameOfImportsController();
@@ -501,6 +509,7 @@ void FrameFetchContext::DidLoadResource(Resource* resource) {
if (!GetDocument())
return;
FirstMeaningfulPaintDetector::From(*GetDocument()).CheckNetworkStable();
+ network_quiet_detector_->CheckNetworkStable();
zhenw 2017/06/07 17:32:56 I think the plan is to let FMPDetector also use th
lpy 2017/06/07 18:32:45 Discussed offline, updated the description to refl
if (resource->IsLoadEventBlockingResourceType())
GetDocument()->CheckCompleted();
}
@@ -855,6 +864,7 @@ void FrameFetchContext::Detach() {
DEFINE_TRACE(FrameFetchContext) {
visitor->Trace(document_loader_);
visitor->Trace(document_);
+ visitor->Trace(network_quiet_detector_);
BaseFetchContext::Trace(visitor);
}

Powered by Google App Engine
This is Rietveld 408576698