Changeset 93182 in webkit
- Timestamp:
- Aug 16, 2011 5:16:22 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r93174 r93182 1 2011-08-16 Per-Erik Brodin <per-erik.brodin@ericsson.com> 2 3 Make it possible to explicitly prevent a preflight via ThreadableLoaderOptions 4 https://bugs.webkit.org/show_bug.cgi?id=65694 5 6 Reviewed by Alexey Proskuryakov. 7 8 No new tests since there is no change in behavior. 9 10 * fileapi/FileReaderLoader.cpp: 11 (WebCore::FileReaderLoader::start): 12 * loader/DocumentThreadableLoader.cpp: 13 (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): 14 (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest): 15 * loader/ThreadableLoader.h: 16 (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): 17 * notifications/Notification.cpp: 18 (WebCore::Notification::startLoading): 19 * xml/XMLHttpRequest.cpp: 20 (WebCore::XMLHttpRequest::createRequest): 21 1 22 2011-08-16 Scott Byer <scottbyer@chromium.org> 2 23 -
trunk/Source/WebCore/fileapi/FileReaderLoader.cpp
r89036 r93182 89 89 options.sendLoadCallbacks = true; 90 90 options.sniffContent = false; 91 options. forcePreflight = false;91 options.preflightPolicy = ConsiderPreflight; 92 92 options.allowCredentials = true; 93 93 options.crossOriginRequestPolicy = DenyCrossOriginRequests; -
trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp
r92691 r93182 99 99 updateRequestForAccessControl(*crossOriginRequest, securityOrigin(), m_options.allowCredentials); 100 100 101 if ( !m_options.forcePreflight && isSimpleCrossOriginAccessRequest(crossOriginRequest->httpMethod(), crossOriginRequest->httpHeaderFields()))101 if ((m_options.preflightPolicy == ConsiderPreflight && isSimpleCrossOriginAccessRequest(crossOriginRequest->httpMethod(), crossOriginRequest->httpHeaderFields())) || m_options.preflightPolicy == PreventPreflight) 102 102 makeSimpleCrossOriginAccessRequest(*crossOriginRequest); 103 103 else { … … 113 113 void DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest(const ResourceRequest& request) 114 114 { 115 ASSERT(isSimpleCrossOriginAccessRequest(request.httpMethod(), request.httpHeaderFields())); 115 ASSERT(m_options.preflightPolicy != ForcePreflight); 116 ASSERT(m_options.preflightPolicy == PreventPreflight || isSimpleCrossOriginAccessRequest(request.httpMethod(), request.httpHeaderFields())); 116 117 117 118 // Cross-origin requests are only defined for HTTP. We would catch this when checking response headers later, but there is no reason to send a request that's guaranteed to be denied. -
trunk/Source/WebCore/loader/ThreadableLoader.h
r87423 r93182 56 56 AllowCrossOriginRequests 57 57 }; 58 58 59 enum PreflightPolicy { 60 ConsiderPreflight, 61 ForcePreflight, 62 PreventPreflight 63 }; 64 59 65 struct ThreadableLoaderOptions { 60 ThreadableLoaderOptions() : sendLoadCallbacks(false), sniffContent(false), allowCredentials(false), forcePreflight(false), crossOriginRequestPolicy(DenyCrossOriginRequests), shouldBufferData(true) { }66 ThreadableLoaderOptions() : sendLoadCallbacks(false), sniffContent(false), allowCredentials(false), preflightPolicy(ConsiderPreflight), crossOriginRequestPolicy(DenyCrossOriginRequests), shouldBufferData(true) { } 61 67 bool sendLoadCallbacks; 62 68 bool sniffContent; 63 69 bool allowCredentials; // Whether HTTP credentials and cookies are sent with the request. 64 bool forcePreflight; // If AccessControl is used, whether to force a preflight.70 PreflightPolicy preflightPolicy; // If AccessControl is used, how to determine if a preflight is needed. 65 71 CrossOriginRequestPolicy crossOriginRequestPolicy; 66 72 bool shouldBufferData; -
trunk/Source/WebCore/notifications/Notification.cpp
r92691 r93182 169 169 options.sendLoadCallbacks = false; 170 170 options.sniffContent = false; 171 options. forcePreflight = false;171 options.preflightPolicy = ConsiderPreflight; 172 172 options.allowCredentials = AllowStoredCredentials; 173 173 options.crossOriginRequestPolicy = AllowCrossOriginRequests; -
trunk/Source/WebCore/xml/XMLHttpRequest.cpp
r92691 r93182 653 653 options.sendLoadCallbacks = true; 654 654 options.sniffContent = false; 655 options. forcePreflight = uploadEvents;655 options.preflightPolicy = uploadEvents ? ForcePreflight : ConsiderPreflight; 656 656 options.allowCredentials = m_sameOriginRequest || m_includeCredentials; 657 657 options.crossOriginRequestPolicy = UseAccessControl; -
trunk/Source/WebKit/chromium/ChangeLog
r93169 r93182 1 2011-08-16 Per-Erik Brodin <per-erik.brodin@ericsson.com> 2 3 Make it possible to explicitly prevent a preflight via ThreadableLoaderOptions 4 https://bugs.webkit.org/show_bug.cgi?id=65694 5 6 Reviewed by Alexey Proskuryakov. 7 8 * src/AssociatedURLLoader.cpp: 9 (WebKit::AssociatedURLLoader::loadAsynchronously): 10 1 11 2011-08-12 John Abd-El-Malek <jam@chromium.org> 2 12 -
trunk/Source/WebKit/chromium/src/AssociatedURLLoader.cpp
r92083 r93182 230 230 options.sniffContent = m_options.sniffContent; 231 231 options.allowCredentials = m_options.allowCredentials; 232 options. forcePreflight = m_options.forcePreflight;232 options.preflightPolicy = m_options.forcePreflight ? ForcePreflight : ConsiderPreflight; 233 233 options.crossOriginRequestPolicy = static_cast<WebCore::CrossOriginRequestPolicy>(m_options.crossOriginRequestPolicy); 234 234 options.shouldBufferData = false;
Note: See TracChangeset
for help on using the changeset viewer.