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 0b9f94cec0dee0d7db152b1b0eeeaac4823248a4..01dc86322d8f6aa9efcf9bff54e3c23734482a68 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 7fe5e7d91d3504cc677288d4c46065b0b0447316..17670ec4cb3006f905879274b0d1e0bbf9038031 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 0f3b2f06558f6224dd8c011acb06512da3dcaf1e..086c583760c20031b4d48dc96d71395cd2810dde 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;