Changeset 57352 in webkit


Ignore:
Timestamp:
Apr 9, 2010 1:08:38 PM (14 years ago)
Author:
weinig@apple.com
Message:

Fix for https://bugs.webkit.org/show_bug.cgi?id=37347
Don't use CF types in the new C API

Reviewed by Anders Carlsson.

Replace all uses of CF types in the C API.

  • Replace CFStringRef with WKStringRef.
  • Replace CFURLRef with WKURLRef.
  • WebKit2.xcodeproj/project.pbxproj: Add new files.
  • Shared/KURLWrapper.h: Added. RefCounted wrapper around KURL.
  • UIProcess/API/C/WKAPICast.h: Add new conversions.
  • UIProcess/API/C/WKBase.h: Add new types.
  • UIProcess/API/C/WKFrame.cpp:
  • UIProcess/API/C/WKFrame.h:
  • UIProcess/API/C/WKPage.cpp:
  • UIProcess/API/C/WKPage.h:

Replace uses of CF types with WK equivalents.

  • UIProcess/API/C/WKString.cpp: Added.
  • UIProcess/API/C/WKString.h: Added.

Represents a WebCore::StringImpl*.

  • UIProcess/API/C/WKURL.cpp: Added.
  • UIProcess/API/C/WKURL.h: Added.

Represents a WebKit::KURLWrapper*.

  • UIProcess/API/C/cf: Added.
  • UIProcess/API/C/cf/WKStringCF.cpp: Added.
  • UIProcess/API/C/cf/WKStringCF.h: Added.
  • UIProcess/API/C/cf/WKURLCF.cpp: Added.
  • UIProcess/API/C/cf/WKURLCF.h: Added.

CoreFoundation conversion files. Allows converting

WKStringRef <-> CFStringRef
WKURLRef <-> CFURLRef

  • UIProcess/ScriptReturnValueCallback.cpp:

(WebKit::ScriptReturnValueCallback::performCallbackWithReturnValue):

  • UIProcess/ScriptReturnValueCallback.h:
  • UIProcess/WebFrameProxy.cpp:

(WebKit::WebFrameProxy::didStartProvisionalLoad):
(WebKit::WebFrameProxy::didCommitLoad):

  • UIProcess/WebFrameProxy.h:

(WebKit::WebFrameProxy::url):
(WebKit::WebFrameProxy::provisionalURL):

  • UIProcess/WebLoaderClient.cpp:

(WebKit::WebLoaderClient::didReceiveTitleForFrame):

  • UIProcess/WebLoaderClient.h:
  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::didReceiveTitleForFrame):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForMIMEType):
(WebKit::WebPageProxy::runJavaScriptAlert):
(WebKit::WebPageProxy::didRunJavaScriptInMainFrame):
(WebKit::WebPageProxy::processDidExit):

  • UIProcess/WebPageProxy.h:

(WebKit::WebPageProxy::pageTitle):
(WebKit::WebPageProxy::urlAtProcessExit):

  • UIProcess/WebPolicyClient.cpp:

(WebKit::WebPolicyClient::decidePolicyForNavigationAction):
(WebKit::WebPolicyClient::decidePolicyForNewWindowAction):
(WebKit::WebPolicyClient::decidePolicyForMIMEType):

  • UIProcess/WebPolicyClient.h:
  • UIProcess/WebUIClient.cpp:

(WebKit::WebUIClient::runJavaScriptAlert):

  • UIProcess/WebUIClient.h:

Don't use CF types internally at all.

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::frameLoaderDestroyed):
Fix typo.

