OLD | NEW |
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 Loading... |
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& override) | 1036 void XMLHttpRequest::overrideMimeType(const AtomicString& mimeType, ExceptionSta
te& exceptionState) |
1037 { | 1037 { |
1038 // FIXME: This method must throw an InvalidStateError exception when the | 1038 if (m_state == LOADING || m_state == DONE) { |
1039 // XHR is in the LOADING or DONE state. http://crbug.com/402375 | 1039 exceptionState.throwDOMException(InvalidStateError, "MimeType cannot be
overridden when the state is LOADING or DONE."); |
| 1040 return; |
| 1041 } |
1040 | 1042 |
1041 m_mimeTypeOverride = override; | 1043 m_mimeTypeOverride = mimeType; |
1042 } | 1044 } |
1043 | 1045 |
1044 void XMLHttpRequest::setRequestHeader(const AtomicString& name, const AtomicStri
ng& value, ExceptionState& exceptionState) | 1046 void XMLHttpRequest::setRequestHeader(const AtomicString& name, const AtomicStri
ng& value, ExceptionState& exceptionState) |
1045 { | 1047 { |
1046 if (m_state != OPENED || m_loader) { | 1048 if (m_state != OPENED || m_loader) { |
1047 exceptionState.throwDOMException(InvalidStateError, "The object's state
must be OPENED."); | 1049 exceptionState.throwDOMException(InvalidStateError, "The object's state
must be OPENED."); |
1048 return; | 1050 return; |
1049 } | 1051 } |
1050 | 1052 |
1051 if (!isValidHTTPToken(name)) { | 1053 if (!isValidHTTPToken(name)) { |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 { | 1420 { |
1419 visitor->trace(m_responseBlob); | 1421 visitor->trace(m_responseBlob); |
1420 visitor->trace(m_responseStream); | 1422 visitor->trace(m_responseStream); |
1421 visitor->trace(m_responseDocument); | 1423 visitor->trace(m_responseDocument); |
1422 visitor->trace(m_progressEventThrottle); | 1424 visitor->trace(m_progressEventThrottle); |
1423 visitor->trace(m_upload); | 1425 visitor->trace(m_upload); |
1424 XMLHttpRequestEventTarget::trace(visitor); | 1426 XMLHttpRequestEventTarget::trace(visitor); |
1425 } | 1427 } |
1426 | 1428 |
1427 } // namespace blink | 1429 } // namespace blink |
OLD | NEW |