Skip to content
Permalink
Browse files
2011-01-27 Nate Chapin <japhet@chromium.org>
        Reviewed by Adam Barth.

        Remove FrameLoader::url() and update callers to use
        Document::url().
        https://bugs.webkit.org/show_bug.cgi?id=41165

        Refactor, no new tests.

        * WebCore.exp.in:
        * dom/Document.cpp:
        (WebCore::Document::processHttpEquiv):
        (WebCore::Document::removePendingSheet):
        * history/CachedFrame.cpp:
        (WebCore::CachedFrameBase::CachedFrameBase):
        * history/PageCache.cpp:
        (WebCore::logCanCacheFrameDecision):
        (WebCore::PageCache::canCachePageContainingThisFrame):
        * html/HTMLFrameElementBase.cpp:
        (WebCore::HTMLFrameElementBase::isURLAllowed):
        * html/HTMLPlugInImageElement.cpp:
        (WebCore::HTMLPlugInImageElement::allowedToLoadFrameURL):
        * inspector/InspectorAgent.cpp:
        (WebCore::InspectorAgent::inspectedURL):
        * inspector/InspectorResourceAgent.cpp:
        (WebCore::buildObjectForFrame):
        * loader/DocumentWriter.cpp:
        (WebCore::DocumentWriter::replaceDocument):
        (WebCore::DocumentWriter::deprecatedFrameEncoding):
        * loader/FrameLoader.cpp:
        * loader/FrameLoader.h:
        * loader/HistoryController.cpp:
        (WebCore::HistoryController::updateForStandardLoad):
        (WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
        (WebCore::HistoryController::updateForSameDocumentNavigation):
        * loader/NavigationScheduler.cpp:
        (WebCore::ScheduledHistoryNavigation::fire):
        (WebCore::NavigationScheduler::scheduleLocationChange):
        (WebCore::NavigationScheduler::scheduleRefresh):
        * page/FrameView.cpp:
        (WebCore::FrameView::updateControlTints):
        * page/Location.cpp:
        (WebCore::Location::url):
        (WebCore::Location::setProtocol):
        (WebCore::Location::setHost):
        (WebCore::Location::setHostname):
        (WebCore::Location::setPort):
        (WebCore::Location::setPathname):
        (WebCore::Location::setSearch):
        (WebCore::Location::setHash):
        (WebCore::Location::reload):
        * page/Page.cpp:
        (WebCore::Page::goToItem):
2011-01-27  Nate Chapin  <japhet@chromium.org>

        Reviewed by Adam Barth.

        Use Document::url() instead of FrameLoader::url().
        https://bugs.webkit.org/show_bug.cgi?id=41165

        * ewk/ewk_frame.cpp:
        (ewk_frame_uri_changed):
2011-01-27  Nate Chapin  <japhet@chromium.org>

        Reviewed by Adam Barth.

        Use Document::url() instead of FrameLoader::url().
        https://bugs.webkit.org/show_bug.cgi?id=41165

        * webkit/webkitwebview.cpp:
        (webkit_web_view_get_icon_uri):
2011-01-27  Nate Chapin  <japhet@chromium.org>

        Reviewed by Adam Barth.

        Use Document::url() instead of FrameLoader::url().
        https://bugs.webkit.org/show_bug.cgi?id=41165

        * WebCoreSupport/FrameLoaderClientHaiku.cpp:
        (WebCore::FrameLoaderClientHaiku::dispatchDidFinishDocumentLoad):
2011-01-27  Nate Chapin  <japhet@chromium.org>

        Reviewed by Adam Barth.

        Use Document::url() instead of FrameLoader::url().
        https://bugs.webkit.org/show_bug.cgi?id=41165

        * WebView/WebView.mm:
        (-[WebView _dispatchDidReceiveIconFromWebFrame:]):
2011-01-27  Nate Chapin  <japhet@chromium.org>

        Reviewed by Adam Barth.

        Use Document::url() instead of FrameLoader::url().
        https://bugs.webkit.org/show_bug.cgi?id=41165

        * Api/qwebframe.cpp:
        (QWebFrame::url):
2011-01-27  Nate Chapin  <japhet@chromium.org>

        Reviewed by Adam Barth.

        Use Document::url() instead of FrameLoader::url().
        https://bugs.webkit.org/show_bug.cgi?id=41165

        * WebFrame.cpp:
        (WebFrame::url):
2011-01-27  Nate Chapin  <japhet@chromium.org>

        Reviewed by Adam Barth.

        Use Document::url() instead of FrameLoader::url().
        https://bugs.webkit.org/show_bug.cgi?id=41165

        * WebKitSupport/FrameLoaderClientWx.cpp:
        (WebCore::FrameLoaderClientWx::dispatchDidFinishDocumentLoad):
2011-01-27  Nate Chapin  <japhet@chromium.org>

        Reviewed by Adam Barth.

        Use Document::url() instead of FrameLoader::url().
        https://bugs.webkit.org/show_bug.cgi?id=41165

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
        (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage):
        (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage):
        (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::url):

Canonical link: https://commits.webkit.org/67077@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
natechapin committed Jan 28, 2011
1 parent 8aa4cac commit 3dacf8f1f16719b4ead0885eb57cd0eb0b82279e
Showing 35 changed files with 185 additions and 54 deletions.
@@ -1,3 +1,58 @@
2011-01-27 Nate Chapin <japhet@chromium.org>

Reviewed by Adam Barth.

Remove FrameLoader::url() and update callers to use
Document::url().
https://bugs.webkit.org/show_bug.cgi?id=41165

Refactor, no new tests.

* WebCore.exp.in:
* dom/Document.cpp:
(WebCore::Document::processHttpEquiv):
(WebCore::Document::removePendingSheet):
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::CachedFrameBase):
* history/PageCache.cpp:
(WebCore::logCanCacheFrameDecision):
(WebCore::PageCache::canCachePageContainingThisFrame):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::isURLAllowed):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::allowedToLoadFrameURL):
* inspector/InspectorAgent.cpp:
(WebCore::InspectorAgent::inspectedURL):
* inspector/InspectorResourceAgent.cpp:
(WebCore::buildObjectForFrame):
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::replaceDocument):
(WebCore::DocumentWriter::deprecatedFrameEncoding):
* loader/FrameLoader.cpp:
* loader/FrameLoader.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::updateForStandardLoad):
(WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
(WebCore::HistoryController::updateForSameDocumentNavigation):
* loader/NavigationScheduler.cpp:
(WebCore::ScheduledHistoryNavigation::fire):
(WebCore::NavigationScheduler::scheduleLocationChange):
(WebCore::NavigationScheduler::scheduleRefresh):
* page/FrameView.cpp:
(WebCore::FrameView::updateControlTints):
* page/Location.cpp:
(WebCore::Location::url):
(WebCore::Location::setProtocol):
(WebCore::Location::setHost):
(WebCore::Location::setHostname):
(WebCore::Location::setPort):
(WebCore::Location::setPathname):
(WebCore::Location::setSearch):
(WebCore::Location::setHash):
(WebCore::Location::reload):
* page/Page.cpp:
(WebCore::Page::goToItem):

2011-01-27 Stephen White <senorblanco@chromium.org>

Reviewed by Darin Adler.
@@ -971,7 +971,6 @@ __ZNK7WebCore11FrameLoader16outgoingReferrerEv
__ZNK7WebCore11FrameLoader17networkingContextEv
__ZNK7WebCore11FrameLoader20activeDocumentLoaderEv
__ZNK7WebCore11FrameLoader27numPendingOrLoadingRequestsEb
__ZNK7WebCore11FrameLoader3urlEv
__ZNK7WebCore11FrameLoader8loadTypeEv
__ZNK7WebCore11HistoryItem10visitCountEv
__ZNK7WebCore11HistoryItem11hasChildrenEv
@@ -2646,7 +2646,7 @@ void Document::processHttpEquiv(const String& equiv, const String& content)
String url;
if (frame && parseHTTPRefresh(content, true, delay, url)) {
if (url.isEmpty())
url = frame->loader()->url().string();
url = m_url.string();
else
url = completeURL(url).string();
frame->navigationScheduler()->scheduleRedirect(delay, url);
@@ -2927,7 +2927,7 @@ void Document::removePendingSheet()
parser->executeScriptsWaitingForStylesheets();

if (m_gotoAnchorNeededAfterStylesheetsLoad && view())
view()->scrollToFragment(m_frame->loader()->url());
view()->scrollToFragment(m_url);
}

void Document::styleSelectorChanged(StyleSelectorUpdateFlag updateFlag)
@@ -65,7 +65,7 @@ CachedFrameBase::CachedFrameBase(Frame* frame)
, m_documentLoader(frame->loader()->documentLoader())
, m_view(frame->view())
, m_mousePressNode(frame->eventHandler()->mousePressNode())
, m_url(frame->loader()->url())
, m_url(frame->document()->url())
, m_isMainFrame(!frame->tree()->parent())
{
}
@@ -111,7 +111,7 @@ static bool logCanCacheFrameDecision(Frame* frame, int indentLevel)
PCLOG(" -Frame contains plugins");
cannotCache = true;
}
if (frame->loader()->url().protocolIs("https")) {
if (frame->document()->url().protocolIs("https")) {
PCLOG(" -Frame is HTTPS");
cannotCache = true;
}
@@ -260,7 +260,7 @@ bool PageCache::canCachePageContainingThisFrame(Frame* frame)
// they would need to be destroyed and then recreated, and there is no way that we can recreate
// the right NPObjects. See <rdar://problem/5197041> for more information.
&& !frame->loader()->subframeLoader()->containsPlugins()
&& !frame->loader()->url().protocolIs("https")
&& !frame->document()->url().protocolIs("https")
&& (!frame->domWindow() || !frame->domWindow()->hasEventListeners(eventNames().unloadEvent))
#if ENABLE(DATABASE)
&& !frame->document()->hasOpenDatabases()
@@ -80,7 +80,7 @@ bool HTMLFrameElementBase::isURLAllowed() const
// But we don't allow more than one.
bool foundSelfReference = false;
for (Frame* frame = document()->frame(); frame; frame = frame->tree()->parent()) {
if (equalIgnoringFragmentIdentifier(frame->loader()->url(), completeURL)) {
if (equalIgnoringFragmentIdentifier(frame->document()->url(), completeURL)) {
if (foundSelfReference)
return false;
foundSelfReference = true;
@@ -78,7 +78,7 @@ bool HTMLPlugInImageElement::allowedToLoadFrameURL(const String& url)
KURL completeURL = document()->completeURL(url);
bool foundSelfReference = false;
for (Frame* frame = document()->frame(); frame; frame = frame->tree()->parent()) {
if (equalIgnoringFragmentIdentifier(frame->loader()->url(), completeURL)) {
if (equalIgnoringFragmentIdentifier(frame->document()->url(), completeURL)) {
if (foundSelfReference)
return false;
foundSelfReference = true;
@@ -1347,7 +1347,7 @@ void InspectorAgent::setInspectorExtensionAPI(const String& source)

KURL InspectorAgent::inspectedURL() const
{
return m_inspectedPage->mainFrame()->loader()->url();
return m_inspectedPage->mainFrame()->document()->url();
}

KURL InspectorAgent::inspectedURLWithoutFragment() const
@@ -378,7 +378,7 @@ static PassRefPtr<InspectorObject> buildObjectForFrame(Frame* frame)
name = frame->ownerElement()->getAttribute(HTMLNames::idAttr);
frameObject->setString("name", name);
}
frameObject->setString("url", frame->loader()->url().string());
frameObject->setString("url", frame->document()->url().string());
return frameObject;
}

@@ -67,7 +67,7 @@ DocumentWriter::DocumentWriter(Frame* frame)
void DocumentWriter::replaceDocument(const String& source)
{
m_frame->loader()->stopAllLoaders();
begin(m_frame->loader()->url(), true, m_frame->document()->securityOrigin());
begin(m_frame->document()->url(), true, m_frame->document()->securityOrigin());

if (!source.isNull()) {
if (!m_receivedData) {
@@ -245,7 +245,7 @@ void DocumentWriter::setDecoder(TextResourceDecoder* decoder)

String DocumentWriter::deprecatedFrameEncoding() const
{
return m_frame->loader()->url().isEmpty() ? m_encoding : encoding();
return m_frame->document()->url().isEmpty() ? m_encoding : encoding();
}

void DocumentWriter::setDocumentWasLoadedAsPartOfNavigation()
@@ -635,12 +635,6 @@ void FrameLoader::receivedFirstData()
m_frame->navigationScheduler()->scheduleRedirect(delay, url);
}

const KURL& FrameLoader::url() const
{
ASSERT(m_frame->document());
return m_frame->document()->url();
}

void FrameLoader::setOutgoingReferrer(const KURL& url)
{
KURL outgoingReferrer(url);
@@ -267,7 +267,6 @@ class FrameLoader {

void frameDetached();

const KURL& url() const;
void setOutgoingReferrer(const KURL&);

void loadDone();
@@ -323,7 +323,7 @@ void HistoryController::updateForStandardLoad(HistoryUpdateType updateType)
if (Page* page = m_frame->page())
addVisitedLink(page, historyURL);

if (!frameLoader->documentLoader()->didCreateGlobalHistoryEntry() && frameLoader->documentLoader()->unreachableURL().isEmpty() && !frameLoader->url().isEmpty())
if (!frameLoader->documentLoader()->didCreateGlobalHistoryEntry() && frameLoader->documentLoader()->unreachableURL().isEmpty() && !m_frame->document()->url().isEmpty())
frameLoader->client()->updateGlobalHistoryRedirectLinks();
}
}
@@ -365,7 +365,7 @@ void HistoryController::updateForRedirectWithLockedBackForwardList()
if (Page* page = m_frame->page())
addVisitedLink(page, historyURL);

if (!m_frame->loader()->documentLoader()->didCreateGlobalHistoryEntry() && m_frame->loader()->documentLoader()->unreachableURL().isEmpty() && !m_frame->loader()->url().isEmpty())
if (!m_frame->loader()->documentLoader()->didCreateGlobalHistoryEntry() && m_frame->loader()->documentLoader()->unreachableURL().isEmpty() && !m_frame->document()->url().isEmpty())
m_frame->loader()->client()->updateGlobalHistoryRedirectLinks();
}
}
@@ -459,7 +459,7 @@ void HistoryController::recursiveUpdateForCommit()

void HistoryController::updateForSameDocumentNavigation()
{
if (m_frame->loader()->url().isEmpty())
if (m_frame->document()->url().isEmpty())
return;

Settings* settings = m_frame->settings();
@@ -470,7 +470,7 @@ void HistoryController::updateForSameDocumentNavigation()
if (!page)
return;

addVisitedLink(page, m_frame->loader()->url());
addVisitedLink(page, m_frame->document()->url());
}

void HistoryController::updateForFrameLoadCompleted()
@@ -178,11 +178,10 @@ class ScheduledHistoryNavigation : public ScheduledNavigation {
{
UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);

FrameLoader* loader = frame->loader();
if (!m_historySteps) {
// Special case for go(0) from a frame -> reload only the frame
// To follow Firefox and IE's behavior, history reload can only navigate the self frame.
loader->urlSelected(loader->url(), "_self", 0, lockHistory(), lockBackForwardList(), SendReferrer);
frame->loader()->urlSelected(frame->document()->url(), "_self", 0, lockHistory(), lockBackForwardList(), SendReferrer);
return;
}
// go(i!=0) from a frame navigates into the history of the frame only,
@@ -322,7 +321,7 @@ void NavigationScheduler::scheduleLocationChange(PassRefPtr<SecurityOrigin> secu
// If the URL we're going to navigate to is the same as the current one, except for the
// fragment part, we don't need to schedule the location change.
KURL parsedURL(ParsedURLString, url);
if (parsedURL.hasFragmentIdentifier() && equalIgnoringFragmentIdentifier(loader->url(), parsedURL)) {
if (parsedURL.hasFragmentIdentifier() && equalIgnoringFragmentIdentifier(m_frame->document()->url(), parsedURL)) {
loader->changeLocation(securityOrigin, loader->completeURL(url), referrer, lockHistory, lockBackForwardList);
return;
}
@@ -359,7 +358,7 @@ void NavigationScheduler::scheduleRefresh()
{
if (!shouldScheduleNavigation())
return;
const KURL& url = m_frame->loader()->url();
const KURL& url = m_frame->document()->url();
if (url.isEmpty())
return;

@@ -2093,7 +2093,7 @@ void FrameView::updateControlTints()
// to define when controls get the tint and to call this function when that changes.

// Optimize the common case where we bring a window to the front while it's still empty.
if (!m_frame || m_frame->loader()->url().isEmpty())
if (!m_frame || m_frame->document()->url().isEmpty())
return;

if ((m_frame->contentRenderer() && m_frame->contentRenderer()->theme()->supportsControlTints()) || hasCustomScrollbars()) {
@@ -51,7 +51,7 @@ inline const KURL& Location::url() const
{
ASSERT(m_frame);

const KURL& url = m_frame->loader()->url();
const KURL& url = m_frame->document()->url();
if (!url.isValid())
return blankURL(); // Use "about:blank" while the page is still loading (before we have a frame).

@@ -167,7 +167,7 @@ void Location::setProtocol(const String& protocol, DOMWindow* activeWindow, DOMW
{
if (!m_frame)
return;
KURL url = m_frame->loader()->url();
KURL url = m_frame->document()->url();
if (!url.setProtocol(protocol)) {
ec = SYNTAX_ERR;
return;
@@ -179,7 +179,7 @@ void Location::setHost(const String& host, DOMWindow* activeWindow, DOMWindow* f
{
if (!m_frame)
return;
KURL url = m_frame->loader()->url();
KURL url = m_frame->document()->url();
url.setHostAndPort(host);
m_frame->domWindow()->setLocation(url.string(), activeWindow, firstWindow);
}
@@ -188,7 +188,7 @@ void Location::setHostname(const String& hostname, DOMWindow* activeWindow, DOMW
{
if (!m_frame)
return;
KURL url = m_frame->loader()->url();
KURL url = m_frame->document()->url();
url.setHost(hostname);
m_frame->domWindow()->setLocation(url.string(), activeWindow, firstWindow);
}
@@ -197,7 +197,7 @@ void Location::setPort(const String& portString, DOMWindow* activeWindow, DOMWin
{
if (!m_frame)
return;
KURL url = m_frame->loader()->url();
KURL url = m_frame->document()->url();
int port = portString.toInt();
if (port < 0 || port > 0xFFFF)
url.removePort();
@@ -210,7 +210,7 @@ void Location::setPathname(const String& pathname, DOMWindow* activeWindow, DOMW
{
if (!m_frame)
return;
KURL url = m_frame->loader()->url();
KURL url = m_frame->document()->url();
url.setPath(pathname);
m_frame->domWindow()->setLocation(url.string(), activeWindow, firstWindow);
}
@@ -219,7 +219,7 @@ void Location::setSearch(const String& search, DOMWindow* activeWindow, DOMWindo
{
if (!m_frame)
return;
KURL url = m_frame->loader()->url();
KURL url = m_frame->document()->url();
url.setQuery(search);
m_frame->domWindow()->setLocation(url.string(), activeWindow, firstWindow);
}
@@ -228,7 +228,7 @@ void Location::setHash(const String& hash, DOMWindow* activeWindow, DOMWindow* f
{
if (!m_frame)
return;
KURL url = m_frame->loader()->url();
KURL url = m_frame->document()->url();
String oldFragmentIdentifier = url.fragmentIdentifier();
String newFragmentIdentifier = hash;
if (hash[0] == '#')
@@ -268,7 +268,7 @@ void Location::reload(DOMWindow* activeWindow)
targetWindow->printErrorMessage(targetWindow->crossDomainAccessErrorMessage(activeWindow));
return;
}
if (protocolIsJavaScript(m_frame->loader()->url()))
if (protocolIsJavaScript(m_frame->document()->url()))
return;
m_frame->navigationScheduler()->scheduleRefresh();
}
@@ -339,7 +339,7 @@ void Page::goToItem(HistoryItem* item, FrameLoadType type)

#if ENABLE(DATABASE)
// If we're navigating the history via a fragment on the same document, then we do not want to stop databases.
const KURL& currentURL = m_mainFrame->loader()->url();
const KURL& currentURL = m_mainFrame->document()->url();
const KURL& newURL = item->url();

if (newURL.hasFragmentIdentifier() && equalIgnoringFragmentIdentifier(currentURL, newURL))
@@ -1,3 +1,13 @@
2011-01-27 Nate Chapin <japhet@chromium.org>

Reviewed by Adam Barth.

Use Document::url() instead of FrameLoader::url().
https://bugs.webkit.org/show_bug.cgi?id=41165

* ewk/ewk_frame.cpp:
(ewk_frame_uri_changed):

2011-01-14 Patrick Gansterer <paroga@webkit.org>

Unreviewed. Try to fix EFL build.
@@ -2008,7 +2008,7 @@ Eina_Bool ewk_frame_uri_changed(Evas_Object* o)
{
EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE);
WTF::CString uri(sd->frame->loader()->url().prettyURL().utf8());
WTF::CString uri(sd->frame->document()->url().prettyURL().utf8());

INF("uri=%s", uri.data());
if (!uri.data()) {
@@ -1,3 +1,13 @@
2011-01-27 Nate Chapin <japhet@chromium.org>

Reviewed by Adam Barth.

Use Document::url() instead of FrameLoader::url().
https://bugs.webkit.org/show_bug.cgi?id=41165

* webkit/webkitwebview.cpp:
(webkit_web_view_get_icon_uri):

2011-01-27 Mario Sanchez Prada <msanchez@igalia.com>

Reviewed by Martin Robinson.
@@ -834,7 +834,7 @@ void FrameLoaderClient::dispatchDidChangeLocationWithinPage()
{
WebKitWebFramePrivate* priv = m_frame->priv;
g_free(priv->uri);
priv->uri = g_strdup(core(m_frame)->loader()->url().prettyURL().utf8().data());
priv->uri = g_strdup(core(m_frame)->document()->url().prettyURL().utf8().data());
g_object_notify(G_OBJECT(m_frame), "uri");
WebKitWebView* webView = getViewFromFrame(m_frame);
if (m_frame == webkit_web_view_get_main_frame(webView))

0 comments on commit 3dacf8f

Please sign in to comment.