Title: [88618] trunk/Source
Revision
88618
Author
[email protected]
Date
2011-06-12 12:21:49 -0700 (Sun, 12 Jun 2011)

Log Message

2011-06-12  Adam Barth  <[email protected]>

        Reviewed by Alexey Proskuryakov.

        Remove trival "forward-to-client" member functions from FrameLoader
        https://bugs.webkit.org/show_bug.cgi?id=62510

        Update to call the FrameLoaderClient directly.  Also, remove cargo-cult
        code that checks whether FrameLoader is null.

        * webkit/webkitwebview.cpp:
        (webkit_web_view_stop_loading):
        (webkit_web_view_can_show_mime_type):
2011-06-12  Adam Barth  <[email protected]>

        Reviewed by Alexey Proskuryakov.

        Remove trival "forward-to-client" member functions from FrameLoader
        https://bugs.webkit.org/show_bug.cgi?id=62510

        * WebCoreSupport/WebFrameNetworkingContext.cpp:
        (WebFrameNetworkingContext::blockedError):
2011-06-12  Adam Barth  <[email protected]>

        Reviewed by Alexey Proskuryakov.

        Remove trival "forward-to-client" member functions from FrameLoader
        https://bugs.webkit.org/show_bug.cgi?id=62510

        * WebCoreSupport/WebFrameNetworkingContext.mm:
        (WebFrameNetworkingContext::blockedError):
2011-06-12  Adam Barth  <[email protected]>

        Reviewed by Alexey Proskuryakov.

        Remove trival "forward-to-client" member functions from FrameLoader
        https://bugs.webkit.org/show_bug.cgi?id=62510

        Originally, FrameLoader was supposed to abstract FrameLoaderClient, but
        we lost that battle log ago.  Nowadays, it's easier if folks just call
        into FrameLoaderClient directly.  Many of these functions have direct
        callers already anyway.

        * WebCore.exp.in:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::createRenderer):
        (WebCore::HTMLMediaElement::attach):
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::setRequest):
        (WebCore::DocumentLoader::setMainDocumentError):
        (WebCore::DocumentLoader::setupForReplaceByMIMEType):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::didFirstLayout):
        * loader/FrameLoader.h:
            - cancelledError is slightly more delicate, so I'm going to move it in
              a separate patch.
        * loader/MainResourceLoader.cpp:
        (WebCore::MainResourceLoader::interruptForPolicyChangeError):
        (WebCore::MainResourceLoader::stopLoadingForPolicyChange):
        (WebCore::MainResourceLoader::continueAfterContentPolicy):
        (WebCore::MainResourceLoader::handleEmptyLoad):
        (WebCore::MainResourceLoader::loadNow):
        * loader/MainResourceLoader.h:
        * loader/NetscapePlugInStreamLoader.cpp:
        (WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
        * loader/PingLoader.cpp:
        (WebCore::PingLoader::PingLoader):
        * loader/PolicyChecker.cpp:
        (WebCore::PolicyChecker::continueAfterNavigationPolicy):
        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::blockedError):
        (WebCore::ResourceLoader::cannotShowURLError):
        (WebCore::ResourceLoader::shouldUseCredentialStorage):
        (WebCore::ResourceLoader::canAuthenticateAgainstProtectionSpace):
        * page/ContextMenuController.cpp:
        (WebCore::ContextMenuController::populate):
2011-06-12  Adam Barth  <[email protected]>

        Reviewed by Alexey Proskuryakov.

        Remove trival "forward-to-client" member functions from FrameLoader
        https://bugs.webkit.org/show_bug.cgi?id=62510

        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
        (WebKit::WebFrameNetworkingContext::blockedError):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (88617 => 88618)


