⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 102080 in webkit


Ignore:
Timestamp:
Dec 5, 2011, 5:51:27 PM (15 years ago)
Author:
benjamin@webkit.org
Message:

Get rid of KURL::KURL(ParsedURLStringTag, const char*);
https://bugs.webkit.org/show_bug.cgi?id=73792

Reviewed by Andreas Kling.

In all cases where the constructor is used, the constructor
taking a String is as effective because the string is valid and converted
to String for m_string.

This patch remove the constructor KURL::KURL(ParsedURLStringTag, const char*)
and change the call sites that were using that constructor to build
empty URLs.

  • dom/Document.cpp:

(WebCore::Document::initSecurityContext):

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::init):

  • loader/archive/cf/LegacyWebArchive.cpp:

(WebCore::LegacyWebArchive::create):

  • page/DOMWindow.cpp:

(WebCore::DOMWindow::createWindow):

  • platform/KURL.cpp:
  • platform/KURL.h:
  • platform/KURLGoogle.cpp:
Location:
trunk/Source/WebCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r102073 r102080  
     12011-12-05  Benjamin Poulain  <benjamin@webkit.org>
     2
     3        Get rid of KURL::KURL(ParsedURLStringTag, const char*);
     4        https://bugs.webkit.org/show_bug.cgi?id=73792
     5
     6        Reviewed by Andreas Kling.
     7
     8        In all cases where the constructor is used, the constructor
     9        taking a String is as effective because the string is valid and converted
     10        to String for m_string.
     11
     12        This patch remove the constructor KURL::KURL(ParsedURLStringTag, const char*)
     13        and change the call sites that were using that constructor to build
     14        empty URLs.
     15
     16        * dom/Document.cpp:
     17        (WebCore::Document::initSecurityContext):
     18        * loader/FrameLoader.cpp:
     19        (WebCore::FrameLoader::init):
     20        * loader/archive/cf/LegacyWebArchive.cpp:
     21        (WebCore::LegacyWebArchive::create):
     22        * page/DOMWindow.cpp:
     23        (WebCore::DOMWindow::createWindow):
     24        * platform/KURL.cpp:
     25        * platform/KURL.h:
     26        * platform/KURLGoogle.cpp:
     27
    1282011-12-05  Benjamin Poulain  <benjamin@webkit.org>
    229
  • trunk/Source/WebCore/dom/Document.cpp

    r101932 r102080  
    44734473        // No source for a security context.
    44744474        // This can occur via document.implementation.createDocument().
    4475         m_cookieURL = KURL(ParsedURLString, "");
     4475        m_cookieURL = KURL(ParsedURLString, emptyString());
    44764476        setSecurityOrigin(SecurityOrigin::createUnique());
    44774477        setContentSecurityPolicy(ContentSecurityPolicy::create(this));
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r102062 r102080  
    221221    // It would be better if this could be done with even fewer steps.
    222222    m_stateMachine.advanceTo(FrameLoaderStateMachine::CreatingInitialEmptyDocument);
    223     setPolicyDocumentLoader(m_client->createDocumentLoader(ResourceRequest(KURL(ParsedURLString, "")), SubstituteData()).get());
     223    setPolicyDocumentLoader(m_client->createDocumentLoader(ResourceRequest(KURL(ParsedURLString, emptyString())), SubstituteData()).get());
    224224    setProvisionalDocumentLoader(m_policyDocumentLoader.get());
    225225    setState(FrameStateProvisional);
  • trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp

    r95901 r102080  
    508508    // <rdar://problem/5454935>
    509509    if (responseURL.isNull())
    510         responseURL = KURL(ParsedURLString, "");
     510        responseURL = KURL(ParsedURLString, emptyString());
    511511       
    512512    PassRefPtr<ArchiveResource> mainResource = ArchiveResource::create(utf8Buffer(markupString), responseURL, response.mimeType(), "UTF-8", frame->tree()->uniqueName());
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r101587 r102080  
    18141814    String referrer = firstFrame->loader()->outgoingReferrer();
    18151815
    1816     KURL completedURL = urlString.isEmpty() ? KURL(ParsedURLString, "") : firstFrame->document()->completeURL(urlString);
     1816    KURL completedURL = urlString.isEmpty() ? KURL(ParsedURLString, emptyString()) : firstFrame->document()->completeURL(urlString);
    18171817    ResourceRequest request(completedURL, referrer);
    18181818    FrameLoader::addHTTPOriginIfNeeded(request, firstFrame->loader()->outgoingOrigin());
  • trunk/Source/WebCore/platform/KURL.cpp

    r102059 r102080  
    321321}
    322322
    323 KURL::KURL(ParsedURLStringTag, const char* url)
    324 {
    325     parse(url);
    326     ASSERT(url == m_string);
    327 }
    328 
    329323KURL::KURL(ParsedURLStringTag, const String& url)
    330324{
  • trunk/Source/WebCore/platform/KURL.h

    r102073 r102080  
    7474    // KURL object, or indiscernible from such.
    7575    // It is usually best to avoid repeatedly parsing a string, unless memory saving outweigh the possible slow-downs.
    76     KURL(ParsedURLStringTag, const char*);
    7776    KURL(ParsedURLStringTag, const String&);
    7877    KURL(ParsedURLStringTag, const URLString&);
  • trunk/Source/WebCore/platform/KURLGoogle.cpp

    r96779 r102080  
    342342// KURL ------------------------------------------------------------------------
    343343
    344 // Creates with null-terminated string input representing an absolute URL.
    345 // WebCore generally calls this only with hardcoded strings, so the input is
    346 // ASCII. We treat it as UTF-8 just in case.
    347 KURL::KURL(ParsedURLStringTag, const char *url)
    348 {
    349     // FIXME The Mac code checks for beginning with a slash and converts it to
    350     // file: URL. We will want to add this as well once we can compile on a
    351     // system like that.
    352     m_url.init(KURL(), url, strlen(url), 0);
    353 
    354     // The one-argument constructors should never generate a null string.
    355     // This is a funny quirk of KURL.cpp (probably a bug) which we preserve.
    356     if (m_url.utf8String().isNull())
    357         m_url.setAscii(CString("", 0));
    358 }
    359 
    360344// Initializes with a string representing an absolute URL. No encoding
    361345// information is specified. This generally happens when a KURL is converted
Note: See TracChangeset for help on using the changeset viewer.