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

Unified Diff: third_party/WebKit/Source/core/loader/DocumentThreadableLoader.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/DocumentThreadableLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
index 07ae3e3795a89e8755350dd2aa2908ddea0a5294..096306e2913c4ac2b66be335a1ff4e25975205cd 100644
--- a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
@@ -390,7 +390,10 @@ void DocumentThreadableLoader::makeCrossOriginAccessRequest(
bool shouldForcePreflight = request.isExternalRequest();
if (!shouldForcePreflight)
probe::shouldForceCORSPreflight(document(), &shouldForcePreflight);
+ // TODO(horo): Move CrossOriginPreflightResultCache to
+ // ThreadableLoadingContext
bool canSkipPreflight =
+ isMainThread() &&
CrossOriginPreflightResultCache::shared().canSkipPreflight(
getSecurityOrigin()->toString(), crossOriginRequest.url(),
effectiveAllowCredentials(), crossOriginRequest.httpMethod(),
@@ -762,10 +765,13 @@ void DocumentThreadableLoader::handlePreflightResponse(
accessControlErrorDescription);
return;
}
-
- CrossOriginPreflightResultCache::shared().appendEntry(
- getSecurityOrigin()->toString(), m_actualRequest.url(),
- std::move(preflightResult));
+ if (isMainThread()) {
+ // TODO(horo): Move CrossOriginPreflightResultCache to
+ // ThreadableLoadingContext
+ CrossOriginPreflightResultCache::shared().appendEntry(
+ getSecurityOrigin()->toString(), m_actualRequest.url(),
+ std::move(preflightResult));
+ }
}
void DocumentThreadableLoader::reportResponseReceived(
@@ -775,7 +781,7 @@ void DocumentThreadableLoader::reportResponseReceived(
if (!frame)
return;
DocumentLoader* loader = frame->loader().documentLoader();
- probe::didReceiveResourceResponse(frame, identifier, loader, response,
+ probe::didReceiveResourceResponse(document(), identifier, loader, response,
resource());
frame->console().reportResourceResponseReceived(loader, identifier, response);
}
« no previous file with comments | « third_party/WebKit/Source/core/loader/BUILD.gn ('k') | third_party/WebKit/Source/core/loader/FrameFetchContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698