--- trunk/Source/WebCore/ChangeLog	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebCore/ChangeLog	2011-06-12 19:21:49 UTC (rev 88618)
@@ -1,3 +1,49 @@
+2011-06-12  Adam Barth  <[email protected]>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Remove trival "forward-to-client" member functions from FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=62510
+
+        Originally, FrameLoader was supposed to abstract FrameLoaderClient, but
+        we lost that battle log ago.  Nowadays, it's easier if folks just call
+        into FrameLoaderClient directly.  Many of these functions have direct
+        callers already anyway.
+
+        * WebCore.exp.in:
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::createRenderer):
+        (WebCore::HTMLMediaElement::attach):
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::setRequest):
+        (WebCore::DocumentLoader::setMainDocumentError):
+        (WebCore::DocumentLoader::setupForReplaceByMIMEType):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::didFirstLayout):
+        * loader/FrameLoader.h:
+            - cancelledError is slightly more delicate, so I'm going to move it in
+              a separate patch.
+        * loader/MainResourceLoader.cpp:
+        (WebCore::MainResourceLoader::interruptForPolicyChangeError):
+        (WebCore::MainResourceLoader::stopLoadingForPolicyChange):
+        (WebCore::MainResourceLoader::continueAfterContentPolicy):
+        (WebCore::MainResourceLoader::handleEmptyLoad):
+        (WebCore::MainResourceLoader::loadNow):
+        * loader/MainResourceLoader.h:
+        * loader/NetscapePlugInStreamLoader.cpp:
+        (WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
+        * loader/PingLoader.cpp:
+        (WebCore::PingLoader::PingLoader):
+        * loader/PolicyChecker.cpp:
+        (WebCore::PolicyChecker::continueAfterNavigationPolicy):
+        * loader/ResourceLoader.cpp:
+        (WebCore::ResourceLoader::blockedError):
+        (WebCore::ResourceLoader::cannotShowURLError):
+        (WebCore::ResourceLoader::shouldUseCredentialStorage):
+        (WebCore::ResourceLoader::canAuthenticateAgainstProtectionSpace):
+        * page/ContextMenuController.cpp:
+        (WebCore::ContextMenuController::populate):
+
 2011-06-12  Dan Bernstein  <[email protected]>
 
         Reviewed by Darin Adler.

Modified: trunk/Source/WebCore/WebCore.exp.in (88617 => 88618)


--- trunk/Source/WebCore/WebCore.exp.in	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebCore/WebCore.exp.in	2011-06-12 19:21:49 UTC (rev 88618)
@@ -1046,7 +1046,6 @@
 __ZNK7WebCore10ScrollView18visibleContentRectEb
 __ZNK7WebCore11CachedImage5imageEv
 __ZNK7WebCore11FrameLoader10isCompleteEv
-__ZNK7WebCore11FrameLoader12blockedErrorERKNS_15ResourceRequestE
 __ZNK7WebCore11FrameLoader14cancelledErrorERKNS_15ResourceRequestE
 __ZNK7WebCore11FrameLoader14frameHasLoadedEv
 __ZNK7WebCore11FrameLoader16outgoingReferrerEv

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (88617 => 88618)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2011-06-12 19:21:49 UTC (rev 88618)
@@ -335,7 +335,7 @@
         mediaRenderer->setWidget(m_proxyWidget);
 
         if (Frame* frame = document()->frame())
-            frame->loader()->showMediaPlayerProxyPlugin(m_proxyWidget.get());
+            frame->loader()->client()->showMediaPlayerProxyPlugin(m_proxyWidget.get());
     }
     return mediaRenderer;
 #else
@@ -376,7 +376,7 @@
 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     else if (m_proxyWidget) {
         if (Frame* frame = document()->frame())
-            frame->loader()->hideMediaPlayerProxyPlugin(m_proxyWidget.get());
+            frame->loader()->client()->hideMediaPlayerProxyPlugin(m_proxyWidget.get());
     }
 #endif
 }

Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (88617 => 88618)


--- trunk/Source/WebCore/loader/DocumentLoader.cpp	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp	2011-06-12 19:21:49 UTC (rev 88618)
@@ -177,17 +177,17 @@
     KURL oldURL = m_request.url();
     m_request = req;
 
-    // Only send webView:didReceiveServerRedirectForProvisionalLoadForFrame: if URL changed (and is non-null).
+    // Only dispatchDidReceiveServerRedirectForProvisionalLoad() if URL changed (and is non-null).
     // Also, don't send it when replacing unreachable URLs with alternate content.
     if (!handlingUnreachableURL && !req.url().isNull() && oldURL != req.url())
