Commit c647272e authored by ggaren@apple.com's avatar ggaren@apple.com
Browse files

Fixed complexity and performance FIXME created by using KURL in the UI

process -- it turned out that everywhere we were using KURL, we could
have just used String instead. (That's how Windows WebKit works, too.)

Reviewed by Anders Carlsson.

I kept WKURLRef and WKStringRef distinct opaque types in the API for now,
though, since there may be profit in changing their backing stores in the
future, and it's nice for the API to encode a difference between generic
strings and strings that are valid, canonical URLs.

* Shared/KURLWrapper.h: Removed. Yay!

* Shared/WebCoreTypeArgumentMarshalling.h: Nixed KURL marshalling functions.
Old callers marshal Strings now, instead. (This is what KURL was doing
under the covers, anyway.)

* UIProcess/API/C/WKAPICast.h:
(toWK): Backed by StringImpl* now.
(toURLRef): Added a disambiguating function for specifying that you want
a WKURLRef, since StringImpl* converts to WKStringRef by default.

* UIProcess/API/C/WKFrame.cpp:
(WKFrameGetProvisionalURL):
(WKFrameGetURL):
* UIProcess/API/C/WKPage.cpp:
(WKPageLoadURL):
* UIProcess/API/C/WKURL.cpp:
* UIProcess/API/C/cf/WKURLCF.cpp:
(WKURLCreateWithCFURL):
(WKURLCopyCFURL):
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::didStartProvisionalLoad):
(WebKit::WebFrameProxy::didCommitLoad):
* UIProcess/WebFrameProxy.h:
(WebKit::WebFrameProxy::url):
(WebKit::WebFrameProxy::provisionalURL):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadURL):
(WebKit::WebPageProxy::didReceiveMessage):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForMIMEType):
(WebKit::WebPageProxy::processDidExit):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::urlAtProcessExit):
* UIProcess/WebPolicyClient.cpp:
(WebKit::WebPolicyClient::decidePolicyForNavigationAction):
(WebKit::WebPolicyClient::decidePolicyForNewWindowAction):
(WebKit::WebPolicyClient::decidePolicyForMIMEType):
* UIProcess/WebPolicyClient.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForMIMEType):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadURL):
(WebKit::WebPage::didReceiveMessage):
* WebProcess/WebPage/WebPage.h: Replaced KURL / KURLWrapper with String.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@57645 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2b5537b5
2010-04-12 Geoffrey Garen <ggaren@apple.com>
Reviewed by Anders Carlsson.
Fixed complexity and performance FIXME created by using KURL in the UI
process -- it turned out that everywhere we were using KURL, we could
have just used String instead. (That's how Windows WebKit works, too.)
I kept WKURLRef and WKStringRef distinct opaque types in the API for now,
though, since there may be profit in changing their backing stores in the
future, and it's nice for the API to encode a difference between generic
strings and strings that are valid, canonical URLs.
* Shared/KURLWrapper.h: Removed. Yay!
* Shared/WebCoreTypeArgumentMarshalling.h: Nixed KURL marshalling functions.
Old callers marshal Strings now, instead. (This is what KURL was doing
under the covers, anyway.)
* UIProcess/API/C/WKAPICast.h:
(toWK): Backed by StringImpl* now.
(toURLRef): Added a disambiguating function for specifying that you want
a WKURLRef, since StringImpl* converts to WKStringRef by default.
* UIProcess/API/C/WKFrame.cpp:
(WKFrameGetProvisionalURL):
(WKFrameGetURL):
* UIProcess/API/C/WKPage.cpp:
(WKPageLoadURL):
* UIProcess/API/C/WKURL.cpp:
* UIProcess/API/C/cf/WKURLCF.cpp:
(WKURLCreateWithCFURL):
(WKURLCopyCFURL):
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::didStartProvisionalLoad):
(WebKit::WebFrameProxy::didCommitLoad):
* UIProcess/WebFrameProxy.h:
(WebKit::WebFrameProxy::url):
(WebKit::WebFrameProxy::provisionalURL):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadURL):
(WebKit::WebPageProxy::didReceiveMessage):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForMIMEType):
(WebKit::WebPageProxy::processDidExit):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::urlAtProcessExit):
* UIProcess/WebPolicyClient.cpp:
(WebKit::WebPolicyClient::decidePolicyForNavigationAction):
(WebKit::WebPolicyClient::decidePolicyForNewWindowAction):
(WebKit::WebPolicyClient::decidePolicyForMIMEType):
* UIProcess/WebPolicyClient.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForMIMEType):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadURL):
(WebKit::WebPage::didReceiveMessage):
* WebProcess/WebPage/WebPage.h: Replaced KURL / KURLWrapper with String.
2010-04-14 Anders Carlsson <andersca@apple.com>
Reviewed by Sam Weinig.
......
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef KURLWrapper_h
#define KURLWrapper_h
#include <WebCore/KURL.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
namespace WebKit {
class KURLWrapper : public RefCounted<KURLWrapper> {
public:
static PassRefPtr<KURLWrapper> create(const WebCore::KURL& url)
{
return adoptRef(new KURLWrapper(url));
}
const WebCore::KURL& url() const { return m_url; }
private:
KURLWrapper(const WebCore::KURL& url)
: m_url(url)
{
}
WebCore::KURL m_url;
};
} // namespace WebKit
#endif // KURLWrapper_h
......@@ -31,7 +31,6 @@
#include "Arguments.h"
#include <WebCore/FloatRect.h>
#include <WebCore/IntRect.h>
#include <WebCore/KURL.h>
#include <WebCore/PlatformString.h>
namespace CoreIPC {
......@@ -171,24 +170,6 @@ template<> inline bool decode(ArgumentDecoder& decoder, WebCore::String& s)
return true;
}
// WebCore::KURL
// FIXME: The encoding scheme for KURL is really inefficient since we end up parsing the URL
// twice. We should find a way to encode the parsed url form.
template<> inline void encode(ArgumentEncoder& encoder, const WebCore::KURL& url)
{
encoder.encode(url.string());
}
template<> inline bool decode(ArgumentDecoder& decoder, WebCore::KURL& url)
{
WebCore::String string;
if (!decoder.decode(string))
return false;
url = WebCore::KURL(WebCore::ParsedURLString, string);
return true;
}
} // namespace ArgumentCoders
} // namespace CoreIPC
......
......@@ -43,7 +43,6 @@ namespace WebKit {
class WebPageNamespace;
class WebPageProxy;
class WebPreferences;
class KURLWrapper;
}
/* Opaque typing convenience methods */
......@@ -118,14 +117,14 @@ inline WKStringRef toRef(WebCore::StringImpl* s)
return reinterpret_cast<WKStringRef>(s);
}
inline WebKit::KURLWrapper* toWK(WKURLRef u)
inline WebCore::StringImpl* toWK(WKURLRef u)
{
return reinterpret_cast<WebKit::KURLWrapper*>(u);
return reinterpret_cast<WebCore::StringImpl*>(u);
}
inline WKURLRef toRef(WebKit::KURLWrapper* u)
inline WKURLRef toURLRef(WebCore::StringImpl* s)
{
return reinterpret_cast<WKURLRef>(u);
return reinterpret_cast<WKURLRef>(s);
}
#endif // WKAPICast_h
......@@ -55,13 +55,13 @@ WKFrameLoadState WKFrameGetFrameLoadState(WKFrameRef frameRef)
WKURLRef WKFrameGetProvisionalURL(WKFrameRef frameRef)
{
WebFrameProxy* frame = toWK(frameRef);
return toRef(frame->provisionalURL());
return toURLRef(frame->provisionalURL().impl());
}
WKURLRef WKFrameGetURL(WKFrameRef frameRef)
{
WebFrameProxy* frame = toWK(frameRef);
return toRef(frame->url());
return toURLRef(frame->url().impl());
}
WKFrameRef WKFrameRetain(WKFrameRef frameRef)
......
......@@ -41,7 +41,7 @@ WKPageNamespaceRef WKPageGetPageNamespace(WKPageRef pageRef)
void WKPageLoadURL(WKPageRef pageRef, WKURLRef URLRef)
{
toWK(pageRef)->loadURL(toWK(URLRef)->url());
toWK(pageRef)->loadURL(toWK(URLRef));
}
void WKPageStopLoading(WKPageRef pageRef)
......
......@@ -25,8 +25,8 @@
#include "WKURL.h"
#include "KURLWrapper.h"
#include "WKAPICast.h"
#include <WebCore/StringImpl.h>
WKURLRef WKURLRetain(WKURLRef URLRef)
{
......
......@@ -25,8 +25,8 @@
#include "WKURLCF.h"
#include "KURLWrapper.h"
#include "WKAPICast.h"
#include <WebCore/PlatformString.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
......@@ -35,12 +35,11 @@ using namespace WebKit;
WKURLRef WKURLCreateWithCFURL(CFURLRef cfURL)
{
RefPtr<KURLWrapper> url = KURLWrapper::create(KURL(cfURL));
return toRef(url.release().releaseRef());
return toURLRef(String(CFURLGetString(cfURL)).impl());
}
CFURLRef WKURLCopyCFURL(CFAllocatorRef /*allocatorRef*/, WKURLRef URLRef)
{
// FIXME: Honor the allocator parameter.
return toWK(URLRef)->url().createCFURL();
return CFURLCreateWithBytes(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(toWK(URLRef)->characters()), toWK(URLRef)->length(), kCFStringEncodingUTF16, 0);
}
......@@ -60,11 +60,11 @@ bool WebFrameProxy::isMainFrame() const
return this == m_page->mainFrame();
}
void WebFrameProxy::didStartProvisionalLoad(const KURL& url)
void WebFrameProxy::didStartProvisionalLoad(const String& url)
{
// FIXME: Add assertions.
m_loadState = LoadStateProvisional;
m_provisionalURL = KURLWrapper::create(url);
m_provisionalURL = url;
}
void WebFrameProxy::didCommitLoad()
......@@ -72,7 +72,7 @@ void WebFrameProxy::didCommitLoad()
// FIXME: Add assertions.
m_loadState = LoadStateCommitted;
m_url = m_provisionalURL;
m_provisionalURL = 0;
m_provisionalURL = String();
}
void WebFrameProxy::didFinishLoad()
......
......@@ -26,9 +26,9 @@
#ifndef WebFrameProxy_h
#define WebFrameProxy_h
#include "KURLWrapper.h"
#include "WebFramePolicyListenerProxy.h"
#include <WebCore/FrameLoaderTypes.h>
#include <WebCore/PlatformString.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
......@@ -67,10 +67,10 @@ public:
bool isMainFrame() const;
LoadState loadState() const { return m_loadState; }
KURLWrapper* url() const { return m_url.get(); }
KURLWrapper* provisionalURL() const { return m_provisionalURL.get(); }
const WebCore::String& url() const { return m_url; }
const WebCore::String& provisionalURL() const { return m_provisionalURL; }
void didStartProvisionalLoad(const WebCore::KURL& url);
void didStartProvisionalLoad(const WebCore::String& url);
void didCommitLoad();
void didFinishLoad();
void didReceiveTitle(const WebCore::String&);
......@@ -83,8 +83,8 @@ private:
WebPageProxy* m_page;
LoadState m_loadState;
RefPtr<KURLWrapper> m_url;
RefPtr<KURLWrapper> m_provisionalURL;
WebCore::String m_url;
WebCore::String m_provisionalURL;
RefPtr<WebFramePolicyListenerProxy> m_policyListener;
uint64_t m_frameID;
};
......
......@@ -38,7 +38,6 @@
#include "WebProcessManager.h"
#include "WebProcessMessageKinds.h"
#include "WebProcessProxy.h"
#include <WebCore/KURL.h>
#ifndef NDEBUG
#include <wtf/RefCountedLeakCounter.h>
......@@ -178,7 +177,7 @@ bool WebPageProxy::tryClose()
return false;
}
void WebPageProxy::loadURL(const KURL& url)
void WebPageProxy::loadURL(const String& url)
{
if (!isValid()) {
puts("loadURL called with a dead WebProcess");
......@@ -320,7 +319,7 @@ void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::M
}
case WebPageProxyMessage::DidStartProvisionalLoadForFrame: {
uint64_t frameID;
KURL url;
String url;
if (!arguments.decode(CoreIPC::Out(frameID, url)))
return;
didStartProvisionalLoadForFrame(webFrame(frameID), url);
......@@ -428,7 +427,7 @@ void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::M
case WebPageProxyMessage::DecidePolicyForNavigationAction: {
uint64_t frameID;
uint32_t navigationType;
KURL url;
String url;
uint64_t listenerID;
if (!arguments.decode(CoreIPC::Out(frameID, navigationType, url, listenerID)))
return;
......@@ -438,7 +437,7 @@ void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::M
case WebPageProxyMessage::DecidePolicyForNewWindowAction: {
uint64_t frameID;
uint32_t navigationType;
KURL url;
String url;
uint64_t listenerID;
if (!arguments.decode(CoreIPC::Out(frameID, navigationType, url, listenerID)))
return;
......@@ -448,7 +447,7 @@ void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::M
case WebPageProxyMessage::DecidePolicyForMIMEType: {
uint64_t frameID;
String MIMEType;
KURL url;
String url;
uint64_t listenerID;
if (!arguments.decode(CoreIPC::Out(frameID, MIMEType, url, listenerID)))
return;
......@@ -548,7 +547,7 @@ void WebPageProxy::didFinishProgress()
m_loaderClient.didFinishProgress(this);
}
void WebPageProxy::didStartProvisionalLoadForFrame(WebFrameProxy* frame, const KURL& url)
void WebPageProxy::didStartProvisionalLoadForFrame(WebFrameProxy* frame, const String& url)
{
frame->didStartProvisionalLoad(url);
m_loaderClient.didStartProvisionalLoadForFrame(this, frame);
......@@ -604,21 +603,21 @@ void WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame(WebFrameProxy* frame)
// PolicyClient
void WebPageProxy::decidePolicyForNavigationAction(WebFrameProxy* frame, uint32_t navigationType, const KURL& url, uint64_t listenerID)
void WebPageProxy::decidePolicyForNavigationAction(WebFrameProxy* frame, uint32_t navigationType, const String& url, uint64_t listenerID)
{
RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
if (!m_policyClient.decidePolicyForNavigationAction(this, navigationType, url, frame, listener.get()))
listener->use();
}
void WebPageProxy::decidePolicyForNewWindowAction(WebFrameProxy* frame, uint32_t navigationType, const KURL& url, uint64_t listenerID)
void WebPageProxy::decidePolicyForNewWindowAction(WebFrameProxy* frame, uint32_t navigationType, const String& url, uint64_t listenerID)
{
RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
if (!m_policyClient.decidePolicyForNewWindowAction(this, navigationType, url, frame, listener.get()))
listener->use();
}
void WebPageProxy::decidePolicyForMIMEType(WebFrameProxy* frame, const String& MIMEType, const KURL& url, uint64_t listenerID)
void WebPageProxy::decidePolicyForMIMEType(WebFrameProxy* frame, const String& MIMEType, const String& url, uint64_t listenerID)
{
RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
if (!m_policyClient.decidePolicyForMIMEType(this, MIMEType, url, frame, listener.get()))
......@@ -703,7 +702,7 @@ void WebPageProxy::processDidExit()
{
ASSERT(m_pageClient);
m_urlAtProcessExit = m_mainFrame->url()->url();
m_urlAtProcessExit = m_mainFrame->url();
Vector<RefPtr<WebFrameProxy> > frame;
copyValuesToVector(m_frameMap, frame);
......
......@@ -34,7 +34,6 @@
#include "WebPolicyClient.h"
#include "WebUIClient.h"
#include <WebCore/FrameLoaderTypes.h>
#include <WebCore/KURL.h>
#include <WebCore/PlatformString.h>
#include <wtf/HashMap.h>
#include <wtf/OwnPtr.h>
......@@ -51,7 +50,6 @@ namespace CoreIPC {
namespace WebCore {
class IntSize;
class KURL;
}
namespace WebKit {
......@@ -90,7 +88,7 @@ public:
bool tryClose();
bool isClosed() const { return m_closed; }
void loadURL(const WebCore::KURL&);
void loadURL(const WebCore::String&);
void stopLoading();
void reload();
......@@ -129,7 +127,7 @@ public:
bool isValid();
// REMOVE: For demo purposes only.
const WebCore::KURL& urlAtProcessExit() const { return m_urlAtProcessExit; }
const WebCore::String& urlAtProcessExit() const { return m_urlAtProcessExit; }
void preferencesDidChange();
......@@ -139,7 +137,7 @@ private:
void didCreateMainFrame(uint64_t frameID);
void didCreateSubFrame(uint64_t frameID);
void didStartProvisionalLoadForFrame(WebFrameProxy*, const WebCore::KURL&);
void didStartProvisionalLoadForFrame(WebFrameProxy*, const WebCore::String&);
void didReceiveServerRedirectForProvisionalLoadForFrame(WebFrameProxy*);
void didFailProvisionalLoadForFrame(WebFrameProxy*);
void didCommitLoadForFrame(WebFrameProxy*);
......@@ -152,9 +150,9 @@ private:
void didChangeProgress(double);
void didFinishProgress();
void decidePolicyForNavigationAction(WebFrameProxy*, uint32_t navigationType, const WebCore::KURL& url, uint64_t listenerID);
void decidePolicyForNewWindowAction(WebFrameProxy*, uint32_t navigationType, const WebCore::KURL& url, uint64_t listenerID);
void decidePolicyForMIMEType(WebFrameProxy*, const WebCore::String& MIMEType, const WebCore::KURL& url, uint64_t listenerID);
void decidePolicyForNavigationAction(WebFrameProxy*, uint32_t navigationType, const WebCore::String& url, uint64_t listenerID);
void decidePolicyForNewWindowAction(WebFrameProxy*, uint32_t navigationType, const WebCore::String& url, uint64_t listenerID);
void decidePolicyForMIMEType(WebFrameProxy*, const WebCore::String& MIMEType, const WebCore::String& url, uint64_t listenerID);
WebPageProxy* createNewPage();
void showPage();
......@@ -188,7 +186,7 @@ private:
WebCore::String m_toolTip;
// REMOVE: For demo purposes only.
WebCore::KURL m_urlAtProcessExit;
WebCore::String m_urlAtProcessExit;
bool m_valid;
bool m_closed;
......
......@@ -25,7 +25,6 @@
#include "WebPolicyClient.h"
#include "KURLWrapper.h"
#include "WKAPICast.h"
#include <WebCore/PlatformString.h>
......@@ -46,33 +45,30 @@ void WebPolicyClient::initialize(WKPagePolicyClient* client)
memset(&m_pagePolicyClient, 0, sizeof(m_pagePolicyClient));
}
bool WebPolicyClient::decidePolicyForNavigationAction(WebPageProxy* page, uint32_t navigationAction, const KURL& url, WebFrameProxy* frame, WebFramePolicyListenerProxy* listener)
bool WebPolicyClient::decidePolicyForNavigationAction(WebPageProxy* page, uint32_t navigationAction, const String& url, WebFrameProxy* frame, WebFramePolicyListenerProxy* listener)
{
if (!m_pagePolicyClient.decidePolicyForNavigationAction)
return false;
RefPtr<KURLWrapper> urlWrapper = KURLWrapper::create(url);
m_pagePolicyClient.decidePolicyForNavigationAction(toRef(page), navigationAction, toRef(urlWrapper.get()), toRef(frame), toRef(listener), m_pagePolicyClient.clientInfo);
m_pagePolicyClient.decidePolicyForNavigationAction(toRef(page), navigationAction, toURLRef(url.impl()), toRef(frame), toRef(listener), m_pagePolicyClient.clientInfo);
return true;
}
bool WebPolicyClient::decidePolicyForNewWindowAction(WebPageProxy* page, uint32_t navigationAction, const KURL& url, WebFrameProxy* frame, WebFramePolicyListenerProxy* listener)
bool WebPolicyClient::decidePolicyForNewWindowAction(WebPageProxy* page, uint32_t navigationAction, const String& url, WebFrameProxy* frame, WebFramePolicyListenerProxy* listener)
{
if (!m_pagePolicyClient.decidePolicyForNewWindowAction)
return false;
RefPtr<KURLWrapper> urlWrapper = KURLWrapper::create(url);
m_pagePolicyClient.decidePolicyForNewWindowAction(toRef(page), navigationAction, toRef(urlWrapper.get()), toRef(frame), toRef(listener), m_pagePolicyClient.clientInfo);
m_pagePolicyClient.decidePolicyForNewWindowAction(toRef(page), navigationAction, toURLRef(url.impl()), toRef(frame), toRef(listener), m_pagePolicyClient.clientInfo);
return true;
}
bool WebPolicyClient::decidePolicyForMIMEType(WebPageProxy* page, const String& MIMEType, const KURL& url, WebFrameProxy* frame, WebFramePolicyListenerProxy* listener)
bool WebPolicyClient::decidePolicyForMIMEType(WebPageProxy* page, const String& MIMEType, const String& url, WebFrameProxy* frame, WebFramePolicyListenerProxy* listener)
{
if (!m_pagePolicyClient.decidePolicyForMIMEType)
return false;
RefPtr<KURLWrapper> urlWrapper = KURLWrapper::create(url);
m_pagePolicyClient.decidePolicyForMIMEType(toRef(page), toRef(MIMEType.impl()), toRef(urlWrapper.get()), toRef(frame), toRef(listener), m_pagePolicyClient.clientInfo);
m_pagePolicyClient.decidePolicyForMIMEType(toRef(page), toRef(MIMEType.impl()), toURLRef(url.impl()), toRef(frame), toRef(listener), m_pagePolicyClient.clientInfo);
return true;
}
......
......@@ -30,7 +30,6 @@
namespace WebCore {
class String;
class KURL;
}
namespace WebKit {
......@@ -44,9 +43,9 @@ public:
WebPolicyClient();
void initialize(WKPagePolicyClient*);
bool decidePolicyForNavigationAction(WebPageProxy*, uint32_t, const WebCore::KURL& url, WebFrameProxy*, WebFramePolicyListenerProxy*);
bool decidePolicyForNewWindowAction(WebPageProxy*, uint32_t, const WebCore::KURL& url, WebFrameProxy*, WebFramePolicyListenerProxy*);
bool decidePolicyForMIMEType(WebPageProxy*, const WebCore::String&, const WebCore::KURL& url, WebFrameProxy*, WebFramePolicyListenerProxy*);
bool decidePolicyForNavigationAction(WebPageProxy*, uint32_t, const WebCore::String& url, WebFrameProxy*, WebFramePolicyListenerProxy*);
bool decidePolicyForNewWindowAction(WebPageProxy*, uint32_t, const WebCore::String& url, WebFrameProxy*, WebFramePolicyListenerProxy*);
bool decidePolicyForMIMEType(WebPageProxy*, const WebCore::String&, const WebCore::String& url, WebFrameProxy*, WebFramePolicyListenerProxy*);
private:
WKPagePolicyClient m_pagePolicyClient;
......
......@@ -95,7 +95,6 @@
BC20EBB1116EEB0800094A50 /* WKString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC20EBAF116EEB0800094A50 /* WKString.cpp */; };
BC20EBB4116EEF7A00094A50 /* WKURL.h in Headers */ = {isa = PBXBuildFile; fileRef = BC20EBB2116EEF7A00094A50 /* WKURL.h */; settings = {ATTRIBUTES = (Public, ); }; };
BC20EBB5116EEF7A00094A50 /* WKURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC20EBB3116EEF7A00094A50 /* WKURL.cpp */; };
BC20EBC7116EF10500094A50 /* KURLWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = BC20EBC5116EF10500094A50 /* KURLWrapper.h */; };
BC20EC06116EF7FF00094A50 /* WKStringCF.h in Headers */ = {isa = PBXBuildFile; fileRef = BC20EC04116EF7FF00094A50 /* WKStringCF.h */; settings = {ATTRIBUTES = (Public, ); }; };
BC20EC07116EF7FF00094A50 /* WKStringCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC20EC05116EF7FF00094A50 /* WKStringCF.cpp */; };
BC20ED66116F971100094A50 /* WKURLCF.h in Headers */ = {isa = PBXBuildFile; fileRef = BC20ED64116F971100094A50 /* WKURLCF.h */; settings = {ATTRIBUTES = (Public, ); }; };
......@@ -285,7 +284,6 @@
BC20EBAF116EEB0800094A50 /* WKString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKString.cpp; sourceTree = "<group>"; };
BC20EBB2116EEF7A00094A50 /* WKURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKURL.h; sourceTree = "<group>"; };
BC20EBB3116EEF7A00094A50 /* WKURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKURL.cpp; sourceTree = "<group>"; };
BC20EBC5116EF10500094A50 /* KURLWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KURLWrapper.h; sourceTree = "<group>"; };
BC20EC04116EF7FF00094A50 /* WKStringCF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKStringCF.h; sourceTree = "<group>"; };
BC20EC05116EF7FF00094A50 /* WKStringCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKStringCF.cpp; sourceTree = "<group>"; };
BC20ED64116F971100094A50 /* WKURLCF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKURLCF.h; sourceTree = "<group>"; };
......@@ -482,7 +480,6 @@
children = (
BC111B5F112F635E00337BAB /* CoreIPCSupport */,
BC111B5A112F628200337BAB /* mac */,
BC20EBC5116EF10500094A50 /* KURLWrapper.h */,
BCC57161115ADB42001CCAF9 /* NotImplemented.h */,
BC1DD7B1114DC396005ADAF3 /* WebCoreTypeArgumentMarshalling.h */,
BC032DAF10F4380F0058C15A /* WebEvent.h */,
......@@ -876,7 +873,6 @@
BCB63478116BF10600603215 /* WebKit2.h in Headers */,
BC20EBB0116EEB0800094A50 /* WKString.h in Headers */,
BC20EBB4116EEF7A00094A50 /* WKURL.h in Headers */,
BC20EBC7116EF10500094A50 /* KURLWrapper.h in Headers */,
BC20EC06116EF7FF00094A50 /* WKStringCF.h in Headers */,
BC20ED66116F971100094A50 /* WKURLCF.h in Headers */,
BC131BC911726C2800B69727 /* CoreIPCMessageKinds.h in Headers */,
......
......@@ -216,7 +216,7 @@ void WebFrameLoaderClient::dispatchDidStartProvisionalLoad()
return;
DocumentLoader* provisionalLoader = m_frame->coreFrame()->loader()->provisionalDocumentLoader();
const KURL& url = provisionalLoader->url();
const String& url = provisionalLoader->url().string();
WebProcess::shared().connection()->send(WebPageProxyMessage::DidStartProvisionalLoadForFrame, webPage->pageID(), CoreIPC::In(m_frame->frameID(), url));
}
......@@ -319,7 +319,7 @@ void WebFrameLoaderClient::dispatchDecidePolicyForMIMEType(FramePolicyFunction f
return;
uint64_t listenerID = m_frame->setUpPolicyListener(function);
KURL url = request.url(); // FIXME: Pass entire request.
const String& url = request.url().string(); // FIXME: Pass entire request.
WebProcess::shared().connection()->send(WebPageProxyMessage::DecidePolicyForMIMEType, webPage->pageID(),
CoreIPC::In(m_frame->frameID(), MIMEType, url, listenerID));
......@@ -335,7 +335,7 @@ void WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction(FramePolicyFun
// FIXME: Pass more than just the navigation action type.
// FIXME: Pass the frame name.
KURL url = request.url(); // FIXME: Pass entire request.
const String& url = request.url().string(); // FIXME: Pass entire request.
WebProcess::shared().connection()->send(WebPageProxyMessage::DecidePolicyForNewWindowAction, webPage->pageID(),
CoreIPC::In(m_frame->frameID(), (uint32_t)navigationAction.type(), url, listenerID));
......@@ -350,7 +350,7 @@ void WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(FramePolicyFu
uint64_t listenerID = m_frame->setUpPolicyListener(function);
// FIXME: Pass more than just the navigation action type.