Title: [202741] trunk/Source/WebCore
Revision
202741
Author
[email protected]
Date
2016-07-01 10:03:27 -0700 (Fri, 01 Jul 2016)

Log Message

Make ResourceLoaderOptions derive from FetchOptions
https://bugs.webkit.org/show_bug.cgi?id=159345

Patch by Youenn Fablet <[email protected]> on 2016-07-01
Reviewed by Alex Christensen.

No change of behavior.

* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::start):
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::startPreflight):
* loader/ResourceLoaderOptions.h:
(WebCore::ResourceLoaderOptions::fetchOptions): Deleted.
(WebCore::ResourceLoaderOptions::setFetchOptions): Deleted.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
* loader/ThreadableLoader.h: Removing securityOrigin field (left over from https://bugs.webkit.org/show_bug.cgi?id=159221)

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (202740 => 202741)


--- trunk/Source/WebCore/ChangeLog	2016-07-01 17:00:48 UTC (rev 202740)
+++ trunk/Source/WebCore/ChangeLog	2016-07-01 17:03:27 UTC (rev 202741)
@@ -1,3 +1,23 @@
+2016-07-01  Youenn Fablet  <[email protected]>
+
+        Make ResourceLoaderOptions derive from FetchOptions
+        https://bugs.webkit.org/show_bug.cgi?id=159345
+
+        Reviewed by Alex Christensen.
+
+        No change of behavior.
+
+        * Modules/fetch/FetchLoader.cpp:
+        (WebCore::FetchLoader::start):
+        * loader/CrossOriginPreflightChecker.cpp:
+        (WebCore::CrossOriginPreflightChecker::startPreflight):
+        * loader/ResourceLoaderOptions.h:
+        (WebCore::ResourceLoaderOptions::fetchOptions): Deleted.
+        (WebCore::ResourceLoaderOptions::setFetchOptions): Deleted.
+        * loader/SubresourceLoader.cpp:
+        (WebCore::SubresourceLoader::willSendRequestInternal):
+        * loader/ThreadableLoader.h: Removing securityOrigin field (left over from https://bugs.webkit.org/show_bug.cgi?id=159221)
+
 2016-07-01  Per Arne Vollan  <[email protected]>
 
         [Win] Animations tests are crashing in debug mode.

Modified: trunk/Source/WebCore/Modules/fetch/FetchLoader.cpp (202740 => 202741)


--- trunk/Source/WebCore/Modules/fetch/FetchLoader.cpp	2016-07-01 17:00:48 UTC (rev 202740)
+++ trunk/Source/WebCore/Modules/fetch/FetchLoader.cpp	2016-07-01 17:03:27 UTC (rev 202741)
@@ -73,7 +73,6 @@
 
 void FetchLoader::start(ScriptExecutionContext& context, const FetchRequest& request)
 {
-    // FIXME: Compute loading options according fetch options.
     ThreadableLoaderOptions options;
     options.setSendLoadCallbacks(SendCallbacks);
     options.setSniffContent(DoNotSniffContent);
@@ -82,8 +81,10 @@
     options.setAllowCredentials(AllowStoredCredentials);
     options.crossOriginRequestPolicy = DenyCrossOriginRequests;
     options.contentSecurityPolicyEnforcement = ContentSecurityPolicyEnforcement::DoNotEnforce;
-    options.setFetchOptions(request.fetchOptions());
 
+    // FIXME: Pass directly all fetch options to loader options.
+    options.redirect = request.fetchOptions().redirect;
+
     m_loader = ThreadableLoader::create(&context, this, request.internalRequest(), options);
     m_isStarted = m_loader;
 }

Modified: trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp (202740 => 202741)


--- trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp	2016-07-01 17:00:48 UTC (rev 202740)
+++ trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp	2016-07-01 17:03:27 UTC (rev 202741)
@@ -109,7 +109,7 @@
     // Keep buffering the data for the preflight request.
     options.setDataBufferingPolicy(BufferData);
 
-    options.fetchOptions().redirect = FetchOptions::Redirect::Manual;
+    options.redirect = FetchOptions::Redirect::Manual;
 
     CachedResourceRequest preflightRequest(createAccessControlPreflightRequest(m_request, m_loader.securityOrigin()), options);
     if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled())

Modified: trunk/Source/WebCore/loader/ResourceLoaderOptions.h (202740 => 202741)


--- trunk/Source/WebCore/loader/ResourceLoaderOptions.h	2016-07-01 17:00:48 UTC (rev 202740)
+++ trunk/Source/WebCore/loader/ResourceLoaderOptions.h	2016-07-01 17:03:27 UTC (rev 202741)
@@ -28,14 +28,13 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef ResourceLoaderOptions_h
-#define ResourceLoaderOptions_h
+#pragma once
 
 #include "FetchOptions.h"
 #include "ResourceHandleTypes.h"
 
 namespace WebCore {
-    
+
 enum SendCallbackPolicy {
     SendCallbacks,
     DoNotSendCallbacks
@@ -82,7 +81,7 @@
     DisallowCaching
 };
 
-struct ResourceLoaderOptions {
+struct ResourceLoaderOptions : public FetchOptions {
     ResourceLoaderOptions()
         : m_sendLoadCallbacks(DoNotSendCallbacks)
         , m_sniffContent(DoNotSniffContent)
@@ -136,9 +135,6 @@
     void setDefersLoadingPolicy(DefersLoadingPolicy defersLoadingPolicy) { m_defersLoadingPolicy = defersLoadingPolicy; }
     CachingPolicy cachingPolicy() const { return m_cachingPolicy; }
     void setCachingPolicy(CachingPolicy cachingPolicy) { m_cachingPolicy = cachingPolicy; }
-    const FetchOptions& fetchOptions() const { return m_fetchOptions; }
-    FetchOptions& fetchOptions() { return m_fetchOptions; }
-    void setFetchOptions(const FetchOptions& fetchOptions) { m_fetchOptions = fetchOptions; }
 
     unsigned m_sendLoadCallbacks : 1;
     unsigned m_sniffContent : 1;
@@ -152,9 +148,6 @@
     ContentSecurityPolicyImposition m_contentSecurityPolicyImposition { ContentSecurityPolicyImposition::DoPolicyCheck };
     DefersLoadingPolicy m_defersLoadingPolicy { DefersLoadingPolicy::AllowDefersLoading };
     CachingPolicy m_cachingPolicy { CachingPolicy::AllowCaching };
-    FetchOptions m_fetchOptions;
 };
 
-} // namespace WebCore    
-
-#endif // ResourceLoaderOptions_h
+} // namespace WebCore

Modified: trunk/Source/WebCore/loader/SubresourceLoader.cpp (202740 => 202741)


--- trunk/Source/WebCore/loader/SubresourceLoader.cpp	2016-07-01 17:00:48 UTC (rev 202740)
+++ trunk/Source/WebCore/loader/SubresourceLoader.cpp	2016-07-01 17:03:27 UTC (rev 202741)
@@ -175,8 +175,8 @@
 
     ASSERT(!newRequest.isNull());
     if (!redirectResponse.isNull()) {
-        if (options().fetchOptions().redirect != FetchOptions::Redirect::Follow) {
-            if (options().fetchOptions().redirect == FetchOptions::Redirect::Error) {
+        if (options().redirect != FetchOptions::Redirect::Follow) {
+            if (options().redirect == FetchOptions::Redirect::Error) {
                 cancel();
                 return;
             }

Modified: trunk/Source/WebCore/loader/ThreadableLoader.h (202740 => 202741)


--- trunk/Source/WebCore/loader/ThreadableLoader.h	2016-07-01 17:00:48 UTC (rev 202740)
+++ trunk/Source/WebCore/loader/ThreadableLoader.h	2016-07-01 17:03:27 UTC (rev 202741)
@@ -73,7 +73,6 @@
         PreflightPolicy preflightPolicy { ConsiderPreflight };
         CrossOriginRequestPolicy crossOriginRequestPolicy { DenyCrossOriginRequests };
         ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement { ContentSecurityPolicyEnforcement::EnforceConnectSrcDirective };
-        RefPtr<SecurityOrigin> securityOrigin;
         String initiator; // This cannot be an AtomicString, as isolatedCopy() wouldn't create an object that's safe for passing to another thread.
     };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to