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

Unified Diff: Source/core/xml/XMLHttpRequest.cpp

Issue 329323002: Deprecate support for xhr.withCredentials for synchronous requests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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/http/tests/xmlhttprequest/cross-origin-cookie-storage-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/xml/XMLHttpRequest.cpp
diff --git a/Source/core/xml/XMLHttpRequest.cpp b/Source/core/xml/XMLHttpRequest.cpp
index 3befd8e2073a228de6f5b8b423db4ba35ff31784..90295c70426d10ec679ce27ba9922a868a4844c7 100644
--- a/Source/core/xml/XMLHttpRequest.cpp
+++ b/Source/core/xml/XMLHttpRequest.cpp
@@ -486,6 +486,14 @@ void XMLHttpRequest::setWithCredentials(bool value, ExceptionState& exceptionSta
return;
}
+ // FIXME: According to XMLHttpRequest Level 2 we should throw InvalidAccessError exception here.
+ // However for time being only throw warning message to console to give web developers time to update.
+ if (!m_async && executionContext()->isDocument()) {
+ String consoleMessage("Support for withCredentials deprecated for synchronous requests.");
Inactive 2014/06/12 13:28:39 If you do this, you will like need to add a UseCou
+ executionContext()->addConsoleMessage(JSMessageSource, WarningMessageLevel, consoleMessage);
+ return;
+ }
+
m_includeCredentials = value;
}
« no previous file with comments | « LayoutTests/http/tests/xmlhttprequest/cross-origin-cookie-storage-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698