Changeset 89079 in webkit


Ignore:
Timestamp:
Jun 16, 2011 4:15:10 PM (13 years ago)
Author:
eric@webkit.org
Message:

2011-06-16 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

FrameLoader doesn't need completeURL or baseURL
https://bugs.webkit.org/show_bug.cgi?id=62818

No functional change, thus no tests.

  • html/HTMLPlugInImageElement.cpp: (WebCore::HTMLPlugInImageElement::isImageType): (WebCore::HTMLPlugInImageElement::wouldLoadAsNetscapePlugin):
  • inspector/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::open):
  • loader/FrameLoader.cpp:
  • loader/FrameLoader.h:
  • loader/NavigationScheduler.cpp: (WebCore::NavigationScheduler::scheduleLocationChange):
  • page/History.cpp: (WebCore::History::urlForState):
Location:
trunk/Source
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r89076 r89079  
     12011-06-16  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        FrameLoader doesn't need completeURL or baseURL
     6        https://bugs.webkit.org/show_bug.cgi?id=62818
     7
     8        No functional change, thus no tests.
     9
     10        * html/HTMLPlugInImageElement.cpp:
     11        (WebCore::HTMLPlugInImageElement::isImageType):
     12        (WebCore::HTMLPlugInImageElement::wouldLoadAsNetscapePlugin):
     13        * inspector/InspectorPageAgent.cpp:
     14        (WebCore::InspectorPageAgent::open):
     15        * loader/FrameLoader.cpp:
     16        * loader/FrameLoader.h:
     17        * loader/NavigationScheduler.cpp:
     18        (WebCore::NavigationScheduler::scheduleLocationChange):
     19        * page/History.cpp:
     20        (WebCore::History::urlForState):
     21
    1222011-06-16  Dawit Alemayehu  <adawit@kde.org>
    223
  • trunk/Source/WebCore/WebCore.exp.in

    r89044 r89079  
    160160__ZN7WebCore11FileChooser11chooseFilesERKN3WTF6VectorINS1_6StringELm0EEE
    161161__ZN7WebCore11FileChooserD1Ev
    162 __ZN7WebCore11FrameLoader11completeURLERKN3WTF6StringE
    163162__ZN7WebCore11FrameLoader11loadArchiveEN3WTF10PassRefPtrINS_7ArchiveEEE
    164163__ZN7WebCore11FrameLoader11shouldCloseEv
  • trunk/Source/WebCore/bindings/generic/GenericBinding.h

    r74449 r89079  
    3232#define GenericBinding_h
    3333
     34#include "Document.h"
    3435#include "Frame.h"
    3536#include "FrameLoader.h"
     
    5960    if (!frame)
    6061        return KURL();
    61     return frame->loader()->completeURL(relativeURL);
     62    return frame->document()->completeURL(relativeURL);
    6263}
    6364
  • trunk/Source/WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp

    r84764 r89079  
    5050    if (!frame)
    5151        return jsUndefined();
    52     const KURL& url = frame->loader()->completeURL(exec->argument(0).toString(exec));
     52    const KURL& url = frame->document()->completeURL(exec->argument(0).toString(exec));
    5353
    5454    ExceptionCode ec = 0;
     
    6363    if (!frame)
    6464        return jsUndefined();
    65     const KURL& url = frame->loader()->completeURL(exec->argument(0).toString(exec));
    66    
     65    const KURL& url = frame->document()->completeURL(exec->argument(0).toString(exec));
     66
    6767    ExceptionCode ec = 0;
    6868    impl()->add(url, ec);
     
    7676    if (!frame)
    7777        return jsUndefined();
    78     const KURL& url = frame->loader()->completeURL(exec->argument(0).toString(exec));
    79    
     78    const KURL& url = frame->document()->completeURL(exec->argument(0).toString(exec));
     79
    8080    ExceptionCode ec = 0;
    8181    impl()->remove(url, ec);
  • trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp

    r88570 r89079  
    6060
    6161    if (Frame* frame = document()->frame()) {
    62         KURL completedURL = frame->loader()->completeURL(m_url);
     62        KURL completedURL = document()->completeURL(m_url);
    6363        return frame->loader()->client()->objectContentType(completedURL, m_serviceType, shouldPreferPlugInsForImages()) == ObjectContentImage;
    6464    }
     
    9696    ASSERT(document());
    9797    ASSERT(document()->frame());
     98    KURL completedURL;
     99    if (!url.isEmpty())
     100        completedURL = document()->completeURL(url);
     101
    98102    FrameLoader* frameLoader = document()->frame()->loader();
    99103    ASSERT(frameLoader);
    100     KURL completedURL;
    101     if (!url.isEmpty())
    102         completedURL = frameLoader->completeURL(url);
    103 
    104104    if (frameLoader->client()->objectContentType(completedURL, serviceType, shouldPreferPlugInsForImages()) == ObjectContentNetscapePlugin)
    105105        return true;
  • trunk/Source/WebCore/inspector/InspectorPageAgent.cpp

    r88940 r89079  
    318318
    319319    UserGestureIndicator indicator(DefinitelyProcessingUserGesture);
    320     frame->loader()->changeLocation(mainFrame->document()->securityOrigin(), frame->loader()->completeURL(url), "", false, false);
     320    // FIXME: Why does one use mainFrame and the other frame?
     321    frame->loader()->changeLocation(mainFrame->document()->securityOrigin(), frame->document()->completeURL(url), "", false, false);
    321322}
    322323
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r88792 r89079  
    789789}
    790790
    791 KURL FrameLoader::baseURL() const
    792 {
    793     ASSERT(m_frame->document());
    794     return m_frame->document()->baseURL();
    795 }
    796 
    797 KURL FrameLoader::completeURL(const String& url)
    798 {
    799     ASSERT(m_frame->document());
    800     return m_frame->document()->completeURL(url);
    801 }
    802 
    803791void FrameLoader::loadURLIntoChildFrame(const KURL& url, const String& referer, Frame* childFrame)
    804792{
  • trunk/Source/WebCore/loader/FrameLoader.h

    r88682 r89079  
    220220    void willSetEncoding();
    221221
    222     KURL baseURL() const;
    223 
    224222    void handledOnloadEvents();
    225223    String userAgent(const KURL&) const;
     
    260258
    261259    bool isComplete() const;
    262 
    263     KURL completeURL(const String& url);
    264260
    265261    void cancelAndClear();
  • trunk/Source/WebCore/loader/NavigationScheduler.cpp

    r86013 r89079  
    336336
    337337    FrameLoader* loader = m_frame->loader();
    338    
     338
    339339    // If the URL we're going to navigate to is the same as the current one, except for the
    340340    // fragment part, we don't need to schedule the location change.
    341341    KURL parsedURL(ParsedURLString, url);
    342342    if (parsedURL.hasFragmentIdentifier() && equalIgnoringFragmentIdentifier(m_frame->document()->url(), parsedURL)) {
    343         loader->changeLocation(securityOrigin, loader->completeURL(url), referrer, lockHistory, lockBackForwardList);
     343        loader->changeLocation(securityOrigin, m_frame->document()->completeURL(url), referrer, lockHistory, lockBackForwardList);
    344344        return;
    345345    }
  • trunk/Source/WebCore/page/History.cpp

    r86325 r89079  
    110110KURL History::urlForState(const String& urlString)
    111111{
    112     KURL baseURL = m_frame->loader()->baseURL();
     112    KURL baseURL = m_frame->document()->baseURL();
    113113    if (urlString.isEmpty())
    114114        return baseURL;
    115        
     115
    116116    return KURL(baseURL, urlString);
    117117}
  • trunk/Source/WebCore/plugins/PluginView.cpp

    r84371 r89079  
    830830    , m_isStarted(false)
    831831    , m_url(url)
    832     , m_baseURL(m_parentFrame->loader()->completeURL(m_parentFrame->document()->baseURL().string()))
     832    , m_baseURL(m_parentFrame->document()->baseURL()) // FIXME: No need for this member variable!
    833833    , m_status(PluginStatusLoadedSuccessfully)
    834834    , m_requestTimer(this, &PluginView::requestTimerFired)
  • trunk/Source/WebKit/chromium/src/WebPasswordFormData.cpp

    r58382 r89079  
    151151{
    152152    RefPtr<HTMLFormElement> form = webForm.operator PassRefPtr<HTMLFormElement>();
    153 
    154     Frame* frame = form->document()->frame();
    155     if (!frame)
    156         return;
    157 
    158153    PasswordFormFields fields;
    159154    findPasswordFormFields(form.get(), &fields);
     
    166161    if (action.isNull())
    167162        action = ""; // missing 'action' attribute implies current URL
    168     KURL fullAction = frame->loader()->completeURL(action);
     163    KURL fullAction = form->document()->completeURL(action);
    169164    if (!fullAction.isValid())
    170165        return;
  • trunk/Source/WebKit/chromium/src/WebSearchableFormData.cpp

    r88030 r89079  
    7171bool IsHTTPFormSubmit(const HTMLFormElement* form)
    7272{
     73    // FIXME: This function is insane. This is an overly complicated way to get this information.
    7374    String action(form->action());
    74     return form->document()->frame()->loader()->completeURL(action.isNull() ? "" : action).protocol() == "http";
     75    // The isNull() check is trying to avoid completeURL returning KURL() when passed a null string.
     76    return form->document()->completeURL(action.isNull() ? "" : action).protocolIs("http");
    7577}
    7678
     
    237239{
    238240    RefPtr<HTMLFormElement> formElement = form.operator PassRefPtr<HTMLFormElement>();
    239     const Frame* frame = formElement->document()->frame();
    240     if (!frame)
    241         return;
    242 
    243241    HTMLInputElement* inputElement = selectedInputElement.operator PassRefPtr<HTMLInputElement>().get();
    244242
     
    288286
    289287    String action(formElement->action());
    290     KURL url(frame->loader()->completeURL(action.isNull() ? "" : action));
     288    KURL url(formElement->document()->completeURL(action.isNull() ? "" : action));
    291289    RefPtr<FormData> formData = FormData::create(encodedString);
    292290    url.setQuery(formData->flattenToString());
  • trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm

    r86414 r89079  
    955955        return CString();
    956956 
    957     KURL absoluteURL = targetFrame->loader()->completeURL(relativeURLString);
     957    KURL absoluteURL = targetFrame->document()->completeURL(relativeURLString);
    958958    return absoluteURL.string().utf8();
    959959}
Note: See TracChangeset for help on using the changeset viewer.