-        frameLoader()->didReceiveServerRedirectForProvisionalLoadForFrame();
+        frameLoader()->client()->dispatchDidReceiveServerRedirectForProvisionalLoad();
 }
 
 void DocumentLoader::setMainDocumentError(const ResourceError& error)
 {
     m_mainDocumentError = error;    
-    frameLoader()->setMainDocumentError(this, error);
- }
+    frameLoader()->client()->setMainDocumentError(this, error);
+}
 
 void DocumentLoader::clearErrors()
 {
@@ -341,7 +341,7 @@
     String oldMIMEType = m_response.mimeType();
     
     if (!doesProgressiveLoad(oldMIMEType)) {
-        frameLoader()->revertToProvisional(this);
+        frameLoader()->client()->revertToProvisionalState(this);
         setupForReplace();
         RefPtr<SharedBuffer> resourceData = mainResourceData();
         commitLoad(resourceData->data(), resourceData->size());
@@ -354,7 +354,7 @@
     m_gotFirstByte = false;
     
     if (doesProgressiveLoad(newMIMEType)) {
-        frameLoader()->revertToProvisional(this);
+        frameLoader()->client()->revertToProvisionalState(this);
         setupForReplace();
     }
     

Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (88617 => 88618)


--- trunk/Source/WebCore/loader/FrameLoader.cpp	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp	2011-06-12 19:21:49 UTC (rev 88618)
@@ -263,11 +263,6 @@
     }
 }
 
-bool FrameLoader::canHandleRequest(const ResourceRequest& request)
-{
-    return m_client->canHandleRequest(request);
-}
-
 void FrameLoader::changeLocation(PassRefPtr<SecurityOrigin> securityOrigin, const KURL& url, const String& referrer, bool lockHistory, bool lockBackForwardList, bool refresh)
 {
     RefPtr<Frame> protect(m_frame);
@@ -1077,18 +1072,6 @@
     return WebCore::ObjectContentNone;
 }
 
-#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-void FrameLoader::hideMediaPlayerProxyPlugin(Widget* widget)
-{
-    m_client->hideMediaPlayerProxyPlugin(widget);
-}
-
-void FrameLoader::showMediaPlayerProxyPlugin(Widget* widget)
-{
-    m_client->showMediaPlayerProxyPlugin(widget);
-}
-#endif // ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-
 String FrameLoader::outgoingReferrer() const
 {
     return m_outgoingReferrer;
@@ -2307,26 +2290,6 @@
     return page && m_frame == page->mainFrame();
 }
 
-bool FrameLoader::canShowMIMEType(const String& MIMEType) const
-{
-    return m_client->canShowMIMEType(MIMEType);
-}
-
-bool FrameLoader::representationExistsForURLScheme(const String& URLScheme)
-{
-    return m_client->representationExistsForURLScheme(URLScheme);
-}
-
-String FrameLoader::generatedMIMETypeForURLScheme(const String& URLScheme)
-{
-    return m_client->generatedMIMETypeForURLScheme(URLScheme);
-}
-
-void FrameLoader::didReceiveServerRedirectForProvisionalLoadForFrame()
-{
-    m_client->dispatchDidReceiveServerRedirectForProvisionalLoad();
-}
-
 void FrameLoader::finishedLoadingDocument(DocumentLoader* loader)
 {
     // FIXME: Platforms shouldn't differ here!
@@ -2375,11 +2338,6 @@
     m_loadType = FrameLoadTypeReplace;
 }
 
-void FrameLoader::revertToProvisional(DocumentLoader* loader)
-{
-    m_client->revertToProvisionalState(loader);
-}
-
 bool FrameLoader::subframeIsLoading() const
 {
     // It's most likely that the last added frame is the last to load so we walk backwards.
@@ -2577,6 +2535,7 @@
 
     if (m_stateMachine.committedFirstRealDocumentLoad() && !m_stateMachine.isDisplayingInitialEmptyDocument() && !m_stateMachine.firstLayoutDone())
         m_stateMachine.advanceTo(FrameLoaderStateMachine::FirstLayoutDone);
+
     m_client->dispatchDidFirstLayout();
 }
 
@@ -3367,11 +3326,6 @@
         loadDifferentDocumentItem(item, loadType);
 }
 
