REGRESSION (r182866): repeated prompts for password on internal Apple website using...
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Jul 2015 15:27:43 +0000 (15:27 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Jul 2015 15:27:43 +0000 (15:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=146769

Reviewed by Sam Weinig.

Not sure how to make a regression test for this. Sure would be nice to have one though.

* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Added. Calls through to the
base class copy constructor to copy data members of the base class (the lack of this was
the bug). Also initializes all the data members of this class.
(WebCore::ThreadableLoaderOptions::isolatedCopy): Changed to call the constructor above.

* loader/ThreadableLoader.h: Added new constructor.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@186592 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/loader/ThreadableLoader.cpp
Source/WebCore/loader/ThreadableLoader.h

index 0b9f94c..01dc863 100644 (file)
@@ -1,3 +1,20 @@
+2015-07-09  Darin Adler  <darin@apple.com>
+
+        REGRESSION (r182866): repeated prompts for password on internal Apple website using workers
+        https://bugs.webkit.org/show_bug.cgi?id=146769
+
+        Reviewed by Sam Weinig.
+
+        Not sure how to make a regression test for this. Sure would be nice to have one though.
+
+        * loader/ThreadableLoader.cpp:
+        (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Added. Calls through to the
+        base class copy constructor to copy data members of the base class (the lack of this was
+        the bug). Also initializes all the data members of this class.
+        (WebCore::ThreadableLoaderOptions::isolatedCopy): Changed to call the constructor above.
+
+        * loader/ThreadableLoader.h: Added new constructor.
+
 2015-07-09  Chris Fleizach  <cfleizach@apple.com>
 
         AX: VoiceOver cannot get to any content in Yahoo Mail messages table
index 7fe5e7d..17670ec 100644 (file)
@@ -51,15 +51,22 @@ ThreadableLoaderOptions::~ThreadableLoaderOptions()
 {
 }
 
+ThreadableLoaderOptions::ThreadableLoaderOptions(const ResourceLoaderOptions& baseOptions, PreflightPolicy preflightPolicy, CrossOriginRequestPolicy crossOriginRequestPolicy, RefPtr<SecurityOrigin>&& securityOrigin, String&& initiator)
+    : ResourceLoaderOptions(baseOptions)
+    , preflightPolicy(preflightPolicy)
+    , crossOriginRequestPolicy(crossOriginRequestPolicy)
+    , securityOrigin(WTF::move(securityOrigin))
+    , initiator(WTF::move(initiator))
+{
+}
+
 std::unique_ptr<ThreadableLoaderOptions> ThreadableLoaderOptions::isolatedCopy() const
 {
-    std::unique_ptr<ThreadableLoaderOptions> copy = std::make_unique<ThreadableLoaderOptions>();
-    copy->preflightPolicy = preflightPolicy;
-    copy->crossOriginRequestPolicy = crossOriginRequestPolicy;
+    RefPtr<SecurityOrigin> securityOriginCopy;
     if (securityOrigin)
-        copy->securityOrigin = securityOrigin->isolatedCopy();
-    copy->initiator = initiator.isolatedCopy();
-    return copy;
+        securityOriginCopy = securityOrigin->isolatedCopy();
+    return std::make_unique<ThreadableLoaderOptions>(*this, preflightPolicy, crossOriginRequestPolicy,
+        WTF::move(securityOriginCopy), initiator.isolatedCopy());
 }
 
 PassRefPtr<ThreadableLoader> ThreadableLoader::create(ScriptExecutionContext* context, ThreadableLoaderClient* client, const ResourceRequest& request, const ThreadableLoaderOptions& options)
index 0f3b2f0..086c583 100644 (file)
@@ -59,8 +59,9 @@ namespace WebCore {
         PreventPreflight
     };
 
-    struct ThreadableLoaderOptions : public ResourceLoaderOptions {
+    struct ThreadableLoaderOptions : ResourceLoaderOptions {
         ThreadableLoaderOptions();
+        ThreadableLoaderOptions(const ResourceLoaderOptions&, PreflightPolicy, CrossOriginRequestPolicy, RefPtr<SecurityOrigin>&&, String&& initiator);
         ~ThreadableLoaderOptions();
 
         std::unique_ptr<ThreadableLoaderOptions> isolatedCopy() const;