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

Unified Diff: Source/core/fetch/ResourceLoader.cpp

Issue 1129743002: Gracefully handle backdoor cancellations of synchronous resource fetches. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « LayoutTests/plugins/plugin-cancel-sync-xhr-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/ResourceLoader.cpp
diff --git a/Source/core/fetch/ResourceLoader.cpp b/Source/core/fetch/ResourceLoader.cpp
index 22446179362695b86f56b20b0bce0c0382661ae4..1c499773aade8b615aab3d37a8b6b6a7cbd6b801 100644
--- a/Source/core/fetch/ResourceLoader.cpp
+++ b/Source/core/fetch/ResourceLoader.cpp
@@ -513,6 +513,12 @@ void ResourceLoader::requestSynchronously()
WebData dataOut;
loader->loadSynchronously(requestIn, responseOut, errorOut, dataOut);
if (errorOut.reason) {
+ if (m_state == Terminated) {
+ // A message dispatched while synchronously fetching the resource
+ // can bring about the cancellation of this load.
+ ASSERT(!m_resource);
+ return;
+ }
didFail(0, errorOut);
return;
}
« no previous file with comments | « LayoutTests/plugins/plugin-cancel-sync-xhr-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698