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

Side by Side Diff: third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp

Issue 1356353003: Relax cross-origin partial response requirements for CORS presence. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert accidental php change. Created 5 years, 1 month 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 | « third_party/WebKit/LayoutTests/http/tests/media/resources/serve-video.php ('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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013, Intel Corporation 3 * Copyright (C) 2013, Intel Corporation
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 // |this| may be dead here. 153 // |this| may be dead here.
154 return; 154 return;
155 } 155 }
156 156
157 m_requestStartedSeconds = monotonicallyIncreasingTime(); 157 m_requestStartedSeconds = monotonicallyIncreasingTime();
158 158
159 // Save any CORS simple headers on the request here. If this request redirec ts cross-origin, we cancel the old request 159 // Save any CORS simple headers on the request here. If this request redirec ts cross-origin, we cancel the old request
160 // create a new one, and copy these headers. 160 // create a new one, and copy these headers.
161 const HTTPHeaderMap& headerMap = request.httpHeaderFields(); 161 const HTTPHeaderMap& headerMap = request.httpHeaderFields();
162 for (const auto& header : headerMap) { 162 for (const auto& header : headerMap) {
163 if (FetchUtils::isSimpleHeader(header.key, header.value)) 163 if (FetchUtils::isSimpleHeader(header.key, header.value)) {
164 m_simpleRequestHeaders.add(header.key, header.value); 164 m_simpleRequestHeaders.add(header.key, header.value);
165 } else if (equalIgnoringCase(header.key, "range") && m_options.crossOrig inRequestPolicy == UseAccessControl && m_options.preflightPolicy == PreventPrefl ight) {
166 // Allow an exception for the "range" header for when CORS callers r equest no preflight, this ensures cross-origin
167 // redirects work correctly for crossOrigin enabled WebURLRequest::R equestContextVideo type requests.
168 m_simpleRequestHeaders.add(header.key, header.value);
169 }
165 } 170 }
166 171
167 // DocumentThreadableLoader is used by all javascript initiated fetch, so 172 // DocumentThreadableLoader is used by all javascript initiated fetch, so
168 // we use this chance to record non-GET fetch script requests. 173 // we use this chance to record non-GET fetch script requests.
169 // However, this is based on the following assumptions, so please be careful 174 // However, this is based on the following assumptions, so please be careful
170 // when adding similar logic: 175 // when adding similar logic:
171 // - ThreadableLoader is used as backend for all javascript initiated networ k 176 // - ThreadableLoader is used as backend for all javascript initiated networ k
172 // fetches. 177 // fetches.
173 // - Note that ThreadableLoader is also used for non-network fetch such as 178 // - Note that ThreadableLoader is also used for non-network fetch such as
174 // FileReaderLoader. However it emulates GET method so signal is not 179 // FileReaderLoader. However it emulates GET method so signal is not
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 return DoNotAllowStoredCredentials; 870 return DoNotAllowStoredCredentials;
866 return m_resourceLoaderOptions.allowCredentials; 871 return m_resourceLoaderOptions.allowCredentials;
867 } 872 }
868 873
869 SecurityOrigin* DocumentThreadableLoader::securityOrigin() const 874 SecurityOrigin* DocumentThreadableLoader::securityOrigin() const
870 { 875 {
871 return m_securityOrigin ? m_securityOrigin.get() : m_document.securityOrigin (); 876 return m_securityOrigin ? m_securityOrigin.get() : m_document.securityOrigin ();
872 } 877 }
873 878
874 } // namespace blink 879 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/media/resources/serve-video.php ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698