-void FrameLoader::setMainDocumentError(DocumentLoader* loader, const ResourceError& error)
-{
-    m_client->setMainDocumentError(loader, error);
-}
-
 void FrameLoader::mainReceivedCompleteError(DocumentLoader* loader, const ResourceError&)
 {
     loader->setPrimaryLoadComplete(true);
@@ -3393,38 +3347,6 @@
     return error;
 }
 
-ResourceError FrameLoader::blockedError(const ResourceRequest& request) const
-{
-    return m_client->blockedError(request);
-}
-
-ResourceError FrameLoader::cannotShowURLError(const ResourceRequest& request) const
-{
-    return m_client->cannotShowURLError(request);
-}
-
-ResourceError FrameLoader::interruptionForPolicyChangeError(const ResourceRequest& request) const
-{
-    return m_client->interruptForPolicyChangeError(request);
-}
-
-ResourceError FrameLoader::fileDoesNotExistError(const ResourceResponse& response) const
-{
-    return m_client->fileDoesNotExistError(response);    
-}
-
-bool FrameLoader::shouldUseCredentialStorage(ResourceLoader* loader)
-{
-    return m_client->shouldUseCredentialStorage(loader->documentLoader(), loader->identifier());
-}
-
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-bool FrameLoader::canAuthenticateAgainstProtectionSpace(ResourceLoader* loader, const ProtectionSpace& protectionSpace)
-{
-    return m_client->canAuthenticateAgainstProtectionSpace(loader->documentLoader(), loader->identifier(), protectionSpace);
-}
-#endif
-
 void FrameLoader::setTitle(const StringWithDirection& title)
 {
     documentLoader()->setTitle(title);

Modified: trunk/Source/WebCore/loader/FrameLoader.h (88617 => 88618)


--- trunk/Source/WebCore/loader/FrameLoader.h	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebCore/loader/FrameLoader.h	2011-06-12 19:21:49 UTC (rev 88618)
@@ -128,8 +128,6 @@
 
     unsigned long loadResourceSynchronously(const ResourceRequest&, StoredCredentials, ResourceError&, ResourceResponse&, Vector<char>& data);
 
-    bool canHandleRequest(const ResourceRequest&);
-
     // Also not cool.
     void stopAllLoaders(ClearProvisionalItemPolicy = ShouldClearProvisionalItem);
     void stopForUserCancel(bool deferCheckLoadComplete = false);
@@ -152,10 +150,6 @@
     FrameState state() const { return m_state; }
     static double timeOfLastCompletedLoad();
 
-    bool shouldUseCredentialStorage(ResourceLoader*);
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    bool canAuthenticateAgainstProtectionSpace(ResourceLoader* loader, const ProtectionSpace& protectionSpace);
-#endif
     const ResourceRequest& originalRequest() const;
     const ResourceRequest& initialRequest() const;
     void receivedMainResourceError(const ResourceError&, bool isComplete);
@@ -167,27 +161,18 @@
 
     void finishedLoading();
 
+    // FIXME: Move this method to ResourceLoader with the rest of the ResourceError accessors.
     ResourceError cancelledError(const ResourceRequest&) const;
-    ResourceError fileDoesNotExistError(const ResourceResponse&) const;
-    ResourceError blockedError(const ResourceRequest&) const;
-    ResourceError cannotShowURLError(const ResourceRequest&) const;
-    ResourceError interruptionForPolicyChangeError(const ResourceRequest&) const;
 
     bool isHostedByObjectElement() const;
     bool isLoadingMainFrame() const;
-    bool canShowMIMEType(const String& MIMEType) const;
-    bool representationExistsForURLScheme(const String& URLScheme);
-    String generatedMIMETypeForURLScheme(const String& URLScheme);
 
     void reload(bool endToEndReload = false);
     void reloadWithOverrideEncoding(const String& overrideEncoding);
 
-    void didReceiveServerRedirectForProvisionalLoadForFrame();
     void finishedLoadingDocument(DocumentLoader*);
     bool isReplacing() const;
     void setReplacing();
-    void revertToProvisional(DocumentLoader*);
-    void setMainDocumentError(DocumentLoader*, const ResourceError&);
     void mainReceivedCompleteError(DocumentLoader*, const ResourceError&);
     bool subframeIsLoading() const;
     void willChangeTitle(DocumentLoader*);
@@ -309,11 +294,6 @@
 
     void open(CachedFrameBase&);
 
-#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-    void hideMediaPlayerProxyPlugin(Widget*);
-    void showMediaPlayerProxyPlugin(Widget*);
-#endif
-
     // FIXME: Should these really be public?
     void completed();
     bool allAncestorsAreComplete() const; // including this

Modified: trunk/Source/WebCore/loader/MainResourceLoader.cpp (88617 => 88618)


--- trunk/Source/WebCore/loader/MainResourceLoader.cpp	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebCore/loader/MainResourceLoader.cpp	2011-06-12 19:21:49 UTC (rev 88618)
@@ -118,14 +118,14 @@
     frameLoader()->receivedMainResourceError(error, true);
 }
 
