Chromium Code Reviews| 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); |
| } |