Chromium Code Reviews| 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 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1171 if (m_state != OPENED || m_loader) { | 1171 if (m_state != OPENED || m_loader) { |
| 1172 exceptionState.throwDOMException(InvalidStateError, "The object's state must be OPENED."); | 1172 exceptionState.throwDOMException(InvalidStateError, "The object's state must be OPENED."); |
| 1173 return; | 1173 return; |
| 1174 } | 1174 } |
| 1175 | 1175 |
| 1176 if (!isValidHTTPToken(name)) { | 1176 if (!isValidHTTPToken(name)) { |
| 1177 exceptionState.throwDOMException(SyntaxError, "'" + name + "' is not a v alid HTTP header field name."); | 1177 exceptionState.throwDOMException(SyntaxError, "'" + name + "' is not a v alid HTTP header field name."); |
| 1178 return; | 1178 return; |
| 1179 } | 1179 } |
| 1180 | 1180 |
| 1181 // Show deprecation warnings and count occurrences of such deprecated header values | |
| 1182 if (isValidHTTPHeaderValueForFetch(value)) | |
|
hiroshige
2015/08/27 11:38:08
How about replacing this with "if (!isValidHTTPHea
shiva.jm
2015/09/01 08:26:51
Done.
| |
| 1183 UseCounter::countDeprecation(executionContext(), UseCounter::FetchHeader Value); | |
| 1184 | |
| 1181 if (!isValidHTTPHeaderValue(value)) { | 1185 if (!isValidHTTPHeaderValue(value)) { |
| 1182 exceptionState.throwDOMException(SyntaxError, "'" + value + "' is not a valid HTTP header field value."); | 1186 exceptionState.throwDOMException(SyntaxError, "'" + value + "' is not a valid HTTP header field value."); |
| 1183 return; | 1187 return; |
| 1184 } | 1188 } |
| 1185 | 1189 |
| 1186 // No script (privileged or not) can set unsafe headers. | 1190 // No script (privileged or not) can set unsafe headers. |
| 1187 if (FetchUtils::isForbiddenHeaderName(name)) { | 1191 if (FetchUtils::isForbiddenHeaderName(name)) { |
| 1188 logConsoleError(executionContext(), "Refused to set unsafe header \"" + name + "\""); | 1192 logConsoleError(executionContext(), "Refused to set unsafe header \"" + name + "\""); |
| 1189 return; | 1193 return; |
| 1190 } | 1194 } |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1693 visitor->trace(m_responseDocumentParser); | 1697 visitor->trace(m_responseDocumentParser); |
| 1694 visitor->trace(m_progressEventThrottle); | 1698 visitor->trace(m_progressEventThrottle); |
| 1695 visitor->trace(m_upload); | 1699 visitor->trace(m_upload); |
| 1696 visitor->trace(m_blobLoader); | 1700 visitor->trace(m_blobLoader); |
| 1697 XMLHttpRequestEventTarget::trace(visitor); | 1701 XMLHttpRequestEventTarget::trace(visitor); |
| 1698 DocumentParserClient::trace(visitor); | 1702 DocumentParserClient::trace(visitor); |
| 1699 ActiveDOMObject::trace(visitor); | 1703 ActiveDOMObject::trace(visitor); |
| 1700 } | 1704 } |
| 1701 | 1705 |
| 1702 } // namespace blink | 1706 } // namespace blink |
| OLD | NEW |