| 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 aad2404223ad5a4d6ec402328f81e4ac9c6f6034..ec7d80b55d09b645e6b8f631c207196f06050744 100644
|
| --- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
|
| +++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
|
| @@ -79,6 +79,7 @@
|
| #include "platform/network/NetworkUtils.h"
|
| #include "platform/weborigin/SchemeRegistry.h"
|
| #include "platform/wtf/Vector.h"
|
| +#include "public/platform/Platform.h"
|
| #include "public/platform/WebCachePolicy.h"
|
| #include "public/platform/WebInsecureRequestPolicy.h"
|
| #include "public/platform/WebViewScheduler.h"
|
| @@ -455,8 +456,9 @@ void FrameFetchContext::DispatchWillSendRequest(
|
| GetFrame()->Loader().Progress().WillStartLoading(identifier,
|
| request.Priority());
|
| }
|
| - probe::willSendRequest(GetFrame(), identifier, MasterDocumentLoader(),
|
| - request, redirect_response, initiator_info);
|
| + probe::willSendRequest(GetFrame()->GetDocument(), identifier,
|
| + MasterDocumentLoader(), request, redirect_response,
|
| + initiator_info);
|
| if (GetFrame()->FrameScheduler())
|
| GetFrame()->FrameScheduler()->DidStartLoading(identifier);
|
| }
|
| @@ -505,8 +507,8 @@ void FrameFetchContext::DispatchDidReceiveResponse(
|
| GetFrame()->Loader().Progress().IncrementProgress(identifier, response);
|
| GetLocalFrameClient()->DispatchDidReceiveResponse(response);
|
| DocumentLoader* document_loader = MasterDocumentLoader();
|
| - probe::didReceiveResourceResponse(GetFrame(), identifier, document_loader,
|
| - response, resource);
|
| + probe::didReceiveResourceResponse(GetFrame()->GetDocument(), identifier,
|
| + document_loader, response, resource);
|
| // It is essential that inspector gets resource response BEFORE console.
|
| GetFrame()->Console().ReportResourceResponseReceived(document_loader,
|
| identifier, response);
|
| @@ -516,12 +518,13 @@ void FrameFetchContext::DispatchDidReceiveData(unsigned long identifier,
|
| const char* data,
|
| int data_length) {
|
| GetFrame()->Loader().Progress().IncrementProgress(identifier, data_length);
|
| - probe::didReceiveData(GetFrame(), identifier, data, data_length);
|
| + probe::didReceiveData(GetFrame()->GetDocument(), identifier,
|
| + MasterDocumentLoader(), data, data_length);
|
| }
|
|
|
| void FrameFetchContext::DispatchDidReceiveEncodedData(unsigned long identifier,
|
| int encoded_data_length) {
|
| - probe::didReceiveEncodedDataLength(GetFrame(), identifier,
|
| + probe::didReceiveEncodedDataLength(GetFrame()->GetDocument(), identifier,
|
| encoded_data_length);
|
| }
|
|
|
| @@ -529,8 +532,9 @@ void FrameFetchContext::DispatchDidDownloadData(unsigned long identifier,
|
| int data_length,
|
| int encoded_data_length) {
|
| GetFrame()->Loader().Progress().IncrementProgress(identifier, data_length);
|
| - probe::didReceiveData(GetFrame(), identifier, 0, data_length);
|
| - probe::didReceiveEncodedDataLength(GetFrame(), identifier,
|
| + probe::didReceiveData(GetFrame()->GetDocument(), identifier,
|
| + MasterDocumentLoader(), 0, data_length);
|
| + probe::didReceiveEncodedDataLength(GetFrame()->GetDocument(), identifier,
|
| encoded_data_length);
|
| }
|
|
|
| @@ -539,7 +543,8 @@ void FrameFetchContext::DispatchDidFinishLoading(unsigned long identifier,
|
| int64_t encoded_data_length,
|
| int64_t decoded_body_length) {
|
| GetFrame()->Loader().Progress().CompleteProgress(identifier);
|
| - probe::didFinishLoading(GetFrame(), identifier, finish_time,
|
| + probe::didFinishLoading(GetFrame()->GetDocument(), identifier,
|
| + MasterDocumentLoader(), finish_time,
|
| encoded_data_length, decoded_body_length);
|
| if (GetFrame()->FrameScheduler())
|
| GetFrame()->FrameScheduler()->DidStopLoading(identifier);
|
| @@ -550,7 +555,7 @@ void FrameFetchContext::DispatchDidFail(unsigned long identifier,
|
| int64_t encoded_data_length,
|
| bool is_internal_request) {
|
| GetFrame()->Loader().Progress().CompleteProgress(identifier);
|
| - probe::didFailLoading(GetFrame(), identifier, error);
|
| + probe::didFailLoading(GetFrame()->GetDocument(), identifier, error);
|
| // Notification to FrameConsole should come AFTER InspectorInstrumentation
|
| // call, DevTools front-end relies on this.
|
| if (!is_internal_request)
|
| @@ -648,8 +653,9 @@ ResourceRequestBlockedReason FrameFetchContext::CanRequest(
|
| origin_restriction, resource_request.GetRedirectStatus());
|
| if (blocked_reason != ResourceRequestBlockedReason::kNone &&
|
| reporting_policy == SecurityViolationReportingPolicy::kReport) {
|
| - probe::didBlockRequest(GetFrame(), resource_request, MasterDocumentLoader(),
|
| - options.initiator_info, blocked_reason);
|
| + probe::didBlockRequest(GetDocument(), resource_request,
|
| + MasterDocumentLoader(), options.initiator_info,
|
| + blocked_reason);
|
| }
|
| return blocked_reason;
|
| }
|
| @@ -665,8 +671,9 @@ ResourceRequestBlockedReason FrameFetchContext::AllowResponse(
|
| FetchParameters::kUseDefaultOriginRestrictionForType,
|
| RedirectStatus::kFollowedRedirect);
|
| if (blocked_reason != ResourceRequestBlockedReason::kNone) {
|
| - probe::didBlockRequest(GetFrame(), resource_request, MasterDocumentLoader(),
|
| - options.initiator_info, blocked_reason);
|
| + probe::didBlockRequest(GetDocument(), resource_request,
|
| + MasterDocumentLoader(), options.initiator_info,
|
| + blocked_reason);
|
| }
|
| return blocked_reason;
|
| }
|
| @@ -680,7 +687,7 @@ ResourceRequestBlockedReason FrameFetchContext::CanRequestInternal(
|
| FetchParameters::OriginRestriction origin_restriction,
|
| ResourceRequest::RedirectStatus redirect_status) const {
|
| bool should_block_request = false;
|
| - probe::shouldBlockRequest(GetFrame(), resource_request,
|
| + probe::shouldBlockRequest(GetDocument(), resource_request,
|
| &should_block_request);
|
| if (should_block_request)
|
| return ResourceRequestBlockedReason::kInspector;
|
| @@ -866,6 +873,12 @@ int64_t FrameFetchContext::ServiceWorkerID() const {
|
| : -1;
|
| }
|
|
|
| +int FrameFetchContext::ApplicationCacheHostID() const {
|
| + if (!document_loader_)
|
| + return 0;
|
| + return document_loader_->GetApplicationCacheHost()->GetHostID();
|
| +}
|
| +
|
| bool FrameFetchContext::IsMainFrame() const {
|
| return GetFrame()->IsMainFrame();
|
| }
|
| @@ -1026,10 +1039,18 @@ ResourceLoadPriority FrameFetchContext::ModifyPriorityForExperiments(
|
| return priority;
|
| }
|
|
|
| +RefPtr<WebTaskRunner> FrameFetchContext::TimerTaskRunner() const {
|
| + return GetFrame()->FrameScheduler()->TimerTaskRunner();
|
| +}
|
| +
|
| RefPtr<WebTaskRunner> FrameFetchContext::LoadingTaskRunner() const {
|
| return GetFrame()->FrameScheduler()->LoadingTaskRunner();
|
| }
|
|
|
| +WebURLLoader* FrameFetchContext::CreateURLLoader() {
|
| + return Platform::Current()->CreateURLLoader();
|
| +}
|
| +
|
| DEFINE_TRACE(FrameFetchContext) {
|
| visitor->Trace(document_loader_);
|
| BaseFetchContext::Trace(visitor);
|
|
|