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

Unified Diff: Source/core/loader/WorkerThreadableLoader.cpp

Issue 273993002: Allow XHR timeout attribute to be overridden after send(), per spec (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase again Created 6 years, 4 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 | « Source/core/loader/WorkerThreadableLoader.h ('k') | Source/core/xml/XMLHttpRequest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/WorkerThreadableLoader.cpp
diff --git a/Source/core/loader/WorkerThreadableLoader.cpp b/Source/core/loader/WorkerThreadableLoader.cpp
index fe4f3f260978a9cd0e46f3cc94cc94eca0918951..22ee61ae411071ba64e058fff2a31e4eb4a3c1f1 100644
--- a/Source/core/loader/WorkerThreadableLoader.cpp
+++ b/Source/core/loader/WorkerThreadableLoader.cpp
@@ -95,6 +95,11 @@ void WorkerThreadableLoader::loadResourceSynchronously(WorkerGlobalScope& worker
clientBridgePtr->run();
}
+void WorkerThreadableLoader::overrideTimeout(unsigned long timeoutMilliseconds)
+{
+ m_bridge.overrideTimeout(timeoutMilliseconds);
+}
+
void WorkerThreadableLoader::cancel()
{
m_bridge.cancel();
@@ -154,6 +159,23 @@ void WorkerThreadableLoader::MainThreadBridge::destroy()
createCrossThreadTask(&MainThreadBridge::mainThreadDestroy, AllowCrossThreadAccess(this)));
}
+void WorkerThreadableLoader::MainThreadBridge::mainThreadOverrideTimeout(ExecutionContext* context, MainThreadBridge* thisPtr, unsigned long timeoutMilliseconds)
+{
+ ASSERT(isMainThread());
+ ASSERT_UNUSED(context, context->isDocument());
+
+ if (!thisPtr->m_mainThreadLoader)
+ return;
+ thisPtr->m_mainThreadLoader->overrideTimeout(timeoutMilliseconds);
+}
+
+void WorkerThreadableLoader::MainThreadBridge::overrideTimeout(unsigned long timeoutMilliseconds)
+{
+ m_loaderProxy.postTaskToLoader(
+ createCrossThreadTask(&MainThreadBridge::mainThreadOverrideTimeout, AllowCrossThreadAccess(this),
+ timeoutMilliseconds));
+}
+
void WorkerThreadableLoader::MainThreadBridge::mainThreadCancel(ExecutionContext* context, MainThreadBridge* thisPtr)
{
ASSERT(isMainThread());
« no previous file with comments | « Source/core/loader/WorkerThreadableLoader.h ('k') | Source/core/xml/XMLHttpRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698