-ResourceError MainResourceLoader::interruptionForPolicyChangeError() const
+ResourceError MainResourceLoader::interruptForPolicyChangeError() const
 {
-    return frameLoader()->interruptionForPolicyChangeError(request());
+    return frameLoader()->client()->interruptForPolicyChangeError(request());
 }
 
 void MainResourceLoader::stopLoadingForPolicyChange()
 {
-    ResourceError error = interruptionForPolicyChangeError();
+    ResourceError error = interruptForPolicyChangeError();
     error.setIsCancellation(true);
     cancel(error);
 }
@@ -258,7 +258,7 @@
         // Prevent remote web archives from loading because they can claim to be from any domain and thus avoid cross-domain security checks (4120255).
         bool isRemoteWebArchive = (equalIgnoringCase("application/x-webarchive", mimeType) || equalIgnoringCase("multipart/related", mimeType))
             && !m_substituteData.isValid() && !url.isLocalFile();
-        if (!frameLoader()->canShowMIMEType(mimeType) || isRemoteWebArchive) {
+        if (!frameLoader()->client()->canShowMIMEType(mimeType) || isRemoteWebArchive) {
             frameLoader()->policyChecker()->cannotShowMIMEType(r);
             // Check reachedTerminalState since the load may have already been cancelled inside of _handleUnimplementablePolicyWithErrorCode::.
             if (!reachedTerminalState())
@@ -278,7 +278,7 @@
         frameLoader()->client()->download(m_handle.get(), request(), m_handle.get()->firstRequest(), r);
         // It might have gone missing
         if (frameLoader())
-            receivedError(interruptionForPolicyChangeError());
+            receivedError(interruptForPolicyChangeError());
         return;
 
     case PolicyIgnore:
@@ -316,7 +316,7 @@
                 didReceiveData(m_substituteData.content()->data(), m_substituteData.content()->size(), m_substituteData.content()->size(), true);
             if (frameLoader() && !frameLoader()->isStopping()) 
                 didFinishLoading(0);
-        } else if (shouldLoadAsEmptyDocument(url) || frameLoader()->representationExistsForURLScheme(url.protocol()))
+        } else if (shouldLoadAsEmptyDocument(url) || frameLoader()->client()->representationExistsForURLScheme(url.protocol()))
             didFinishLoading(0);
     }
 }
