Rename URL::copy() to URL::isolatedCopy() to match String.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 May 2015 00:28:22 +0000 (00:28 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 May 2015 00:28:22 +0000 (00:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=144684

Patch by Sungmann Cho <sungmann.cho@navercorp.com> on 2015-05-06
Reviewed by Darin Adler.

No new tests, no behavior change.

* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::setURL):
(WebCore::WebSocketHandshake::httpURLForAuthenticationAndCookies):
* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::BlobRegistryContext::BlobRegistryContext):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::updatePredictedBaseURL):
* html/parser/HTMLResourcePreloader.h:
(WebCore::PreloadRequest::PreloadRequest):
* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::init):
* platform/CrossThreadCopier.cpp:
(WebCore::URL>::copy):
* platform/URL.cpp:
(WebCore::URL::isolatedCopy):
(WebCore::URL::copy): Deleted.
* platform/URL.h:
(WebCore::URLCapture::URLCapture):
* platform/network/BlobPart.h:
(WebCore::BlobPart::detachFromCurrentThread):
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::copyData):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::copyData):
* workers/WorkerThread.cpp:
(WebCore::WorkerThreadStartupData::WorkerThreadStartupData):

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

13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/websockets/WebSocketHandshake.cpp
Source/WebCore/fileapi/ThreadableBlobRegistry.cpp
Source/WebCore/html/parser/HTMLPreloadScanner.cpp
Source/WebCore/html/parser/HTMLResourcePreloader.h
Source/WebCore/html/parser/XSSAuditor.cpp
Source/WebCore/platform/CrossThreadCopier.cpp
Source/WebCore/platform/URL.cpp
Source/WebCore/platform/URL.h
Source/WebCore/platform/network/BlobPart.h
Source/WebCore/platform/network/ResourceRequestBase.cpp
Source/WebCore/platform/network/ResourceResponseBase.cpp
Source/WebCore/workers/WorkerThread.cpp

