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

Side by Side 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: Rebased with latest 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 unified diff | Download patch
« no previous file with comments | « Source/core/frame/UseCounter.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> 3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org>
4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> 4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org>
5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved. 5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved.
6 * Copyright (C) 2012 Intel Corporation 6 * Copyright (C) 2012 Intel Corporation
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 17 matching lines...) Expand all
28 #include "core/dom/ContextFeatures.h" 28 #include "core/dom/ContextFeatures.h"
29 #include "core/dom/DOMImplementation.h" 29 #include "core/dom/DOMImplementation.h"
30 #include "core/dom/ExceptionCode.h" 30 #include "core/dom/ExceptionCode.h"
31 #include "core/dom/XMLDocument.h" 31 #include "core/dom/XMLDocument.h"
32 #include "core/editing/markup.h" 32 #include "core/editing/markup.h"
33 #include "core/events/Event.h" 33 #include "core/events/Event.h"
34 #include "core/fetch/CrossOriginAccessControl.h" 34 #include "core/fetch/CrossOriginAccessControl.h"
35 #include "core/fileapi/Blob.h" 35 #include "core/fileapi/Blob.h"
36 #include "core/fileapi/File.h" 36 #include "core/fileapi/File.h"
37 #include "core/fileapi/Stream.h" 37 #include "core/fileapi/Stream.h"
38 #include "core/frame/Settings.h"
39 #include "core/frame/UseCounter.h"
38 #include "core/frame/csp/ContentSecurityPolicy.h" 40 #include "core/frame/csp/ContentSecurityPolicy.h"
39 #include "core/html/DOMFormData.h" 41 #include "core/html/DOMFormData.h"
40 #include "core/html/HTMLDocument.h" 42 #include "core/html/HTMLDocument.h"
41 #include "core/html/parser/TextResourceDecoder.h" 43 #include "core/html/parser/TextResourceDecoder.h"
42 #include "core/inspector/InspectorInstrumentation.h" 44 #include "core/inspector/InspectorInstrumentation.h"
43 #include "core/inspector/InspectorTraceEvents.h" 45 #include "core/inspector/InspectorTraceEvents.h"
44 #include "core/loader/ThreadableLoader.h" 46 #include "core/loader/ThreadableLoader.h"
45 #include "core/frame/Settings.h"
46 #include "core/xml/XMLHttpRequestProgressEvent.h" 47 #include "core/xml/XMLHttpRequestProgressEvent.h"
47 #include "core/xml/XMLHttpRequestUpload.h" 48 #include "core/xml/XMLHttpRequestUpload.h"
48 #include "platform/Logging.h" 49 #include "platform/Logging.h"
49 #include "platform/RuntimeEnabledFeatures.h" 50 #include "platform/RuntimeEnabledFeatures.h"
50 #include "platform/SharedBuffer.h" 51 #include "platform/SharedBuffer.h"
51 #include "platform/blob/BlobData.h" 52 #include "platform/blob/BlobData.h"
52 #include "platform/network/HTTPParsers.h" 53 #include "platform/network/HTTPParsers.h"
53 #include "platform/network/ParsedContentType.h" 54 #include "platform/network/ParsedContentType.h"
54 #include "platform/network/ResourceError.h" 55 #include "platform/network/ResourceError.h"
55 #include "platform/network/ResourceRequest.h" 56 #include "platform/network/ResourceRequest.h"
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 } 480 }
480 } 481 }
481 482
482 void XMLHttpRequest::setWithCredentials(bool value, ExceptionState& exceptionSta te) 483 void XMLHttpRequest::setWithCredentials(bool value, ExceptionState& exceptionSta te)
483 { 484 {
484 if (m_state > OPENED || m_loader) { 485 if (m_state > OPENED || m_loader) {
485 exceptionState.throwDOMException(InvalidStateError, "The value may only be set if the object's state is UNSENT or OPENED."); 486 exceptionState.throwDOMException(InvalidStateError, "The value may only be set if the object's state is UNSENT or OPENED.");
486 return; 487 return;
487 } 488 }
488 489
490 // FIXME: According to XMLHttpRequest Level 2 we should throw InvalidAccessE rror exception here.
491 // However for time being only print warning message to warn web developers.
492 if (!m_async && executionContext()->isDocument())
sof 2014/06/18 08:16:06 No need to check isDocument(), just pass in execut
maheshkk 2014/06/18 15:55:08 You are right. Once http://code.google.com/p/chrom
493 UseCounter::countDeprecation(document(), UseCounter::SyncXHRWithCredenti als);
sof 2014/06/18 08:16:06 With https://codereview.chromium.org/337283003 add
maheshkk 2014/06/18 15:55:08 IMO, printing deprecated message will serve as ear
sof 2014/06/18 16:13:36 I understand what you hope is the side-effect of a
maheshkk 2014/06/18 23:53:07 Agreed. We could go by only adding UseCounter now
494
489 m_includeCredentials = value; 495 m_includeCredentials = value;
490 } 496 }
491 497
492 bool XMLHttpRequest::isAllowedHTTPMethod(const String& method) 498 bool XMLHttpRequest::isAllowedHTTPMethod(const String& method)
493 { 499 {
494 return !equalIgnoringCase(method, "TRACE") 500 return !equalIgnoringCase(method, "TRACE")
495 && !equalIgnoringCase(method, "TRACK") 501 && !equalIgnoringCase(method, "TRACK")
496 && !equalIgnoringCase(method, "CONNECT"); 502 && !equalIgnoringCase(method, "CONNECT");
497 } 503 }
498 504
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after
1458 { 1464 {
1459 visitor->trace(m_responseBlob); 1465 visitor->trace(m_responseBlob);
1460 visitor->trace(m_responseStream); 1466 visitor->trace(m_responseStream);
1461 visitor->trace(m_responseDocument); 1467 visitor->trace(m_responseDocument);
1462 visitor->trace(m_progressEventThrottle); 1468 visitor->trace(m_progressEventThrottle);
1463 visitor->trace(m_upload); 1469 visitor->trace(m_upload);
1464 XMLHttpRequestEventTarget::trace(visitor); 1470 XMLHttpRequestEventTarget::trace(visitor);
1465 } 1471 }
1466 1472
1467 } // namespace WebCore 1473 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/frame/UseCounter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698