@@ -510,7 +510,7 @@
 {
     String mimeType;
     if (forURLScheme)
-        mimeType = frameLoader()->generatedMIMETypeForURLScheme(url.protocol());
+        mimeType = frameLoader()->client()->generatedMIMETypeForURLScheme(url.protocol());
     else
         mimeType = "text/html";
     
@@ -580,7 +580,7 @@
     resourceLoadScheduler()->addMainResourceLoad(this);
     if (m_substituteData.isValid()) 
         handleDataLoadSoon(r);
-    else if (shouldLoadEmpty || frameLoader()->representationExistsForURLScheme(url.protocol()))
+    else if (shouldLoadEmpty || frameLoader()->client()->representationExistsForURLScheme(url.protocol()))
         handleEmptyLoad(url, !shouldLoadEmpty);
     else
         m_handle = ResourceHandle::create(m_frame->loader()->networkingContext(), r, this, false, true);

Modified: trunk/Source/WebCore/loader/MainResourceLoader.h (88617 => 88618)


--- trunk/Source/WebCore/loader/MainResourceLoader.h	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebCore/loader/MainResourceLoader.h	2011-06-12 19:21:49 UTC (rev 88618)
@@ -86,7 +86,7 @@
         void handleDataLoad(ResourceRequest&);
 
         void receivedError(const ResourceError&);
-        ResourceError interruptionForPolicyChangeError() const;
+        ResourceError interruptForPolicyChangeError() const;
         void stopLoadingForPolicyChange();
         bool isPostOrRedirectAfterPost(const ResourceRequest& newRequest, const ResourceResponse& redirectResponse);
 

Modified: trunk/Source/WebCore/loader/NetscapePlugInStreamLoader.cpp (88617 => 88618)


--- trunk/Source/WebCore/loader/NetscapePlugInStreamLoader.cpp	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebCore/loader/NetscapePlugInStreamLoader.cpp	2011-06-12 19:21:49 UTC (rev 88618)
@@ -30,6 +30,7 @@
 #include "NetscapePlugInStreamLoader.h"
 
 #include "FrameLoader.h"
+#include "FrameLoaderClient.h"
 #include "DocumentLoader.h"
 
 namespace WebCore {
@@ -89,7 +90,7 @@
         return;
     
     if (response.httpStatusCode() < 100 || response.httpStatusCode() >= 400)
-        cancel(frameLoader()->fileDoesNotExistError(response));
+        cancel(frameLoader()->client()->fileDoesNotExistError(response));
 }
 
 void NetscapePlugInStreamLoader::didReceiveData(const char* data, int length, long long encodedDataLength, bool allAtOnce)

Modified: trunk/Source/WebCore/loader/PingLoader.cpp (88617 => 88618)


--- trunk/Source/WebCore/loader/PingLoader.cpp	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebCore/loader/PingLoader.cpp	2011-06-12 19:21:49 UTC (rev 88618)
@@ -115,6 +115,11 @@
     : m_timeout(this, &PingLoader::timeout)
 {
     unsigned long identifier = frame->page()->progress()->createUniqueIdentifier();
+    // FIXME: Why activeDocumentLoader? I would have expected documentLoader().
+    // Itseems like the PingLoader should be associated with the current
+    // Document in the Frame, but the activeDocumentLoader will be associated
+    // with the provisional DocumentLoader if there is a provisional
+    // DocumentLoader.
     m_shouldUseCredentialStorage = frame->loader()->client()->shouldUseCredentialStorage(frame->loader()->activeDocumentLoader(), identifier);
     m_handle = ResourceHandle::create(frame->loader()->networkingContext(), request, this, false, false);
 

Modified: trunk/Source/WebCore/loader/PolicyChecker.cpp (88617 => 88618)


--- trunk/Source/WebCore/loader/PolicyChecker.cpp	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebCore/loader/PolicyChecker.cpp	2011-06-12 19:21:49 UTC (rev 88618)
@@ -153,7 +153,7 @@
             ResourceRequest request(callback.request());
 
             if (!m_frame->loader()->client()->canHandleRequest(request)) {
-                handleUnimplementablePolicy(m_frame->loader()->cannotShowURLError(callback.request()));
+                handleUnimplementablePolicy(m_frame->loader()->client()->cannotShowURLError(callback.request()));
                 callback.clearRequest();
                 shouldContinue = false;
             }

Modified: trunk/Source/WebCore/loader/ResourceLoader.cpp (88617 => 88618)


--- trunk/Source/WebCore/loader/ResourceLoader.cpp	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebCore/loader/ResourceLoader.cpp	2011-06-12 19:21:49 UTC (rev 88618)
@@ -406,12 +406,12 @@
 
 ResourceError ResourceLoader::blockedError()
 {
-    return frameLoader()->blockedError(m_request);
+    return frameLoader()->client()->blockedError(m_request);
 }
 
 ResourceError ResourceLoader::cannotShowURLError()
 {
-    return frameLoader()->cannotShowURLError(m_request);
+    return frameLoader()->client()->cannotShowURLError(m_request);
 }
 
 void ResourceLoader::willSendRequest(ResourceHandle*, ResourceRequest& request, const ResourceResponse& redirectResponse)
@@ -471,7 +471,7 @@
 bool ResourceLoader::shouldUseCredentialStorage()
 {
     RefPtr<ResourceLoader> protector(this);
-    return frameLoader()->shouldUseCredentialStorage(this);
+    return frameLoader()->client()->shouldUseCredentialStorage(documentLoader(), identifier());
 }
 
 void ResourceLoader::didReceiveAuthenticationChallenge(const AuthenticationChallenge& challenge)
@@ -494,7 +494,7 @@
 bool ResourceLoader::canAuthenticateAgainstProtectionSpace(const ProtectionSpace& protectionSpace)
 {
     RefPtr<ResourceLoader> protector(this);
-    return frameLoader()->canAuthenticateAgainstProtectionSpace(this, protectionSpace);
+    return frameLoader()->client()->canAuthenticateAgainstProtectionSpace(documentLoader(), identifier(), protectionSpace);
 }
 #endif
 

Modified: trunk/Source/WebCore/page/ContextMenuController.cpp (88617 => 88618)


--- trunk/Source/WebCore/page/ContextMenuController.cpp	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebCore/page/ContextMenuController.cpp	2011-06-12 19:21:49 UTC (rev 88618)
@@ -47,6 +47,7 @@
 #include "Frame.h"
 #include "FrameLoadRequest.h"
 #include "FrameLoader.h"
+#include "FrameLoaderClient.h"
 #include "FrameSelection.h"
 #include "HTMLFormElement.h"
 #include "HitTestRequest.h"
@@ -694,7 +695,7 @@
         FrameLoader* loader = frame->loader();
         KURL linkURL = m_hitTestResult.absoluteLinkURL();
         if (!linkURL.isEmpty()) {
-            if (loader->canHandleRequest(ResourceRequest(linkURL))) {
+            if (loader->client()->canHandleRequest(ResourceRequest(linkURL))) {
                 appendItem(OpenLinkItem, m_contextMenu.get());
                 appendItem(OpenLinkInNewWindowItem, m_contextMenu.get());
                 appendItem(DownloadFileItem, m_contextMenu.get());
@@ -855,7 +856,7 @@
         FrameLoader* loader = frame->loader();
         KURL linkURL = m_hitTestResult.absoluteLinkURL();
         if (!linkURL.isEmpty()) {
-            if (loader->canHandleRequest(ResourceRequest(linkURL))) {
+            if (loader->client()->canHandleRequest(ResourceRequest(linkURL))) {
                 appendItem(OpenLinkItem, m_contextMenu.get());
                 appendItem(OpenLinkInNewWindowItem, m_contextMenu.get());
                 appendItem(DownloadFileItem, m_contextMenu.get());

Modified: trunk/Source/WebKit/gtk/ChangeLog (88617 => 88618)


--- trunk/Source/WebKit/gtk/ChangeLog	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebKit/gtk/ChangeLog	2011-06-12 19:21:49 UTC (rev 88618)
@@ -1,3 +1,17 @@
+2011-06-12  Adam Barth  <[email protected]>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Remove trival "forward-to-client" member functions from FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=62510
+
+        Update to call the FrameLoaderClient directly.  Also, remove cargo-cult
+        code that checks whether FrameLoader is null.
+
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_stop_loading):
+        (webkit_web_view_can_show_mime_type):
+
 2011-06-09  Martin Robinson  <[email protected]>
 
         Reviewed by Eric Seidel.

Modified: trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp (88617 => 88618)


--- trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp	2011-06-12 19:21:49 UTC (rev 88618)
@@ -52,6 +52,7 @@
 #include "FloatQuad.h"
 #include "FocusController.h"
 #include "FrameLoader.h"
+#include "FrameLoaderClient.h"
 #include "FrameLoaderTypes.h"
 #include "FrameView.h"
 #include "GOwnPtrGtk.h"
@@ -3978,10 +3979,7 @@
 {
     g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
 
-    Frame* frame = core(webView)->mainFrame();
-
-    if (FrameLoader* loader = frame->loader())
-        loader->stopForUserCancel();
+    core(webView)->mainFrame()->loader()->stopForUserCancel();
 }
 
 /**
@@ -4356,10 +4354,7 @@
     g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE);
 
     Frame* frame = core(webkit_web_view_get_main_frame(webView));
-    if (FrameLoader* loader = frame->loader())
-        return loader->canShowMIMEType(String::fromUTF8(mimeType));
-    else
-        return FALSE;
+    return frame->loader()->client()->canShowMIMEType(String::fromUTF8(mimeType));
 }
 
 /**

Modified: trunk/Source/WebKit/mac/ChangeLog (88617 => 88618)


--- trunk/Source/WebKit/mac/ChangeLog	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebKit/mac/ChangeLog	2011-06-12 19:21:49 UTC (rev 88618)
@@ -1,3 +1,13 @@
+2011-06-12  Adam Barth  <[email protected]>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Remove trival "forward-to-client" member functions from FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=62510
+
+        * WebCoreSupport/WebFrameNetworkingContext.mm:
+        (WebFrameNetworkingContext::blockedError):
+
 2011-06-10  Tony Chang  <[email protected]>
 
         Reviewed by Ojan Vafai.

Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.mm (88617 => 88618)


--- trunk/Source/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.mm	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.mm	2011-06-12 19:21:49 UTC (rev 88618)
@@ -19,6 +19,7 @@
 
 #import "WebFrameNetworkingContext.h"
 
+#import <WebCore/FrameLoaderClient.h>
 #import <WebCore/Page.h>
 #import <WebCore/ResourceError.h>
 #import <WebCore/Settings.h>
@@ -42,5 +43,5 @@
 
 ResourceError WebFrameNetworkingContext::blockedError(const ResourceRequest& request) const
 {
-    return frame()->loader()->blockedError(request);
+    return frame()->loader()->client()->blockedError(request);
 }

Modified: trunk/Source/WebKit/win/ChangeLog (88617 => 88618)


--- trunk/Source/WebKit/win/ChangeLog	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebKit/win/ChangeLog	2011-06-12 19:21:49 UTC (rev 88618)
@@ -1,3 +1,13 @@
+2011-06-12  Adam Barth  <[email protected]>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Remove trival "forward-to-client" member functions from FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=62510
+
+        * WebCoreSupport/WebFrameNetworkingContext.cpp:
+        (WebFrameNetworkingContext::blockedError):
+
 2011-06-06  Michael Saboff  <[email protected]>
 
         Reviewed by Geoffrey Garen.

Modified: trunk/Source/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp (88617 => 88618)


--- trunk/Source/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp	2011-06-12 19:21:49 UTC (rev 88618)
@@ -18,9 +18,10 @@
 */
 
 #include "config.h"
-
 #include "WebFrameNetworkingContext.h"
 
+#include "FrameLoaderClient.h"
+
 using namespace WebCore;
 
 PassRefPtr<WebFrameNetworkingContext> WebFrameNetworkingContext::create(Frame* frame, const String& userAgent)
@@ -40,5 +41,5 @@
 
 WebCore::ResourceError WebFrameNetworkingContext::blockedError(const WebCore::ResourceRequest& request) const
 {
-    return frame()->loader()->blockedError(request);
+    return frame()->loader()->client()->blockedError(request);
 }

Modified: trunk/Source/WebKit2/ChangeLog (88617 => 88618)


--- trunk/Source/WebKit2/ChangeLog	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebKit2/ChangeLog	2011-06-12 19:21:49 UTC (rev 88618)
@@ -1,3 +1,13 @@
+2011-06-12  Adam Barth  <[email protected]>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Remove trival "forward-to-client" member functions from FrameLoader
+        https://bugs.webkit.org/show_bug.cgi?id=62510
+
+        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
+        (WebKit::WebFrameNetworkingContext::blockedError):
+
 2011-06-11  Stephanie Lewis  <[email protected]>
 
         Reviewed by Sam Weinig.

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm (88617 => 88618)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm	2011-06-12 18:27:00 UTC (rev 88617)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm	2011-06-12 19:21:49 UTC (rev 88618)
@@ -20,6 +20,7 @@
 #import "config.h"
 #import "WebFrameNetworkingContext.h"
 
+#import <WebCore/FrameLoaderClient.h>
 #import <WebCore/Page.h>
 #import <WebCore/ResourceError.h>
 #import <WebCore/Settings.h>
@@ -45,7 +46,7 @@
 
 ResourceError WebFrameNetworkingContext::blockedError(const ResourceRequest& request) const
 {
-    return frame()->loader()->blockedError(request);
+    return frame()->loader()->client()->blockedError(request);
 }
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to