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

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

Issue 2701753003: [WIP] off-main-thread loading
Patch Set: small fix Created 3 years, 8 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 15a360bdb226a5160d48071205357c46d9f58bf6..74e18a36313bc9a71f404ebd0a9f589a3b90cf64 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/weborigin/SecurityPolicy.h"
+#include "public/platform/Platform.h"
#include "public/platform/WebCachePolicy.h"
#include "public/platform/WebInsecureRequestPolicy.h"
#include "public/platform/WebViewScheduler.h"
@@ -320,6 +321,10 @@ FrameFetchContext::~FrameFetchContext() {
m_documentLoader = nullptr;
}
+WebURLLoader* FrameFetchContext::createURLLoader() {
+ return Platform::current()->createURLLoader();
+}
+
LocalFrame* FrameFetchContext::frameOfImportsController() const {
DCHECK(m_document);
HTMLImportsController* importsController = m_document->importsController();
@@ -329,6 +334,12 @@ LocalFrame* FrameFetchContext::frameOfImportsController() const {
return frame;
}
+int FrameFetchContext::applicationCacheHostID() const {
+ if (!m_documentLoader)
+ return 0;
+ return m_documentLoader->applicationCacheHost()->getHostID();
+}
+
LocalFrame* FrameFetchContext::frame() const {
if (!m_documentLoader)
return frameOfImportsController();
@@ -480,8 +491,9 @@ void FrameFetchContext::dispatchWillSendRequest(
frame()->loader().progress().willStartLoading(identifier,
request.priority());
}
- probe::willSendRequest(frame(), identifier, masterDocumentLoader(), request,
- redirectResponse, initiatorInfo);
+ probe::willSendRequest(frame()->document(), identifier,
+ masterDocumentLoader(), request, redirectResponse,
+ initiatorInfo);
if (frame()->frameScheduler())
frame()->frameScheduler()->didStartLoading(identifier);
}
@@ -530,8 +542,8 @@ void FrameFetchContext::dispatchDidReceiveResponse(
frame()->loader().progress().incrementProgress(identifier, response);
localFrameClient()->dispatchDidReceiveResponse(response);
DocumentLoader* documentLoader = masterDocumentLoader();
- probe::didReceiveResourceResponse(frame(), identifier, documentLoader,
- response, resource);
+ probe::didReceiveResourceResponse(frame()->document(), identifier,
+ documentLoader, response, resource);
// It is essential that inspector gets resource response BEFORE console.
frame()->console().reportResourceResponseReceived(documentLoader, identifier,
response);
@@ -541,20 +553,24 @@ void FrameFetchContext::dispatchDidReceiveData(unsigned long identifier,
const char* data,
int dataLength) {
frame()->loader().progress().incrementProgress(identifier, dataLength);
- probe::didReceiveData(frame(), identifier, data, dataLength);
+ probe::didReceiveData(frame()->document(), identifier, masterDocumentLoader(),
+ data, dataLength);
}
void FrameFetchContext::dispatchDidReceiveEncodedData(unsigned long identifier,
int encodedDataLength) {
- probe::didReceiveEncodedDataLength(frame(), identifier, encodedDataLength);
+ probe::didReceiveEncodedDataLength(frame()->document(), identifier,
+ encodedDataLength);
}
void FrameFetchContext::dispatchDidDownloadData(unsigned long identifier,
int dataLength,
int encodedDataLength) {
frame()->loader().progress().incrementProgress(identifier, dataLength);
- probe::didReceiveData(frame(), identifier, 0, dataLength);
- probe::didReceiveEncodedDataLength(frame(), identifier, encodedDataLength);
+ probe::didReceiveData(frame()->document(), identifier, masterDocumentLoader(),
+ 0, dataLength);
+ probe::didReceiveEncodedDataLength(frame()->document(), identifier,
+ encodedDataLength);
}
void FrameFetchContext::dispatchDidFinishLoading(unsigned long identifier,
@@ -562,7 +578,8 @@ void FrameFetchContext::dispatchDidFinishLoading(unsigned long identifier,
int64_t encodedDataLength,
int64_t decodedBodyLength) {
frame()->loader().progress().completeProgress(identifier);
- probe::didFinishLoading(frame(), identifier, finishTime, encodedDataLength,
+ probe::didFinishLoading(frame()->document(), identifier,
+ masterDocumentLoader(), finishTime, encodedDataLength,
decodedBodyLength);
if (frame()->frameScheduler())
frame()->frameScheduler()->didStopLoading(identifier);
@@ -573,7 +590,7 @@ void FrameFetchContext::dispatchDidFail(unsigned long identifier,
int64_t encodedDataLength,
bool isInternalRequest) {
frame()->loader().progress().completeProgress(identifier);
- probe::didFailLoading(frame(), identifier, error);
+ probe::didFailLoading(frame()->document(), identifier, error);
// Notification to FrameConsole should come AFTER InspectorInstrumentation
// call, DevTools front-end relies on this.
if (!isInternalRequest)
@@ -692,7 +709,7 @@ ResourceRequestBlockedReason FrameFetchContext::canRequest(
originRestriction, resourceRequest.redirectStatus());
if (blockedReason != ResourceRequestBlockedReason::None &&
reportingPolicy == SecurityViolationReportingPolicy::Report) {
- probe::didBlockRequest(frame(), resourceRequest, masterDocumentLoader(),
+ probe::didBlockRequest(m_document, resourceRequest, masterDocumentLoader(),
options.initiatorInfo, blockedReason);
}
return blockedReason;
@@ -709,7 +726,7 @@ ResourceRequestBlockedReason FrameFetchContext::allowResponse(
FetchRequest::UseDefaultOriginRestrictionForType,
RedirectStatus::FollowedRedirect);
if (blockedReason != ResourceRequestBlockedReason::None) {
- probe::didBlockRequest(frame(), resourceRequest, masterDocumentLoader(),
+ probe::didBlockRequest(m_document, resourceRequest, masterDocumentLoader(),
options.initiatorInfo, blockedReason);
}
return blockedReason;
@@ -724,7 +741,7 @@ ResourceRequestBlockedReason FrameFetchContext::canRequestInternal(
FetchRequest::OriginRestriction originRestriction,
ResourceRequest::RedirectStatus redirectStatus) const {
bool shouldBlockRequest = false;
- probe::shouldBlockRequest(frame(), resourceRequest, &shouldBlockRequest);
+ probe::shouldBlockRequest(m_document, resourceRequest, &shouldBlockRequest);
if (shouldBlockRequest)
return ResourceRequestBlockedReason::Inspector;
@@ -1061,6 +1078,10 @@ ResourceLoadPriority FrameFetchContext::modifyPriorityForExperiments(
return priority;
}
+RefPtr<WebTaskRunner> FrameFetchContext::timerTaskRunner() const {
+ return frame()->frameScheduler()->timerTaskRunner();
+}
+
RefPtr<WebTaskRunner> FrameFetchContext::loadingTaskRunner() const {
return frame()->frameScheduler()->loadingTaskRunner();
}
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContext.h ('k') | third_party/WebKit/Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698