index c088778..8f315c7 100644 (file)
@@ -1,3 +1,39 @@
+2015-05-06  Sungmann Cho  <sungmann.cho@navercorp.com>
+
+        Rename URL::copy() to URL::isolatedCopy() to match String.
+        https://bugs.webkit.org/show_bug.cgi?id=144684
+
+        Reviewed by Darin Adler.
+
+        No new tests, no behavior change.
+
+        * Modules/websockets/WebSocketHandshake.cpp:
+        (WebCore::WebSocketHandshake::setURL):
+        (WebCore::WebSocketHandshake::httpURLForAuthenticationAndCookies):
+        * fileapi/ThreadableBlobRegistry.cpp:
+        (WebCore::BlobRegistryContext::BlobRegistryContext):
+        * html/parser/HTMLPreloadScanner.cpp:
+        (WebCore::TokenPreloadScanner::updatePredictedBaseURL):
+        * html/parser/HTMLResourcePreloader.h:
+        (WebCore::PreloadRequest::PreloadRequest):
+        * html/parser/XSSAuditor.cpp:
+        (WebCore::XSSAuditor::init):
+        * platform/CrossThreadCopier.cpp:
+        (WebCore::URL>::copy):
+        * platform/URL.cpp:
+        (WebCore::URL::isolatedCopy):
+        (WebCore::URL::copy): Deleted.
+        * platform/URL.h:
+        (WebCore::URLCapture::URLCapture):
+        * platform/network/BlobPart.h:
+        (WebCore::BlobPart::detachFromCurrentThread):
+        * platform/network/ResourceRequestBase.cpp:
+        (WebCore::ResourceRequestBase::copyData):
+        * platform/network/ResourceResponseBase.cpp:
+        (WebCore::ResourceResponseBase::copyData):
+        * workers/WorkerThread.cpp:
+        (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
+
 2015-05-06  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r183894.
index 11265e1..322aa40 100644 (file)
@@ -140,7 +140,7 @@ const URL& WebSocketHandshake::url() const
 
 void WebSocketHandshake::setURL(const URL& url)
 {
-    m_url = url.copy();
+    m_url = url.isolatedCopy();
 }
 
 const String WebSocketHandshake::host() const
@@ -383,7 +383,7 @@ void WebSocketHandshake::addExtensionProcessor(std::unique_ptr<WebSocketExtensio
 
 URL WebSocketHandshake::httpURLForAuthenticationAndCookies() const
 {
-    URL url = m_url.copy();
+    URL url = m_url.isolatedCopy();
     bool couldSetProtocol = url.setProtocol(m_secure ? "https" : "http");
     ASSERT_UNUSED(couldSetProtocol, couldSetProtocol);
     return url;
index eaeedf2..1d6ceb5 100644 (file)
@@ -52,7 +52,7 @@ struct BlobRegistryContext {
     WTF_MAKE_FAST_ALLOCATED;
 public:
     BlobRegistryContext(const URL& url, Vector<BlobPart> blobParts, const String& contentType)
-        : url(url.copy())
+        : url(url.isolatedCopy())
         , contentType(contentType.isolatedCopy())
         , blobParts(WTF::move(blobParts))
     {
@@ -61,18 +61,18 @@ public:
     }
 
     BlobRegistryContext(const URL& url, const URL& srcURL)
-        : url(url.copy())
-        , srcURL(srcURL.copy())
+        : url(url.isolatedCopy())
+        , srcURL(srcURL.isolatedCopy())
     {
     }
 
     BlobRegistryContext(const URL& url)
-        : url(url.copy())
+        : url(url.isolatedCopy())
     {
     }
 
     BlobRegistryContext(const URL& url, const String& path, const String& contentType)
-        : url(url.copy())
+        : url(url.isolatedCopy())
         , path(path.isolatedCopy())
         , contentType(contentType.isolatedCopy())
     {
index 00242b8..b5782d8 100644 (file)
@@ -312,7 +312,7 @@ void TokenPreloadScanner::updatePredictedBaseURL(const HTMLToken& token)
 {
     ASSERT(m_predictedBaseElementURL.isEmpty());
     if (auto* hrefAttribute = findAttribute(token.attributes(), hrefAttr.localName().string()))
-        m_predictedBaseElementURL = URL(m_documentURL, stripLeadingAndTrailingHTMLSpaces(StringImpl::create8BitIfPossible(hrefAttribute->value))).copy();
+        m_predictedBaseElementURL = URL(m_documentURL, stripLeadingAndTrailingHTMLSpaces(StringImpl::create8BitIfPossible(hrefAttribute->value))).isolatedCopy();
 }
 
 HTMLPreloadScanner::HTMLPreloadScanner(const HTMLParserOptions& options, const URL& documentURL, float deviceScaleFactor)
index 2a8b6c8..a036de3 100644 (file)
@@ -36,7 +36,7 @@ public:
     PreloadRequest(const String& initiator, const String& resourceURL, const URL& baseURL, CachedResource::Type resourceType, const String& mediaAttribute)
         : m_initiator(initiator)
         , m_resourceURL(resourceURL)
-        , m_baseURL(baseURL.copy())
+        , m_baseURL(baseURL.isolatedCopy())
         , m_resourceType(resourceType)
         , m_mediaAttribute(mediaAttribute)
         , m_crossOriginModeAllowsCookies(false)
index 722021b..82c5edc 100644 (file)
@@ -244,7 +244,7 @@ void XSSAuditor::init(Document* document, XSSAuditorDelegate* auditorDelegate)
     if (!m_isEnabled)
         return;
 
-    m_documentURL = document->url().copy();
+    m_documentURL = document->url().isolatedCopy();
 
     // In theory, the Document could have detached from the Frame after the
     // XSSAuditor was constructed.
@@ -300,7 +300,7 @@ void XSSAuditor::init(Document* document, XSSAuditorDelegate* auditorDelegate)
         m_xssProtection = combineXSSProtectionHeaderAndCSP(xssProtectionHeader, cspHeader);
         // FIXME: Combine the two report URLs in some reasonable way.
         if (auditorDelegate)
-            auditorDelegate->setReportURL(xssProtectionReportURL.copy());
+            auditorDelegate->setReportURL(xssProtectionReportURL.isolatedCopy());
         FormData* httpBody = documentLoader->originalRequest().httpBody();
         if (httpBody && !httpBody->isEmpty()) {
             httpBodyAsString = httpBody->flattenToString();
index 2aa93ec..a8de776 100644 (file)
@@ -52,7 +52,7 @@ namespace WebCore {
 
 CrossThreadCopierBase<false, false, URL>::Type CrossThreadCopierBase<false, false, URL>::copy(const URL& url)
 {
-    return url.copy();
+    return url.isolatedCopy();
 }
 
 CrossThreadCopierBase<false, false, String>::Type CrossThreadCopierBase<false, false, String>::copy(const String& str)
index d19e38e..53be617 100644 (file)
@@ -648,7 +648,7 @@ void URL::init(const URL& base, const String& relative, const TextEncoding& enco
     }
 }
 
-URL URL::copy() const
+URL URL::isolatedCopy() const
 {
     URL result = *this;
     result.m_string = result.m_string.isolatedCopy();
index a638d78..c9c1384 100644 (file)
@@ -83,9 +83,8 @@ public:
 
     // Makes a deep copy. Helpful only if you need to use a URL on another
     // thread. Since the underlying StringImpl objects are immutable, there's
-    // no other reason to ever prefer copy() over plain old assignment.
-    // FIXME: Rename to isolatedCopy to match String.
-    URL copy() const;
+    // no other reason to ever prefer isolatedCopy() over plain old assignment.
+    URL isolatedCopy() const;
 
     bool isNull() const;
     bool isEmpty() const;
@@ -381,7 +380,7 @@ inline URLCapture::URLCapture(URL&& url)
 }
 
 inline URLCapture::URLCapture(const URLCapture& other)
-    : m_URL(other.m_URL.copy())
+    : m_URL(other.m_URL.isolatedCopy())
 {
 }
 
index 03b4acf..bb6febd 100644 (file)
@@ -76,7 +76,7 @@ public:
 
     void detachFromCurrentThread()
     {
-        m_url = m_url.copy();
+        m_url = m_url.isolatedCopy();
     }
 
 private:
index 43cf8bd..d41ebb1 100644 (file)
@@ -84,10 +84,10 @@ std::unique_ptr<ResourceRequest> ResourceRequestBase::adopt(std::unique_ptr<Cros
 std::unique_ptr<CrossThreadResourceRequestData> ResourceRequestBase::copyData() const
 {
     auto data = std::make_unique<CrossThreadResourceRequestData>();
-    data->url = url().copy();
+    data->url = url().isolatedCopy();
     data->cachePolicy = m_cachePolicy;
     data->timeoutInterval = timeoutInterval();
-    data->firstPartyForCookies = firstPartyForCookies().copy();
+    data->firstPartyForCookies = firstPartyForCookies().isolatedCopy();
     data->httpMethod = httpMethod().isolatedCopy();
     data->httpHeaders = httpHeaderFields().copyData();
     data->priority = m_priority;
index bfff2ff..1a8eee4 100644 (file)
@@ -83,7 +83,7 @@ std::unique_ptr<ResourceResponse> ResourceResponseBase::adopt(std::unique_ptr<Cr
 std::unique_ptr<CrossThreadResourceResponseData> ResourceResponseBase::copyData() const
 {
     auto data = std::make_unique<CrossThreadResourceResponseData>();
-    data->m_url = url().copy();
+    data->m_url = url().isolatedCopy();
     data->m_mimeType = mimeType().isolatedCopy();
     data->m_expectedContentLength = expectedContentLength();
     data->m_textEncodingName = textEncodingName().isolatedCopy();
index 3c2dca5..873c829 100644 (file)
@@ -87,7 +87,7 @@ public:
 };
 
 WorkerThreadStartupData::WorkerThreadStartupData(const URL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, const SecurityOrigin* topOrigin)
-    : m_scriptURL(scriptURL.copy())
+    : m_scriptURL(scriptURL.isolatedCopy())
     , m_userAgent(userAgent.isolatedCopy())
     , m_sourceCode(sourceCode.isolatedCopy())
     , m_startMode(startMode)