Location:
trunk/WebKit2
Files:
10 added
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r57311 r57352  
     12010-04-09  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Fix for https://bugs.webkit.org/show_bug.cgi?id=37347
     6        Don't use CF types in the new C API
     7
     8        Replace all uses of CF types in the C API.
     9        - Replace CFStringRef with WKStringRef.
     10        - Replace CFURLRef with WKURLRef.
     11
     12        * WebKit2.xcodeproj/project.pbxproj: Add new files.
     13
     14        * Shared/KURLWrapper.h: Added. RefCounted wrapper around KURL.
     15        * UIProcess/API/C/WKAPICast.h: Add new conversions.
     16        * UIProcess/API/C/WKBase.h: Add new types.
     17        * UIProcess/API/C/WKFrame.cpp:
     18        * UIProcess/API/C/WKFrame.h:
     19        * UIProcess/API/C/WKPage.cpp:
     20        * UIProcess/API/C/WKPage.h:
     21        Replace uses of CF types with WK equivalents.
     22
     23        * UIProcess/API/C/WKString.cpp: Added.
     24        * UIProcess/API/C/WKString.h: Added.
     25        Represents a WebCore::StringImpl*.
     26
     27        * UIProcess/API/C/WKURL.cpp: Added.
     28        * UIProcess/API/C/WKURL.h: Added.
     29        Represents a WebKit::KURLWrapper*.
     30
     31        * UIProcess/API/C/cf: Added.
     32        * UIProcess/API/C/cf/WKStringCF.cpp: Added.
     33        * UIProcess/API/C/cf/WKStringCF.h: Added.
     34        * UIProcess/API/C/cf/WKURLCF.cpp: Added.
     35        * UIProcess/API/C/cf/WKURLCF.h: Added.
     36        CoreFoundation conversion files. Allows converting
     37         WKStringRef <-> CFStringRef
     38         WKURLRef <-> CFURLRef
     39
     40        * UIProcess/ScriptReturnValueCallback.cpp:
     41        (WebKit::ScriptReturnValueCallback::performCallbackWithReturnValue):
     42        * UIProcess/ScriptReturnValueCallback.h:
     43        * UIProcess/WebFrameProxy.cpp:
     44        (WebKit::WebFrameProxy::didStartProvisionalLoad):
     45        (WebKit::WebFrameProxy::didCommitLoad):
     46        * UIProcess/WebFrameProxy.h:
     47        (WebKit::WebFrameProxy::url):
     48        (WebKit::WebFrameProxy::provisionalURL):
     49        * UIProcess/WebLoaderClient.cpp:
     50        (WebKit::WebLoaderClient::didReceiveTitleForFrame):
     51        * UIProcess/WebLoaderClient.h:
     52        * UIProcess/WebPageProxy.cpp:
     53        (WebKit::WebPageProxy::close):
     54        (WebKit::WebPageProxy::didReceiveTitleForFrame):
     55        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
     56        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
     57        (WebKit::WebPageProxy::decidePolicyForMIMEType):
     58        (WebKit::WebPageProxy::runJavaScriptAlert):
     59        (WebKit::WebPageProxy::didRunJavaScriptInMainFrame):
     60        (WebKit::WebPageProxy::processDidExit):
     61        * UIProcess/WebPageProxy.h:
     62        (WebKit::WebPageProxy::pageTitle):
     63        (WebKit::WebPageProxy::urlAtProcessExit):
     64        * UIProcess/WebPolicyClient.cpp:
     65        (WebKit::WebPolicyClient::decidePolicyForNavigationAction):
     66        (WebKit::WebPolicyClient::decidePolicyForNewWindowAction):
     67        (WebKit::WebPolicyClient::decidePolicyForMIMEType):
     68        * UIProcess/WebPolicyClient.h:
     69        * UIProcess/WebUIClient.cpp:
     70        (WebKit::WebUIClient::runJavaScriptAlert):
     71        * UIProcess/WebUIClient.h:
     72        Don't use CF types internally at all.
     73
     74        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     75        (WebKit::WebFrameLoaderClient::frameLoaderDestroyed):
     76        Fix typo.
     77
    1782010-04-08  Sam Weinig  <sam@webkit.org>
    279
  • trunk/WebKit2/UIProcess/API/C/WKAPICast.h

    r57310 r57352  
    3333#endif
    3434
     35namespace WebCore {
     36    class StringImpl;
     37}
     38
    3539namespace WebKit {
    3640    class WebContext;
     
    4044    class WebPageProxy;
    4145    class WebPreferences;
     46    class KURLWrapper;
    4247}
    4348
     
    104109}
    105110
     111inline WebCore::StringImpl* toWK(WKStringRef s)
     112{
     113    return reinterpret_cast<WebCore::StringImpl*>(s);
     114}
     115
     116inline WKStringRef toRef(WebCore::StringImpl* s)
     117{
     118    return reinterpret_cast<WKStringRef>(s);
     119}
     120
     121inline WebKit::KURLWrapper* toWK(WKURLRef u)
     122{
     123    return reinterpret_cast<WebKit::KURLWrapper*>(u);
     124}
     125
     126inline WKURLRef toRef(WebKit::KURLWrapper* u)
     127{
     128    return reinterpret_cast<WKURLRef>(u);
     129}
     130
    106131#endif // WKAPICast_h
  • trunk/WebKit2/UIProcess/API/C/WKBase.h

    r57310 r57352  
    3737typedef struct OpaqueWKFramePolicyListener* WKFramePolicyListenerRef;
    3838typedef struct OpaqueWKPreferencesRef* WKPreferencesRef;
     39typedef struct OpaqueWKStringRef* WKStringRef;
     40typedef struct OpaqueWKURLRef* WKURLRef;
    3941
    4042#define WK_EXPORT
  • trunk/WebKit2/UIProcess/API/C/WKFrame.cpp

    r57310 r57352  
    5353}
    5454
    55 CFURLRef WKFrameGetProvisionalURL(WKFrameRef frameRef)
     55WKURLRef WKFrameGetProvisionalURL(WKFrameRef frameRef)
    5656{
    5757    WebFrameProxy* frame = toWK(frameRef);
    58     return frame->provisionalURL();
     58    return toRef(frame->provisionalURL());
    5959}
    6060
    61 CFURLRef WKFrameGetURL(WKFrameRef frameRef)
     61WKURLRef WKFrameGetURL(WKFrameRef frameRef)
    6262{
    6363    WebFrameProxy* frame = toWK(frameRef);
    64     return frame->url();
     64    return toRef(frame->url());
    6565}
    6666
  • trunk/WebKit2/UIProcess/API/C/WKFrame.h

    r57310 r57352  
    4747WK_EXPORT bool WKFrameIsMainFrame(WKFrameRef frame);
    4848WK_EXPORT WKFrameLoadState WKFrameGetFrameLoadState(WKFrameRef frame);
    49 WK_EXPORT CFURLRef WKFrameGetProvisionalURL(WKFrameRef frame);
    50 WK_EXPORT CFURLRef WKFrameGetURL(WKFrameRef frame);
     49WK_EXPORT WKURLRef WKFrameGetProvisionalURL(WKFrameRef frame);
     50WK_EXPORT WKURLRef WKFrameGetURL(WKFrameRef frame);
    5151
    5252WK_EXPORT WKFrameRef WKFrameRetain(WKFrameRef frame);
  • trunk/WebKit2/UIProcess/API/C/WKPage.cpp

    r57310 r57352  
    4040}
    4141
    42 void WKPageLoadURL(WKPageRef pageRef, CFURLRef url)
     42void WKPageLoadURL(WKPageRef pageRef, WKURLRef URLRef)
    4343{
    44     toWK(pageRef)->loadURL(url);
     44    toWK(pageRef)->loadURL(toWK(URLRef)->url());
    4545}
    4646
     
    9090}
    9191
    92 CFStringRef WKPageGetTitle(WKPageRef pageRef)
     92WKStringRef WKPageGetTitle(WKPageRef pageRef)
    9393{
    94     return toWK(pageRef)->pageTitle();
     94    return toRef(toWK(pageRef)->pageTitle().impl());
    9595}
    9696
     
    124124
    125125#if __BLOCKS__
    126 static void callBlockAndRelease(void *context, CFStringRef resultValue)
     126static void callBlockAndRelease(void* context, WKStringRef resultValue)
    127127{
    128     void (^block)(CFStringRef) = (void (^ReturnValueBlockType)(CFStringRef))context;
     128    void (^block)(WKStringRef) = (void (^ReturnValueBlockType)(WKStringRef))context;
    129129    block(resultValue);
    130130    Block_release(block);
    131131}
    132132
    133 static void disposeBlock(void *context)
     133static void disposeBlock(void* context)
    134134{
    135     void (^block)(CFStringRef) = (void (^ReturnValueBlockType)(CFStringRef))context;
     135    void (^block)(WKStringRef) = (void (^ReturnValueBlockType)(WKStringRef))context;
    136136    Block_release(block);
    137137}
    138138
    139 void WKPageRunJavaScriptInMainFrame(WKPageRef pageRef, CFStringRef script, void (^returnValueBlock)(CFStringRef))
     139void WKPageRunJavaScriptInMainFrame(WKPageRef pageRef, WKStringRef scriptRef, void (^returnValueBlock)(WKStringRef))
    140140{
    141     WKPageRunJavaScriptInMainFrame_f(pageRef, script, Block_copy(returnValueBlock), callBlockAndRelease, disposeBlock);
     141    WKPageRunJavaScriptInMainFrame_f(pageRef, scriptRef, Block_copy(returnValueBlock), callBlockAndRelease, disposeBlock);
    142142}
    143143#endif
    144144
    145 void WKPageRunJavaScriptInMainFrame_f(WKPageRef pageRef, CFStringRef script, void *context, void (*returnValueCallback)(void*, CFStringRef), void (*disposeContextCallback)(void*))
     145void WKPageRunJavaScriptInMainFrame_f(WKPageRef pageRef, WKStringRef scriptRef, void* context, void (*returnValueCallback)(void*, WKStringRef), void (*disposeContextCallback)(void*))
    146146{
    147     toWK(pageRef)->runJavaScriptInMainFrame(WebCore::String(script), ScriptReturnValueCallback::create(context, returnValueCallback, disposeContextCallback));
     147    toWK(pageRef)->runJavaScriptInMainFrame(toWK(scriptRef), ScriptReturnValueCallback::create(context, returnValueCallback, disposeContextCallback));
    148148}
    149149
  • trunk/WebKit2/UIProcess/API/C/WKPage.h

    r57310 r57352  
    4545typedef void (*WKPageDidFinishLoadForFrameCallback)(WKPageRef page, WKFrameRef frame, const void *clientInfo);
    4646typedef void (*WKPageDidFailLoadWithErrorForFrameCallback)(WKPageRef page, WKFrameRef frame, const void *clientInfo); // FIXME: Add WKErrorRef.
    47 typedef void (*WKPageDidReceiveTitleForFrameCallback)(WKPageRef page, CFStringRef title, WKFrameRef frame, const void *clientInfo);
     47typedef void (*WKPageDidReceiveTitleForFrameCallback)(WKPageRef page, WKStringRef title, WKFrameRef frame, const void *clientInfo);
    4848typedef void (*WKPageDidFirstLayoutForFrame)(WKPageRef page, WKFrameRef frame, const void *clientInfo);
    4949typedef void (*WKPageDidFirstVisuallyNonEmptyLayoutForFrame)(WKPageRef page, WKFrameRef frame, const void *clientInfo);
     
    8585// Policy Client.
    8686
    87 typedef void (*WKPageDecidePolicyForNavigationActionCallback)(WKPageRef page, uint32_t navigationType, CFURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo);
    88 typedef void (*WKPageDecidePolicyForNewWindowActionCallback)(WKPageRef page, uint32_t navigationType, CFURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo);
    89 typedef void (*WKPageDecidePolicyForMIMETypeCallback)(WKPageRef page, CFStringRef MIMEType, CFURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo);
     87typedef void (*WKPageDecidePolicyForNavigationActionCallback)(WKPageRef page, uint32_t navigationType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo);
     88typedef void (*WKPageDecidePolicyForNewWindowActionCallback)(WKPageRef page, uint32_t navigationType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo);
     89typedef void (*WKPageDecidePolicyForMIMETypeCallback)(WKPageRef page, WKStringRef MIMEType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo);
    9090
    9191struct WKPagePolicyClient {
     
    102102typedef void (*WKPageShowPageCallback)(WKPageRef page, const void *clientInfo);
    103103typedef void (*WKPageCloseCallback)(WKPageRef page, const void *clientInfo);
    104 typedef void (*WKPageRunJavaScriptAlertCallback)(WKPageRef page, CFStringRef alertText, WKFrameRef frame, const void *clientInfo);
     104typedef void (*WKPageRunJavaScriptAlertCallback)(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void *clientInfo);
    105105
    106106struct WKPageUIClient {
     
    116116WK_EXPORT WKPageNamespaceRef WKPageGetPageNamespace(WKPageRef page);
    117117
    118 WK_EXPORT void WKPageLoadURL(WKPageRef page, CFURLRef url);
     118WK_EXPORT void WKPageLoadURL(WKPageRef page, WKURLRef url);
    119119WK_EXPORT void WKPageStopLoading(WKPageRef page);
    120120WK_EXPORT void WKPageReload(WKPageRef page);
     
    129129WK_EXPORT bool WKPageCanGoBack(WKPageRef page);
    130130
    131 WK_EXPORT CFStringRef WKPageGetTitle(WKPageRef page);
     131WK_EXPORT WKStringRef WKPageGetTitle(WKPageRef page);
    132132
    133133WK_EXPORT WKFrameRef WKPageGetMainFrame(WKPageRef page);
     
    140140
    141141#if __BLOCKS__
    142 WK_EXPORT void WKPageRunJavaScriptInMainFrame(WKPageRef page, CFStringRef script, void (^returnValueBlock)(CFStringRef));
     142WK_EXPORT void WKPageRunJavaScriptInMainFrame(WKPageRef page, WKStringRef script, void (^returnValueBlock)(WKStringRef));
    143143#endif
    144 WK_EXPORT void WKPageRunJavaScriptInMainFrame_f(WKPageRef page, CFStringRef script, void *context, void (*returnValueCallback)(void*, CFStringRef), void (*disposeContextCallback)(void*));
     144WK_EXPORT void WKPageRunJavaScriptInMainFrame_f(WKPageRef page, WKStringRef script, void *context, void (*returnValueCallback)(void*, WKStringRef), void (*disposeContextCallback)(void*));
    145145
    146146WK_EXPORT WKPageRef WKPageRetain(WKPageRef page);
  • trunk/WebKit2/UIProcess/ScriptReturnValueCallback.cpp

    r57310 r57352  
    2626#include "ScriptReturnValueCallback.h"
    2727
     28#include "WKAPICast.h"
     29
    2830namespace WebKit {
    2931
     
    4850}
    4951
    50 void ScriptReturnValueCallback::performCallbackWithReturnValue(CFStringRef returnValue)
     52void ScriptReturnValueCallback::performCallbackWithReturnValue(WebCore::StringImpl* returnValue)
    5153{
    5254    ASSERT(m_callback);
    5355
    54     m_callback(m_context, returnValue);
     56    m_callback(m_context, toRef(returnValue));
    5557   
    5658    m_callback = 0;
  • trunk/WebKit2/UIProcess/ScriptReturnValueCallback.h

    r57310 r57352  
    2727#define ScriptReturnValueCallback_h
    2828
     29#include "WKBase.h"
    2930#include <wtf/PassRefPtr.h>
    3031#include <wtf/RefCounted.h>
     32
     33namespace WebCore {
     34    class StringImpl;
     35}
    3136
    3237namespace WebKit {
     
    3439class ScriptReturnValueCallback : public RefCounted<ScriptReturnValueCallback> {
    3540public:
    36     typedef void (*ScriptReturnValueCallbackFunction)(void*, CFStringRef);
     41    typedef void (*ScriptReturnValueCallbackFunction)(void*, WKStringRef);
    3742    typedef void (*ScriptReturnValueCallbackDisposeFunction)(void*);
    3843
     
    4550    uint64_t callbackID() const { return m_callbackID; }
    4651
    47     void performCallbackWithReturnValue(CFStringRef);
     52    void performCallbackWithReturnValue(WebCore::StringImpl*);
    4853
    4954private:
  • trunk/WebKit2/UIProcess/WebFrameProxy.cpp

    r57310 r57352  
    2727
    2828#include "WebPageProxy.h"
    29 #include <WebCore/KURL.h>
    3029#include <WebCore/PlatformString.h>
    3130
     
    6665    // FIXME: Add assertions.
    6766    m_loadState = LoadStateProvisional;
    68 
    69     // FIXME: This is the wrong layer to be converting to CF.
    70     m_provisionalURL.adoptCF(url.createCFURL());
     67    m_provisionalURL = KURLWrapper::create(url);
    7168}
    7269
     
    7572    // FIXME: Add assertions.
    7673    m_loadState = LoadStateCommitted;
    77     m_url = m_provisionalURL.releaseRef();
     74    m_url = m_provisionalURL;
     75    m_provisionalURL = 0;
    7876}
    7977
  • trunk/WebKit2/UIProcess/WebFrameProxy.h

    r57310 r57352  
    2727#define WebFrameProxy_h
    2828
     29#include "KURLWrapper.h"
    2930#include "WebFramePolicyListenerProxy.h"
    3031#include <WebCore/FrameLoaderTypes.h>
    3132#include <wtf/PassRefPtr.h>
    3233#include <wtf/RefCounted.h>
    33 #include <wtf/RetainPtr.h>
    3434
    3535namespace CoreIPC {
     
    4040
    4141namespace WebCore {
    42     class KURL;
    4342    class String;
    4443}
     
    6968    LoadState loadState() const { return m_loadState; }
    7069
    71     CFURLRef url() const { return m_url.get(); }
    72     CFURLRef provisionalURL() const { return m_provisionalURL.get(); }
     70    KURLWrapper* url() const { return m_url.get(); }
     71    KURLWrapper* provisionalURL() const { return m_provisionalURL.get(); }
    7372
    7473    void didStartProvisionalLoad(const WebCore::KURL& url);
     
    8584    WebPageProxy* m_page;
    8685    LoadState m_loadState;
    87     RetainPtr<CFURLRef> m_url;
    88     RetainPtr<CFURLRef> m_provisionalURL;
     86    RefPtr<KURLWrapper> m_url;
     87    RefPtr<KURLWrapper> m_provisionalURL;
    8988    RefPtr<WebFramePolicyListenerProxy> m_policyListener;
    9089    uint64_t m_frameID;
  • trunk/WebKit2/UIProcess/WebLoaderClient.cpp

    r57310 r57352  
    7979}
    8080
    81 void WebLoaderClient::didReceiveTitleForFrame(WebPageProxy* page, CFStringRef title, WebFrameProxy* frame)
     81void WebLoaderClient::didReceiveTitleForFrame(WebPageProxy* page, WebCore::StringImpl* title, WebFrameProxy* frame)
    8282{
    8383    if (m_pageLoaderClient.didReceiveTitleForFrame)
    84         m_pageLoaderClient.didReceiveTitleForFrame(toRef(page), title, toRef(frame), m_pageLoaderClient.clientInfo);
     84        m_pageLoaderClient.didReceiveTitleForFrame(toRef(page), toRef(title), toRef(frame), m_pageLoaderClient.clientInfo);
    8585}
    8686
  • trunk/WebKit2/UIProcess/WebLoaderClient.h

    r57310 r57352  
    2929#include "WKPage.h"
    3030
     31namespace WebCore {
     32    class StringImpl;
     33}
     34
    3135namespace WebKit {
    3236
     
    4549    void didFinishLoadForFrame(WebPageProxy*, WebFrameProxy*);
    4650    void didFailLoadWithErrorForFrame(WebPageProxy*, WebFrameProxy*);
    47     void didReceiveTitleForFrame(WebPageProxy*, CFStringRef, WebFrameProxy*);
     51    void didReceiveTitleForFrame(WebPageProxy*, WebCore::StringImpl*, WebFrameProxy*);
    4852    void didFirstLayoutForFrame(WebPageProxy*, WebFrameProxy*);
    4953    void didFirstVisuallyNonEmptyLayoutForFrame(WebPageProxy*, WebFrameProxy*);
  • trunk/WebKit2/UIProcess/WebPageProxy.cpp

    r57310 r57352  
    150150    m_frameMap.clear();
    151151    m_mainFrame = 0;
    152     m_pageTitle = 0;
     152
     153    m_pageTitle = String();
     154    m_toolTip = String();
     155
    153156    // FIXME: Do something with pending m_scriptReturnValueCallbacks.
    154157    m_canGoForward = false;
     
    583586    frame->didReceiveTitle(title);
    584587
    585     // FIXME: This is the wrong layer to be converting to CF.
    586     RetainPtr<CFStringRef> cfTitle(AdoptCF, title.createCFString());
    587 
    588588    // Cache the title for the main frame in the page.
    589589    if (frame == m_mainFrame)
    590         m_pageTitle = cfTitle.get();
    591 
    592     m_loaderClient.didReceiveTitleForFrame(this, cfTitle.get(), frame);
     590        m_pageTitle = title;
     591
     592    m_loaderClient.didReceiveTitleForFrame(this, title.impl(), frame);
    593593}
    594594
     
    607607void WebPageProxy::decidePolicyForNavigationAction(WebFrameProxy* frame, uint32_t navigationType, const KURL& url, uint64_t listenerID)
    608608{
    609     // FIXME: This is the wrong layer to be converting to CF.
    610     RetainPtr<CFURLRef> cfURL(AdoptCF, url.createCFURL());
    611 
    612609    RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
    613     if (!m_policyClient.decidePolicyForNavigationAction(this, navigationType, cfURL.get(), frame, listener.get()))
     610    if (!m_policyClient.decidePolicyForNavigationAction(this, navigationType, url, frame, listener.get()))
    614611        listener->use();
    615612}
     
    617614void WebPageProxy::decidePolicyForNewWindowAction(WebFrameProxy* frame, uint32_t navigationType, const KURL& url, uint64_t listenerID)
    618615{
    619     // FIXME: This is the wrong layer to be converting to CF.
    620     RetainPtr<CFURLRef> cfURL(AdoptCF, url.createCFURL());
    621 
    622616    RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
    623     if (!m_policyClient.decidePolicyForNewWindowAction(this, navigationType, cfURL.get(), frame, listener.get()))
     617    if (!m_policyClient.decidePolicyForNewWindowAction(this, navigationType, url, frame, listener.get()))
    624618        listener->use();
    625619}
     
    627621void WebPageProxy::decidePolicyForMIMEType(WebFrameProxy* frame, const String& MIMEType, const KURL& url, uint64_t listenerID)
    628622{
    629     // FIXME: This is the wrong layer to be converting to CF.
    630     RetainPtr<CFStringRef> cfMIMEType(AdoptCF, MIMEType.createCFString());
    631     RetainPtr<CFURLRef> cfURL(AdoptCF, url.createCFURL());
    632 
    633623    RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
    634     if (!m_policyClient.decidePolicyForMIMEType(this, cfMIMEType.get(), cfURL.get(), frame, listener.get()))
     624    if (!m_policyClient.decidePolicyForMIMEType(this, MIMEType, url, frame, listener.get()))
    635625        listener->use();
    636626}
     
    654644void WebPageProxy::runJavaScriptAlert(WebFrameProxy* frame, const WebCore::String& alertText)
    655645{
    656     // FIXME: This is the wrong layer to be converting to CF.
    657     RetainPtr<CFStringRef> cfAlertText(AdoptCF, alertText.createCFString());
    658     m_uiClient.runJavaScriptAlert(this, cfAlertText.get(), frame);
    659 }
    660 
     646    m_uiClient.runJavaScriptAlert(this, alertText.impl(), frame);
     647}
    661648
    662649// Other
     
    700687    }
    701688
    702     // FIXME: This is the wrong layer to be converting to CF.
    703     RetainPtr<CFStringRef> cfResultString(AdoptCF, resultString.createCFString());
    704     callback->performCallbackWithReturnValue(cfResultString.get());
     689    callback->performCallbackWithReturnValue(resultString.impl());
    705690}
    706691
     
    719704    ASSERT(m_pageClient);
    720705
    721     m_urlAtProcessExit = m_mainFrame->url();
     706    m_urlAtProcessExit = m_mainFrame->url()->url();
    722707
    723708    Vector<RefPtr<WebFrameProxy> > frame;
     
    727712    m_frameMap.clear();
    728713    m_mainFrame = 0;
    729     m_pageTitle = 0;
     714
     715    m_pageTitle = String();
     716    m_toolTip = String();
     717
    730718    m_canGoForward = false;
    731719    m_canGoBack = false;
  • trunk/WebKit2/UIProcess/WebPageProxy.h

    r57310 r57352  
    3636#include <WebCore/FrameLoaderTypes.h>
    3737#include <WebCore/PlatformString.h>
     38#include <WebCore/KURL.h>
    3839#include <wtf/HashMap.h>
    3940#include <wtf/OwnPtr.h>
     
    4243#include <wtf/RefCounted.h>
    4344#include <wtf/RefPtr.h>
    44 #include <wtf/RetainPtr.h>
    4545
    4646namespace CoreIPC {
     
    107107    void keyEvent(const WebKeyboardEvent&);
    108108
    109     CFStringRef pageTitle() const { return m_pageTitle.get(); }
     109    const WebCore::String& pageTitle() const { return m_pageTitle; }
    110110    const WebCore::String& toolTip() const { return m_toolTip; }
    111111
     
    130130
    131131    // REMOVE: For demo purposes only.
    132     CFURLRef urlAtProcessExit() const { return m_urlAtProcessExit.get(); }
     132    const WebCore::KURL& urlAtProcessExit() const { return m_urlAtProcessExit; }
    133133
    134134    void preferencesDidChange();
     
    179179    RefPtr<WebFrameProxy> m_mainFrame;
    180180    HashMap<uint64_t, RefPtr<WebFrameProxy> > m_frameMap;
    181     RetainPtr<CFStringRef> m_pageTitle;
     181    WebCore::String m_pageTitle;
    182182
    183183    HashMap<uint64_t, RefPtr<ScriptReturnValueCallback> > m_scriptReturnValueCallbacks;
     
    189189
    190190    // REMOVE: For demo purposes only.
    191     RetainPtr<CFURLRef> m_urlAtProcessExit;
     191    WebCore::KURL m_urlAtProcessExit;
    192192   
    193193    bool m_valid;
  • trunk/WebKit2/UIProcess/WebPolicyClient.cpp

    r57310 r57352  
    2727
    2828#include "WKAPICast.h"
     29#include "KURLWrapper.h"
     30#include <WebCore/PlatformString.h>
     31
     32using namespace WebCore;
    2933
    3034namespace WebKit {
     
    4347}
    4448
    45 bool WebPolicyClient::decidePolicyForNavigationAction(WebPageProxy* page, uint32_t navigationAction, CFURLRef url, WebFrameProxy* frame, WebFramePolicyListenerProxy* listener)
     49bool WebPolicyClient::decidePolicyForNavigationAction(WebPageProxy* page, uint32_t navigationAction, const KURL& url, WebFrameProxy* frame, WebFramePolicyListenerProxy* listener)
    4650{
    4751    if (!m_pagePolicyClient.decidePolicyForNavigationAction)
    4852        return false;
    4953
    50     m_pagePolicyClient.decidePolicyForNavigationAction(toRef(page), navigationAction, url, toRef(frame), toRef(listener), m_pagePolicyClient.clientInfo);
     54    RefPtr<KURLWrapper> urlWrapper = KURLWrapper::create(url);
     55    m_pagePolicyClient.decidePolicyForNavigationAction(toRef(page), navigationAction, toRef(urlWrapper.get()), toRef(frame), toRef(listener), m_pagePolicyClient.clientInfo);
    5156    return true;
    5257}
    5358
    54 bool WebPolicyClient::decidePolicyForNewWindowAction(WebPageProxy* page, uint32_t navigationAction, CFURLRef url, WebFrameProxy* frame, WebFramePolicyListenerProxy* listener)
     59bool WebPolicyClient::decidePolicyForNewWindowAction(WebPageProxy* page, uint32_t navigationAction, const KURL& url, WebFrameProxy* frame, WebFramePolicyListenerProxy* listener)
    5560{
    5661    if (!m_pagePolicyClient.decidePolicyForNewWindowAction)
    5762        return false;
    5863
    59     m_pagePolicyClient.decidePolicyForNewWindowAction(toRef(page), navigationAction, url, toRef(frame), toRef(listener), m_pagePolicyClient.clientInfo);
     64    RefPtr<KURLWrapper> urlWrapper = KURLWrapper::create(url);
     65    m_pagePolicyClient.decidePolicyForNewWindowAction(toRef(page), navigationAction, toRef(urlWrapper.get()), toRef(frame), toRef(listener), m_pagePolicyClient.clientInfo);
    6066    return true;
    6167}
    6268
    63 bool WebPolicyClient::decidePolicyForMIMEType(WebPageProxy* page, CFStringRef MIMEType, CFURLRef url, WebFrameProxy* frame, WebFramePolicyListenerProxy* listener)
     69bool WebPolicyClient::decidePolicyForMIMEType(WebPageProxy* page, const String& MIMEType, const KURL& url, WebFrameProxy* frame, WebFramePolicyListenerProxy* listener)
    6470{
    6571    if (!m_pagePolicyClient.decidePolicyForMIMEType)
    6672        return false;
    6773
    68     m_pagePolicyClient.decidePolicyForMIMEType(toRef(page), MIMEType, url, toRef(frame), toRef(listener), m_pagePolicyClient.clientInfo);
     74    RefPtr<KURLWrapper> urlWrapper = KURLWrapper::create(url);
     75    m_pagePolicyClient.decidePolicyForMIMEType(toRef(page), toRef(MIMEType.impl()), toRef(urlWrapper.get()), toRef(frame), toRef(listener), m_pagePolicyClient.clientInfo);
    6976    return true;
    7077}
  • trunk/WebKit2/UIProcess/WebPolicyClient.h

    r57310 r57352  
    2929#include "WKPage.h"
    3030
     31namespace WebCore {
     32    class String;
     33    class KURL;
     34}
     35
    3136namespace WebKit {
    3237
     
    4045    void initialize(WKPagePolicyClient*);
    4146
    42     bool decidePolicyForNavigationAction(WebPageProxy*, uint32_t, CFURLRef, WebFrameProxy*, WebFramePolicyListenerProxy*);
    43     bool decidePolicyForNewWindowAction(WebPageProxy*, uint32_t, CFURLRef, WebFrameProxy*, WebFramePolicyListenerProxy*);
    44     bool decidePolicyForMIMEType(WebPageProxy*, CFStringRef, CFURLRef, WebFrameProxy*, WebFramePolicyListenerProxy*);
     47    bool decidePolicyForNavigationAction(WebPageProxy*, uint32_t, const WebCore::KURL& url, WebFrameProxy*, WebFramePolicyListenerProxy*);
     48    bool decidePolicyForNewWindowAction(WebPageProxy*, uint32_t, const WebCore::KURL& url, WebFrameProxy*, WebFramePolicyListenerProxy*);
     49    bool decidePolicyForMIMEType(WebPageProxy*, const WebCore::String&, const WebCore::KURL& url, WebFrameProxy*, WebFramePolicyListenerProxy*);
    4550
    4651private:
  • trunk/WebKit2/UIProcess/WebUIClient.cpp

    r57310 r57352  
    2727
    2828#include "WKAPICast.h"
     29
     30using namespace WebCore;
    2931
    3032namespace WebKit {
     
    6769}
    6870
    69 void WebUIClient::runJavaScriptAlert(WebPageProxy* page, CFStringRef alertText, WebFrameProxy* frame)
     71void WebUIClient::runJavaScriptAlert(WebPageProxy* page, StringImpl* alertText, WebFrameProxy* frame)
    7072{
    7173    if (!m_pageUIClient.runJavaScriptAlert)
    7274        return;
    7375   
    74     m_pageUIClient.runJavaScriptAlert(toRef(page), alertText, toRef(frame), m_pageUIClient.clientInfo);
     76    m_pageUIClient.runJavaScriptAlert(toRef(page), toRef(alertText), toRef(frame), m_pageUIClient.clientInfo);
    7577}
    7678
  • trunk/WebKit2/UIProcess/WebUIClient.h

    r57310 r57352  
    2929#include "WKPage.h"
    3030
     31namespace WebCore {
     32    class StringImpl;
     33}
     34
    3135namespace WebKit {
    3236
     
    4246    void showPage(WebPageProxy*);
    4347    void close(WebPageProxy*);
    44     void runJavaScriptAlert(WebPageProxy*, CFStringRef, WebFrameProxy*);
     48    void runJavaScriptAlert(WebPageProxy*, WebCore::StringImpl*, WebFrameProxy*);
    4549
    4650private:
  • trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r57311 r57352  
    9494                BC1A7C581136E19C00FB7167 /* WebProcessLauncher.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1A7C571136E19C00FB7167 /* WebProcessLauncher.h */; };
    9595                BC1DD7B2114DC396005ADAF3 /* WebCoreTypeArgumentMarshalling.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1DD7B1114DC396005ADAF3 /* WebCoreTypeArgumentMarshalling.h */; };
     96                BC20EBB0116EEB0800094A50 /* WKString.h in Headers */ = {isa = PBXBuildFile; fileRef = BC20EBAE116EEB0800094A50 /* WKString.h */; settings = {ATTRIBUTES = (Public, ); }; };
     97                BC20EBB1116EEB0800094A50 /* WKString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC20EBAF116EEB0800094A50 /* WKString.cpp */; };
     98                BC20EBB4116EEF7A00094A50 /* WKURL.h in Headers */ = {isa = PBXBuildFile; fileRef = BC20EBB2116EEF7A00094A50 /* WKURL.h */; settings = {ATTRIBUTES = (Public, ); }; };
     99                BC20EBB5116EEF7A00094A50 /* WKURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC20EBB3116EEF7A00094A50 /* WKURL.cpp */; };
     100                BC20EBC7116EF10500094A50 /* KURLWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = BC20EBC5116EF10500094A50 /* KURLWrapper.h */; };
     101                BC20EC06116EF7FF00094A50 /* WKStringCF.h in Headers */ = {isa = PBXBuildFile; fileRef = BC20EC04116EF7FF00094A50 /* WKStringCF.h */; settings = {ATTRIBUTES = (Public, ); }; };
     102                BC20EC07116EF7FF00094A50 /* WKStringCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC20EC05116EF7FF00094A50 /* WKStringCF.cpp */; };
     103                BC20ED66116F971100094A50 /* WKURLCF.h in Headers */ = {isa = PBXBuildFile; fileRef = BC20ED64116F971100094A50 /* WKURLCF.h */; settings = {ATTRIBUTES = (Public, ); }; };
     104                BC20ED67116F971100094A50 /* WKURLCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC20ED65116F971100094A50 /* WKURLCF.cpp */; };
    96105                BC2E6E871141971500A63B1E /* RunLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2E6E771141970C00A63B1E /* RunLoop.cpp */; };
    97106                BC2E6E881141971500A63B1E /* RunLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2E6E781141970C00A63B1E /* RunLoop.h */; };
     
    272281                BC1A7C571136E19C00FB7167 /* WebProcessLauncher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebProcessLauncher.h; sourceTree = "<group>"; };
    273282                BC1DD7B1114DC396005ADAF3 /* WebCoreTypeArgumentMarshalling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreTypeArgumentMarshalling.h; sourceTree = "<group>"; };
     283                BC20EBAE116EEB0800094A50 /* WKString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKString.h; sourceTree = "<group>"; };
     284                BC20EBAF116EEB0800094A50 /* WKString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKString.cpp; sourceTree = "<group>"; };
     285                BC20EBB2116EEF7A00094A50 /* WKURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKURL.h; sourceTree = "<group>"; };
     286                BC20EBB3116EEF7A00094A50 /* WKURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKURL.cpp; sourceTree = "<group>"; };
     287                BC20EBC5116EF10500094A50 /* KURLWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KURLWrapper.h; sourceTree = "<group>"; };
     288                BC20EC04116EF7FF00094A50 /* WKStringCF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKStringCF.h; sourceTree = "<group>"; };
     289                BC20EC05116EF7FF00094A50 /* WKStringCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKStringCF.cpp; sourceTree = "<group>"; };
     290                BC20ED64116F971100094A50 /* WKURLCF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKURLCF.h; sourceTree = "<group>"; };
     291                BC20ED65116F971100094A50 /* WKURLCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKURLCF.cpp; sourceTree = "<group>"; };
    274292                BC2E6E771141970C00A63B1E /* RunLoop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RunLoop.cpp; sourceTree = "<group>"; };
    275293                BC2E6E781141970C00A63B1E /* RunLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RunLoop.h; sourceTree = "<group>"; };
     
    459477                                BC111B5F112F635E00337BAB /* CoreIPCSupport */,
    460478                                BC111B5A112F628200337BAB /* mac */,
     479                                BC20EBC5116EF10500094A50 /* KURLWrapper.h */,
    461480                                BCC57161115ADB42001CCAF9 /* NotImplemented.h */,
    462481                                BC1DD7B1114DC396005ADAF3 /* WebCoreTypeArgumentMarshalling.h */,
     
    593612                        isa = PBXGroup;
    594613                        children = (
     614                                BC20EBD0116EF66700094A50 /* cf */,
    595615                                BCB63477116BF10600603215 /* WebKit2.h */,
    596616                                BC0C376D10F808460076D7CB /* WKAPICast.h */,
     
    608628                                BCD597CF112B56AC00EC8C23 /* WKPreferences.cpp */,
    609629                                BCD597CE112B56AC00EC8C23 /* WKPreferences.h */,
     630                                BC20EBAF116EEB0800094A50 /* WKString.cpp */,
     631                                BC20EBAE116EEB0800094A50 /* WKString.h */,
     632                                BC20EBB3116EEF7A00094A50 /* WKURL.cpp */,
     633                                BC20EBB2116EEF7A00094A50 /* WKURL.h */,
    610634                        );
    611635                        path = C;
     
    688712                        );
    689713                        path = CoreIPCSupport;
     714                        sourceTree = "<group>";
     715                };
     716                BC20EBD0116EF66700094A50 /* cf */ = {
     717                        isa = PBXGroup;
     718                        children = (
     719                                BC20EC05116EF7FF00094A50 /* WKStringCF.cpp */,
     720                                BC20EC04116EF7FF00094A50 /* WKStringCF.h */,
     721                                BC20ED65116F971100094A50 /* WKURLCF.cpp */,
     722                                BC20ED64116F971100094A50 /* WKURLCF.h */,
     723                        );
     724                        path = cf;
    690725                        sourceTree = "<group>";
    691726                };
     
    808843                                BC8699B7116AADAA002A925B /* WKViewInternal.h in Headers */,
    809844                                BCB63478116BF10600603215 /* WebKit2.h in Headers */,
     845                                BC20EBB0116EEB0800094A50 /* WKString.h in Headers */,
     846                                BC20EBB4116EEF7A00094A50 /* WKURL.h in Headers */,
     847                                BC20EBC7116EF10500094A50 /* KURLWrapper.h in Headers */,
     848                                BC20EC06116EF7FF00094A50 /* WKStringCF.h in Headers */,
     849                                BC20ED66116F971100094A50 /* WKURLCF.h in Headers */,
    810850                        );
    811851                        runOnlyForDeploymentPostprocessing = 0;
     
    957997                                BC8452BB1162C96F00CAB9B5 /* DrawingAreaUpdateChunk.cpp in Sources */,
    958998                                BC8699B6116AADAA002A925B /* WKView.mm in Sources */,
     999                                BC20EBB1116EEB0800094A50 /* WKString.cpp in Sources */,
     1000                                BC20EBB5116EEF7A00094A50 /* WKURL.cpp in Sources */,
     1001                                BC20EC07116EF7FF00094A50 /* WKStringCF.cpp in Sources */,
     1002                                BC20ED67116F971100094A50 /* WKURLCF.cpp in Sources */,
    9591003                        );
    9601004                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r57309 r57352  
    5555    m_frame->invalidate();
    5656
    57     // Balences explicit ref() in WebFrame::createMainFrame and WebFrame::createSubframe.
     57    // Balances explicit ref() in WebFrame::createMainFrame and WebFrame::createSubframe.
    5858    m_frame->deref();
    5959}
Note: See TracChangeset for help on using the changeset viewer.