From 563af33bc48281d19dce701398dbb88cb54fd7ec Mon Sep 17 00:00:00 2001 From: Cary Clark <> Date: Tue, 14 Apr 2009 06:33:00 -0700 Subject: AI 146110: add missing files to webkit brings it in sync with webkit svn cl 42046 Automated import of CL 146110 --- WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp | 62 ++++++++++++++++------ WebKit/win/WebCoreSupport/WebFrameLoaderClient.h | 5 +- WebKit/win/WebCoreSupport/WebInspectorClient.cpp | 7 +++ WebKit/win/WebCoreSupport/WebInspectorClient.h | 2 + 4 files changed, 57 insertions(+), 19 deletions(-) (limited to 'WebKit/win/WebCoreSupport') diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp index 1af1673..c307660 100644 --- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp +++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp @@ -41,6 +41,7 @@ #include "WebError.h" #include "WebFrame.h" #include "WebHistory.h" +#include "WebHistoryItem.h" #include "WebMutableURLRequest.h" #include "WebNotificationCenter.h" #include "WebScriptDebugServer.h" @@ -53,9 +54,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -91,7 +94,9 @@ bool WebFrameLoaderClient::hasWebView() const void WebFrameLoaderClient::forceLayout() { - core(m_webFrame)->forceLayout(true); + FrameView* view = core(m_webFrame)->view(); + if (view) + view->forceLayout(true); } void WebFrameLoaderClient::assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request) @@ -221,6 +226,25 @@ void WebFrameLoaderClient::dispatchDidFailLoading(DocumentLoader* loader, unsign resourceLoadDelegate->didFailLoadingWithError(webView, identifier, webError.get(), getWebDataSource(loader)); } +bool WebFrameLoaderClient::shouldCacheResponse(DocumentLoader* loader, unsigned long identifier, const ResourceResponse& response, const unsigned char* data, const unsigned long long length) +{ + WebView* webView = m_webFrame->webView(); + COMPtr resourceLoadDelegate; + if (FAILED(webView->resourceLoadDelegate(&resourceLoadDelegate))) + return true; + + COMPtr resourceLoadDelegatePrivate(Query, resourceLoadDelegate); + if (!resourceLoadDelegatePrivate) + return true; + + COMPtr urlResponse(WebURLResponse::createInstance(response)); + BOOL shouldCache; + if (SUCCEEDED(resourceLoadDelegatePrivate->shouldCacheResponse(webView, identifier, urlResponse.get(), data, length, getWebDataSource(loader), &shouldCache))) + return shouldCache; + + return true; +} + void WebFrameLoaderClient::dispatchDidHandleOnloadEvents() { WebView* webView = m_webFrame->webView(); @@ -457,27 +481,31 @@ void WebFrameLoaderClient::updateGlobalHistory() return; DocumentLoader* loader = core(m_webFrame)->loader()->documentLoader(); - - if (loader->urlForHistoryReflectsServerRedirect()) { - history->visitedURL(loader->urlForHistory(), loader->title(), loader->request().httpMethod(), loader->urlForHistoryReflectsFailure(), loader->url(), false); - return; - } - - if (loader->urlForHistoryReflectsClientRedirect()) { - history->visitedURL(loader->urlForHistory(), loader->title(), loader->request().httpMethod(), loader->urlForHistoryReflectsFailure(), KURL(), true); - return; - } - - history->visitedURL(loader->urlForHistory(), loader->title(), loader->request().httpMethod(), loader->urlForHistoryReflectsFailure(), KURL(), false); + history->visitedURL(loader->urlForHistory(), loader->title(), loader->originalRequestCopy().httpMethod(), loader->urlForHistoryReflectsFailure()); + updateGlobalHistoryRedirectLinks(); } -void WebFrameLoaderClient::updateGlobalHistoryForRedirectWithoutHistoryItem() +void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks() { WebHistory* history = WebHistory::sharedHistory(); if (!history) return; + DocumentLoader* loader = core(m_webFrame)->loader()->documentLoader(); - history->visitedURLForRedirectWithoutHistoryItem(loader->url()); + + if (!loader->clientRedirectSourceForHistory().isNull()) { + if (COMPtr iWebHistoryItem = history->itemForURLString(loader->clientRedirectSourceForHistory())) { + COMPtr webHistoryItem(Query, iWebHistoryItem); + webHistoryItem->historyItem()->addRedirectURL(loader->clientRedirectDestinationForHistory()); + } + } + + if (!loader->serverRedirectSourceForHistory().isNull()) { + if (COMPtr iWebHistoryItem = history->itemForURLString(loader->serverRedirectSourceForHistory())) { + COMPtr webHistoryItem(Query, iWebHistoryItem); + webHistoryItem->historyItem()->addRedirectURL(loader->serverRedirectDestinationForHistory()); + } + } } bool WebFrameLoaderClient::shouldGoToHistoryItem(HistoryItem*) const @@ -548,7 +576,7 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage() view->frameRect(&rect); bool transparent = view->transparent(); Color backgroundColor = transparent ? Color::transparent : Color::white; - WebCore::FrameLoaderClient::transitionToCommittedForNewPage(core(m_webFrame), IntRect(rect).size(), backgroundColor, transparent, IntSize(), false); + core(m_webFrame)->createView(IntRect(rect).size(), backgroundColor, transparent, IntSize(), false); } bool WebFrameLoaderClient::canCachePage() const @@ -627,7 +655,7 @@ void WebFrameLoaderClient::loadURLIntoChild(const KURL& originalURL, const Strin core(childFrame)->loader()->loadURL(url, referrer, frameName, false, childLoadType, 0, 0); } -Widget* WebFrameLoaderClient::createPlugin(const IntSize& pluginSize, Element* element, const KURL& url, const Vector& paramNames, const Vector& paramValues, const String& mimeType, bool loadManually) +Widget* WebFrameLoaderClient::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const KURL& url, const Vector& paramNames, const Vector& paramValues, const String& mimeType, bool loadManually) { WebView* webView = m_webFrame->webView(); diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h index 3877273..ac7a8c7 100644 --- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h +++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h @@ -56,6 +56,7 @@ public: virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int lengthReceived); virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long identifier); virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceError&); + virtual bool shouldCacheResponse(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceResponse&, const unsigned char* data, unsigned long long length); virtual void dispatchDidHandleOnloadEvents(); virtual void dispatchDidReceiveServerRedirectForProvisionalLoad(); @@ -86,7 +87,7 @@ public: virtual void finishedLoading(WebCore::DocumentLoader*); virtual void updateGlobalHistory(); - virtual void updateGlobalHistoryForRedirectWithoutHistoryItem(); + virtual void updateGlobalHistoryRedirectLinks(); virtual bool shouldGoToHistoryItem(WebCore::HistoryItem*) const; virtual PassRefPtr createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); @@ -100,7 +101,7 @@ public: virtual PassRefPtr createFrame(const WebCore::KURL& url, const WebCore::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, const WebCore::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); - virtual WebCore::Widget* createPlugin(const WebCore::IntSize&, WebCore::Element*, const WebCore::KURL&, const Vector&, const Vector&, const WebCore::String&, bool loadManually); + virtual WebCore::Widget* createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector&, const Vector&, const WebCore::String&, bool loadManually); virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget); virtual bool shouldUsePluginDocument(const WebCore::String& mimeType) const; diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.cpp b/WebKit/win/WebCoreSupport/WebInspectorClient.cpp index 56cf0df..5bb1a83 100644 --- a/WebKit/win/WebCoreSupport/WebInspectorClient.cpp +++ b/WebKit/win/WebCoreSupport/WebInspectorClient.cpp @@ -201,6 +201,13 @@ String WebInspectorClient::localizedStringsURL() return CFURLGetString(url.get()); } + +String WebInspectorClient::hiddenPanels() +{ + // FIXME: implement this + return String(); +} + void WebInspectorClient::showWindow() { showWindowWithoutNotifications(); diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.h b/WebKit/win/WebCoreSupport/WebInspectorClient.h index 86317f6..b497788 100644 --- a/WebKit/win/WebCoreSupport/WebInspectorClient.h +++ b/WebKit/win/WebCoreSupport/WebInspectorClient.h @@ -50,6 +50,8 @@ public: virtual WebCore::String localizedStringsURL(); + virtual WebCore::String hiddenPanels(); + virtual void showWindow(); virtual void closeWindow(); virtual bool windowVisible(); -- cgit v1.1