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

Side by Side Diff: Source/core/xml/XMLHttpRequest.cpp

Issue 486703002: Revert of XMLHttpRequest::overrideMimeType should throw InvalidStateError (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/xml/XMLHttpRequest.h ('k') | Source/core/xml/XMLHttpRequest.idl » ('j') | 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 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 } 1026 }
1027 1027
1028 // Note: The below event dispatch may be called while |hasPendingActivity() == false|, 1028 // Note: The below event dispatch may be called while |hasPendingActivity() == false|,
1029 // when |handleRequestError| is called after |internalAbort()|. 1029 // when |handleRequestError| is called after |internalAbort()|.
1030 // This is safe, however, as |this| will be kept alive from a strong ref |Ev ent::m_target|. 1030 // This is safe, however, as |this| will be kept alive from a strong ref |Ev ent::m_target|.
1031 dispatchProgressEvent(EventTypeNames::progress, receivedLength, expectedLeng th); 1031 dispatchProgressEvent(EventTypeNames::progress, receivedLength, expectedLeng th);
1032 dispatchProgressEvent(type, receivedLength, expectedLength); 1032 dispatchProgressEvent(type, receivedLength, expectedLength);
1033 dispatchProgressEvent(EventTypeNames::loadend, receivedLength, expectedLengt h); 1033 dispatchProgressEvent(EventTypeNames::loadend, receivedLength, expectedLengt h);
1034 } 1034 }
1035 1035
1036 void XMLHttpRequest::overrideMimeType(const AtomicString& mimeType, ExceptionSta te& exceptionState) 1036 void XMLHttpRequest::overrideMimeType(const AtomicString& override)
1037 { 1037 {
1038 if (m_state == LOADING || m_state == DONE) { 1038 // FIXME: This method must throw an InvalidStateError exception when the
1039 exceptionState.throwDOMException(InvalidStateError, "MimeType cannot be overridden when the state is LOADING or DONE."); 1039 // XHR is in the LOADING or DONE state. http://crbug.com/402375
1040 return;
1041 }
1042 1040
1043 m_mimeTypeOverride = mimeType; 1041 m_mimeTypeOverride = override;
1044 } 1042 }
1045 1043
1046 void XMLHttpRequest::setRequestHeader(const AtomicString& name, const AtomicStri ng& value, ExceptionState& exceptionState) 1044 void XMLHttpRequest::setRequestHeader(const AtomicString& name, const AtomicStri ng& value, ExceptionState& exceptionState)
1047 { 1045 {
1048 if (m_state != OPENED || m_loader) { 1046 if (m_state != OPENED || m_loader) {
1049 exceptionState.throwDOMException(InvalidStateError, "The object's state must be OPENED."); 1047 exceptionState.throwDOMException(InvalidStateError, "The object's state must be OPENED.");
1050 return; 1048 return;
1051 } 1049 }
1052 1050
1053 if (!isValidHTTPToken(name)) { 1051 if (!isValidHTTPToken(name)) {
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1420 { 1418 {
1421 visitor->trace(m_responseBlob); 1419 visitor->trace(m_responseBlob);
1422 visitor->trace(m_responseStream); 1420 visitor->trace(m_responseStream);
1423 visitor->trace(m_responseDocument); 1421 visitor->trace(m_responseDocument);
1424 visitor->trace(m_progressEventThrottle); 1422 visitor->trace(m_progressEventThrottle);
1425 visitor->trace(m_upload); 1423 visitor->trace(m_upload);
1426 XMLHttpRequestEventTarget::trace(visitor); 1424 XMLHttpRequestEventTarget::trace(visitor);
1427 } 1425 }
1428 1426
1429 } // namespace blink 1427 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/xml/XMLHttpRequest.h ('k') | Source/core/xml/XMLHttpRequest.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698