Changeset 57352 in webkit
- Timestamp:
- Apr 9, 2010 1:08:38 PM (14 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 10 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r57311 r57352 1 2010-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 1 78 2010-04-08 Sam Weinig <sam@webkit.org> 2 79 -
trunk/WebKit2/UIProcess/API/C/WKAPICast.h
r57310 r57352 33 33 #endif 34 34 35 namespace WebCore { 36 class StringImpl; 37 } 38 35 39 namespace WebKit { 36 40 class WebContext; … … 40 44 class WebPageProxy; 41 45 class WebPreferences; 46 class KURLWrapper; 42 47 } 43 48 … … 104 109 } 105 110 111 inline WebCore::StringImpl* toWK(WKStringRef s) 112 { 113 return reinterpret_cast<WebCore::StringImpl*>(s); 114 } 115 116 inline WKStringRef toRef(WebCore::StringImpl* s) 117 { 118 return reinterpret_cast<WKStringRef>(s); 119 } 120 121 inline WebKit::KURLWrapper* toWK(WKURLRef u) 122 { 123 return reinterpret_cast<WebKit::KURLWrapper*>(u); 124 } 125 126 inline WKURLRef toRef(WebKit::KURLWrapper* u) 127 { 128 return reinterpret_cast<WKURLRef>(u); 129 } 130 106 131 #endif // WKAPICast_h -
trunk/WebKit2/UIProcess/API/C/WKBase.h
r57310 r57352 37 37 typedef struct OpaqueWKFramePolicyListener* WKFramePolicyListenerRef; 38 38 typedef struct OpaqueWKPreferencesRef* WKPreferencesRef; 39 typedef struct OpaqueWKStringRef* WKStringRef; 40 typedef struct OpaqueWKURLRef* WKURLRef; 39 41 40 42 #define WK_EXPORT -
trunk/WebKit2/UIProcess/API/C/WKFrame.cpp
r57310 r57352 53 53 } 54 54 55 CFURLRef WKFrameGetProvisionalURL(WKFrameRef frameRef)55 WKURLRef WKFrameGetProvisionalURL(WKFrameRef frameRef) 56 56 { 57 57 WebFrameProxy* frame = toWK(frameRef); 58 return frame->provisionalURL();58 return toRef(frame->provisionalURL()); 59 59 } 60 60 61 CFURLRef WKFrameGetURL(WKFrameRef frameRef)61 WKURLRef WKFrameGetURL(WKFrameRef frameRef) 62 62 { 63 63 WebFrameProxy* frame = toWK(frameRef); 64 return frame->url();64 return toRef(frame->url()); 65 65 } 66 66 -
trunk/WebKit2/UIProcess/API/C/WKFrame.h
r57310 r57352 47 47 WK_EXPORT bool WKFrameIsMainFrame(WKFrameRef frame); 48 48 WK_EXPORT WKFrameLoadState WKFrameGetFrameLoadState(WKFrameRef frame); 49 WK_EXPORT CFURLRef WKFrameGetProvisionalURL(WKFrameRef frame);50 WK_EXPORT CFURLRef WKFrameGetURL(WKFrameRef frame);49 WK_EXPORT WKURLRef WKFrameGetProvisionalURL(WKFrameRef frame); 50 WK_EXPORT WKURLRef WKFrameGetURL(WKFrameRef frame); 51 51 52 52 WK_EXPORT WKFrameRef WKFrameRetain(WKFrameRef frame); -
trunk/WebKit2/UIProcess/API/C/WKPage.cpp
r57310 r57352 40 40 } 41 41 42 void WKPageLoadURL(WKPageRef pageRef, CFURLRef url)42 void WKPageLoadURL(WKPageRef pageRef, WKURLRef URLRef) 43 43 { 44 toWK(pageRef)->loadURL( url);44 toWK(pageRef)->loadURL(toWK(URLRef)->url()); 45 45 } 46 46 … … 90 90 } 91 91 92 CFStringRef WKPageGetTitle(WKPageRef pageRef)92 WKStringRef WKPageGetTitle(WKPageRef pageRef) 93 93 { 94 return to WK(pageRef)->pageTitle();94 return toRef(toWK(pageRef)->pageTitle().impl()); 95 95 } 96 96 … … 124 124 125 125 #if __BLOCKS__ 126 static void callBlockAndRelease(void *context, CFStringRef resultValue)126 static void callBlockAndRelease(void* context, WKStringRef resultValue) 127 127 { 128 void (^block)( CFStringRef) = (void (^ReturnValueBlockType)(CFStringRef))context;128 void (^block)(WKStringRef) = (void (^ReturnValueBlockType)(WKStringRef))context; 129 129 block(resultValue); 130 130 Block_release(block); 131 131 } 132 132 133 static void disposeBlock(void *context)133 static void disposeBlock(void* context) 134 134 { 135 void (^block)( CFStringRef) = (void (^ReturnValueBlockType)(CFStringRef))context;135 void (^block)(WKStringRef) = (void (^ReturnValueBlockType)(WKStringRef))context; 136 136 Block_release(block); 137 137 } 138 138 139 void WKPageRunJavaScriptInMainFrame(WKPageRef pageRef, CFStringRef script, void (^returnValueBlock)(CFStringRef))139 void WKPageRunJavaScriptInMainFrame(WKPageRef pageRef, WKStringRef scriptRef, void (^returnValueBlock)(WKStringRef)) 140 140 { 141 WKPageRunJavaScriptInMainFrame_f(pageRef, script , Block_copy(returnValueBlock), callBlockAndRelease, disposeBlock);141 WKPageRunJavaScriptInMainFrame_f(pageRef, scriptRef, Block_copy(returnValueBlock), callBlockAndRelease, disposeBlock); 142 142 } 143 143 #endif 144 144 145 void WKPageRunJavaScriptInMainFrame_f(WKPageRef pageRef, CFStringRef script, void *context, void (*returnValueCallback)(void*, CFStringRef), void (*disposeContextCallback)(void*))145 void WKPageRunJavaScriptInMainFrame_f(WKPageRef pageRef, WKStringRef scriptRef, void* context, void (*returnValueCallback)(void*, WKStringRef), void (*disposeContextCallback)(void*)) 146 146 { 147 toWK(pageRef)->runJavaScriptInMainFrame( WebCore::String(script), ScriptReturnValueCallback::create(context, returnValueCallback, disposeContextCallback));147 toWK(pageRef)->runJavaScriptInMainFrame(toWK(scriptRef), ScriptReturnValueCallback::create(context, returnValueCallback, disposeContextCallback)); 148 148 } 149 149 -
trunk/WebKit2/UIProcess/API/C/WKPage.h
r57310 r57352 45 45 typedef void (*WKPageDidFinishLoadForFrameCallback)(WKPageRef page, WKFrameRef frame, const void *clientInfo); 46 46 typedef 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);47 typedef void (*WKPageDidReceiveTitleForFrameCallback)(WKPageRef page, WKStringRef title, WKFrameRef frame, const void *clientInfo); 48 48 typedef void (*WKPageDidFirstLayoutForFrame)(WKPageRef page, WKFrameRef frame, const void *clientInfo); 49 49 typedef void (*WKPageDidFirstVisuallyNonEmptyLayoutForFrame)(WKPageRef page, WKFrameRef frame, const void *clientInfo); … … 85 85 // Policy Client. 86 86 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);87 typedef void (*WKPageDecidePolicyForNavigationActionCallback)(WKPageRef page, uint32_t navigationType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo); 88 typedef void (*WKPageDecidePolicyForNewWindowActionCallback)(WKPageRef page, uint32_t navigationType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo); 89 typedef void (*WKPageDecidePolicyForMIMETypeCallback)(WKPageRef page, WKStringRef MIMEType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo); 90 90 91 91 struct WKPagePolicyClient { … … 102 102 typedef void (*WKPageShowPageCallback)(WKPageRef page, const void *clientInfo); 103 103 typedef void (*WKPageCloseCallback)(WKPageRef page, const void *clientInfo); 104 typedef void (*WKPageRunJavaScriptAlertCallback)(WKPageRef page, CFStringRef alertText, WKFrameRef frame, const void *clientInfo);104 typedef void (*WKPageRunJavaScriptAlertCallback)(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void *clientInfo); 105 105 106 106 struct WKPageUIClient { … … 116 116 WK_EXPORT WKPageNamespaceRef WKPageGetPageNamespace(WKPageRef page); 117 117 118 WK_EXPORT void WKPageLoadURL(WKPageRef page, CFURLRef url);118 WK_EXPORT void WKPageLoadURL(WKPageRef page, WKURLRef url); 119 119 WK_EXPORT void WKPageStopLoading(WKPageRef page); 120 120 WK_EXPORT void WKPageReload(WKPageRef page); … … 129 129 WK_EXPORT bool WKPageCanGoBack(WKPageRef page); 130 130 131 WK_EXPORT CFStringRef WKPageGetTitle(WKPageRef page);131 WK_EXPORT WKStringRef WKPageGetTitle(WKPageRef page); 132 132 133 133 WK_EXPORT WKFrameRef WKPageGetMainFrame(WKPageRef page); … … 140 140 141 141 #if __BLOCKS__ 142 WK_EXPORT void WKPageRunJavaScriptInMainFrame(WKPageRef page, CFStringRef script, void (^returnValueBlock)(CFStringRef));142 WK_EXPORT void WKPageRunJavaScriptInMainFrame(WKPageRef page, WKStringRef script, void (^returnValueBlock)(WKStringRef)); 143 143 #endif 144 WK_EXPORT void WKPageRunJavaScriptInMainFrame_f(WKPageRef page, CFStringRef script, void *context, void (*returnValueCallback)(void*, CFStringRef), void (*disposeContextCallback)(void*));144 WK_EXPORT void WKPageRunJavaScriptInMainFrame_f(WKPageRef page, WKStringRef script, void *context, void (*returnValueCallback)(void*, WKStringRef), void (*disposeContextCallback)(void*)); 145 145 146 146 WK_EXPORT WKPageRef WKPageRetain(WKPageRef page); -
trunk/WebKit2/UIProcess/ScriptReturnValueCallback.cpp
r57310 r57352 26 26 #include "ScriptReturnValueCallback.h" 27 27 28 #include "WKAPICast.h" 29 28 30 namespace WebKit { 29 31 … … 48 50 } 49 51 50 void ScriptReturnValueCallback::performCallbackWithReturnValue( CFStringRefreturnValue)52 void ScriptReturnValueCallback::performCallbackWithReturnValue(WebCore::StringImpl* returnValue) 51 53 { 52 54 ASSERT(m_callback); 53 55 54 m_callback(m_context, returnValue);56 m_callback(m_context, toRef(returnValue)); 55 57 56 58 m_callback = 0; -
trunk/WebKit2/UIProcess/ScriptReturnValueCallback.h
r57310 r57352 27 27 #define ScriptReturnValueCallback_h 28 28 29 #include "WKBase.h" 29 30 #include <wtf/PassRefPtr.h> 30 31 #include <wtf/RefCounted.h> 32 33 namespace WebCore { 34 class StringImpl; 35 } 31 36 32 37 namespace WebKit { … … 34 39 class ScriptReturnValueCallback : public RefCounted<ScriptReturnValueCallback> { 35 40 public: 36 typedef void (*ScriptReturnValueCallbackFunction)(void*, CFStringRef);41 typedef void (*ScriptReturnValueCallbackFunction)(void*, WKStringRef); 37 42 typedef void (*ScriptReturnValueCallbackDisposeFunction)(void*); 38 43 … … 45 50 uint64_t callbackID() const { return m_callbackID; } 46 51 47 void performCallbackWithReturnValue( CFStringRef);52 void performCallbackWithReturnValue(WebCore::StringImpl*); 48 53 49 54 private: -
trunk/WebKit2/UIProcess/WebFrameProxy.cpp
r57310 r57352 27 27 28 28 #include "WebPageProxy.h" 29 #include <WebCore/KURL.h>30 29 #include <WebCore/PlatformString.h> 31 30 … … 66 65 // FIXME: Add assertions. 67 66 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); 71 68 } 72 69 … … 75 72 // FIXME: Add assertions. 76 73 m_loadState = LoadStateCommitted; 77 m_url = m_provisionalURL.releaseRef(); 74 m_url = m_provisionalURL; 75 m_provisionalURL = 0; 78 76 } 79 77 -
trunk/WebKit2/UIProcess/WebFrameProxy.h
r57310 r57352 27 27 #define WebFrameProxy_h 28 28 29 #include "KURLWrapper.h" 29 30 #include "WebFramePolicyListenerProxy.h" 30 31 #include <WebCore/FrameLoaderTypes.h> 31 32 #include <wtf/PassRefPtr.h> 32 33 #include <wtf/RefCounted.h> 33 #include <wtf/RetainPtr.h>34 34 35 35 namespace CoreIPC { … … 40 40 41 41 namespace WebCore { 42 class KURL;43 42 class String; 44 43 } … … 69 68 LoadState loadState() const { return m_loadState; } 70 69 71 CFURLRefurl() const { return m_url.get(); }72 CFURLRefprovisionalURL() const { return m_provisionalURL.get(); }70 KURLWrapper* url() const { return m_url.get(); } 71 KURLWrapper* provisionalURL() const { return m_provisionalURL.get(); } 73 72 74 73 void didStartProvisionalLoad(const WebCore::KURL& url); … … 85 84 WebPageProxy* m_page; 86 85 LoadState m_loadState; 87 Re tainPtr<CFURLRef> m_url;88 Re tainPtr<CFURLRef> m_provisionalURL;86 RefPtr<KURLWrapper> m_url; 87 RefPtr<KURLWrapper> m_provisionalURL; 89 88 RefPtr<WebFramePolicyListenerProxy> m_policyListener; 90 89 uint64_t m_frameID; -
trunk/WebKit2/UIProcess/WebLoaderClient.cpp
r57310 r57352 79 79 } 80 80 81 void WebLoaderClient::didReceiveTitleForFrame(WebPageProxy* page, CFStringReftitle, WebFrameProxy* frame)81 void WebLoaderClient::didReceiveTitleForFrame(WebPageProxy* page, WebCore::StringImpl* title, WebFrameProxy* frame) 82 82 { 83 83 if (m_pageLoaderClient.didReceiveTitleForFrame) 84 m_pageLoaderClient.didReceiveTitleForFrame(toRef(page), t itle, toRef(frame), m_pageLoaderClient.clientInfo);84 m_pageLoaderClient.didReceiveTitleForFrame(toRef(page), toRef(title), toRef(frame), m_pageLoaderClient.clientInfo); 85 85 } 86 86 -
trunk/WebKit2/UIProcess/WebLoaderClient.h
r57310 r57352 29 29 #include "WKPage.h" 30 30 31 namespace WebCore { 32 class StringImpl; 33 } 34 31 35 namespace WebKit { 32 36 … … 45 49 void didFinishLoadForFrame(WebPageProxy*, WebFrameProxy*); 46 50 void didFailLoadWithErrorForFrame(WebPageProxy*, WebFrameProxy*); 47 void didReceiveTitleForFrame(WebPageProxy*, CFStringRef, WebFrameProxy*);51 void didReceiveTitleForFrame(WebPageProxy*, WebCore::StringImpl*, WebFrameProxy*); 48 52 void didFirstLayoutForFrame(WebPageProxy*, WebFrameProxy*); 49 53 void didFirstVisuallyNonEmptyLayoutForFrame(WebPageProxy*, WebFrameProxy*); -
trunk/WebKit2/UIProcess/WebPageProxy.cpp
r57310 r57352 150 150 m_frameMap.clear(); 151 151 m_mainFrame = 0; 152 m_pageTitle = 0; 152 153 m_pageTitle = String(); 154 m_toolTip = String(); 155 153 156 // FIXME: Do something with pending m_scriptReturnValueCallbacks. 154 157 m_canGoForward = false; … … 583 586 frame->didReceiveTitle(title); 584 587 585 // FIXME: This is the wrong layer to be converting to CF.586 RetainPtr<CFStringRef> cfTitle(AdoptCF, title.createCFString());587 588 588 // Cache the title for the main frame in the page. 589 589 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); 593 593 } 594 594 … … 607 607 void WebPageProxy::decidePolicyForNavigationAction(WebFrameProxy* frame, uint32_t navigationType, const KURL& url, uint64_t listenerID) 608 608 { 609 // FIXME: This is the wrong layer to be converting to CF.610 RetainPtr<CFURLRef> cfURL(AdoptCF, url.createCFURL());611 612 609 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())) 614 611 listener->use(); 615 612 } … … 617 614 void WebPageProxy::decidePolicyForNewWindowAction(WebFrameProxy* frame, uint32_t navigationType, const KURL& url, uint64_t listenerID) 618 615 { 619 // FIXME: This is the wrong layer to be converting to CF.620 RetainPtr<CFURLRef> cfURL(AdoptCF, url.createCFURL());621 622 616 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())) 624 618 listener->use(); 625 619 } … … 627 621 void WebPageProxy::decidePolicyForMIMEType(WebFrameProxy* frame, const String& MIMEType, const KURL& url, uint64_t listenerID) 628 622 { 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 633 623 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())) 635 625 listener->use(); 636 626 } … … 654 644 void WebPageProxy::runJavaScriptAlert(WebFrameProxy* frame, const WebCore::String& alertText) 655 645 { 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 } 661 648 662 649 // Other … … 700 687 } 701 688 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()); 705 690 } 706 691 … … 719 704 ASSERT(m_pageClient); 720 705 721 m_urlAtProcessExit = m_mainFrame->url() ;706 m_urlAtProcessExit = m_mainFrame->url()->url(); 722 707 723 708 Vector<RefPtr<WebFrameProxy> > frame; … … 727 712 m_frameMap.clear(); 728 713 m_mainFrame = 0; 729 m_pageTitle = 0; 714 715 m_pageTitle = String(); 716 m_toolTip = String(); 717 730 718 m_canGoForward = false; 731 719 m_canGoBack = false; -
trunk/WebKit2/UIProcess/WebPageProxy.h
r57310 r57352 36 36 #include <WebCore/FrameLoaderTypes.h> 37 37 #include <WebCore/PlatformString.h> 38 #include <WebCore/KURL.h> 38 39 #include <wtf/HashMap.h> 39 40 #include <wtf/OwnPtr.h> … … 42 43 #include <wtf/RefCounted.h> 43 44 #include <wtf/RefPtr.h> 44 #include <wtf/RetainPtr.h>45 45 46 46 namespace CoreIPC { … … 107 107 void keyEvent(const WebKeyboardEvent&); 108 108 109 CFStringRef pageTitle() const { return m_pageTitle.get(); }109 const WebCore::String& pageTitle() const { return m_pageTitle; } 110 110 const WebCore::String& toolTip() const { return m_toolTip; } 111 111 … … 130 130 131 131 // REMOVE: For demo purposes only. 132 CFURLRef urlAtProcessExit() const { return m_urlAtProcessExit.get(); }132 const WebCore::KURL& urlAtProcessExit() const { return m_urlAtProcessExit; } 133 133 134 134 void preferencesDidChange(); … … 179 179 RefPtr<WebFrameProxy> m_mainFrame; 180 180 HashMap<uint64_t, RefPtr<WebFrameProxy> > m_frameMap; 181 RetainPtr<CFStringRef>m_pageTitle;181 WebCore::String m_pageTitle; 182 182 183 183 HashMap<uint64_t, RefPtr<ScriptReturnValueCallback> > m_scriptReturnValueCallbacks; … … 189 189 190 190 // REMOVE: For demo purposes only. 191 RetainPtr<CFURLRef>m_urlAtProcessExit;191 WebCore::KURL m_urlAtProcessExit; 192 192 193 193 bool m_valid; -
trunk/WebKit2/UIProcess/WebPolicyClient.cpp
r57310 r57352 27 27 28 28 #include "WKAPICast.h" 29 #include "KURLWrapper.h" 30 #include <WebCore/PlatformString.h> 31 32 using namespace WebCore; 29 33 30 34 namespace WebKit { … … 43 47 } 44 48 45 bool WebPolicyClient::decidePolicyForNavigationAction(WebPageProxy* page, uint32_t navigationAction, CFURLRefurl, WebFrameProxy* frame, WebFramePolicyListenerProxy* listener)49 bool WebPolicyClient::decidePolicyForNavigationAction(WebPageProxy* page, uint32_t navigationAction, const KURL& url, WebFrameProxy* frame, WebFramePolicyListenerProxy* listener) 46 50 { 47 51 if (!m_pagePolicyClient.decidePolicyForNavigationAction) 48 52 return false; 49 53 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); 51 56 return true; 52 57 } 53 58 54 bool WebPolicyClient::decidePolicyForNewWindowAction(WebPageProxy* page, uint32_t navigationAction, CFURLRefurl, WebFrameProxy* frame, WebFramePolicyListenerProxy* listener)59 bool WebPolicyClient::decidePolicyForNewWindowAction(WebPageProxy* page, uint32_t navigationAction, const KURL& url, WebFrameProxy* frame, WebFramePolicyListenerProxy* listener) 55 60 { 56 61 if (!m_pagePolicyClient.decidePolicyForNewWindowAction) 57 62 return false; 58 63 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); 60 66 return true; 61 67 } 62 68 63 bool WebPolicyClient::decidePolicyForMIMEType(WebPageProxy* page, CFStringRef MIMEType, CFURLRefurl, WebFrameProxy* frame, WebFramePolicyListenerProxy* listener)69 bool WebPolicyClient::decidePolicyForMIMEType(WebPageProxy* page, const String& MIMEType, const KURL& url, WebFrameProxy* frame, WebFramePolicyListenerProxy* listener) 64 70 { 65 71 if (!m_pagePolicyClient.decidePolicyForMIMEType) 66 72 return false; 67 73 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); 69 76 return true; 70 77 } -
trunk/WebKit2/UIProcess/WebPolicyClient.h
r57310 r57352 29 29 #include "WKPage.h" 30 30 31 namespace WebCore { 32 class String; 33 class KURL; 34 } 35 31 36 namespace WebKit { 32 37 … … 40 45 void initialize(WKPagePolicyClient*); 41 46 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*); 45 50 46 51 private: -
trunk/WebKit2/UIProcess/WebUIClient.cpp
r57310 r57352 27 27 28 28 #include "WKAPICast.h" 29 30 using namespace WebCore; 29 31 30 32 namespace WebKit { … … 67 69 } 68 70 69 void WebUIClient::runJavaScriptAlert(WebPageProxy* page, CFStringRefalertText, WebFrameProxy* frame)71 void WebUIClient::runJavaScriptAlert(WebPageProxy* page, StringImpl* alertText, WebFrameProxy* frame) 70 72 { 71 73 if (!m_pageUIClient.runJavaScriptAlert) 72 74 return; 73 75 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); 75 77 } 76 78 -
trunk/WebKit2/UIProcess/WebUIClient.h
r57310 r57352 29 29 #include "WKPage.h" 30 30 31 namespace WebCore { 32 class StringImpl; 33 } 34 31 35 namespace WebKit { 32 36 … … 42 46 void showPage(WebPageProxy*); 43 47 void close(WebPageProxy*); 44 void runJavaScriptAlert(WebPageProxy*, CFStringRef, WebFrameProxy*);48 void runJavaScriptAlert(WebPageProxy*, WebCore::StringImpl*, WebFrameProxy*); 45 49 46 50 private: -
trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj
r57311 r57352 94 94 BC1A7C581136E19C00FB7167 /* WebProcessLauncher.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1A7C571136E19C00FB7167 /* WebProcessLauncher.h */; }; 95 95 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 */; }; 96 105 BC2E6E871141971500A63B1E /* RunLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2E6E771141970C00A63B1E /* RunLoop.cpp */; }; 97 106 BC2E6E881141971500A63B1E /* RunLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2E6E781141970C00A63B1E /* RunLoop.h */; }; … … 272 281 BC1A7C571136E19C00FB7167 /* WebProcessLauncher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebProcessLauncher.h; sourceTree = "<group>"; }; 273 282 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>"; }; 274 292 BC2E6E771141970C00A63B1E /* RunLoop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RunLoop.cpp; sourceTree = "<group>"; }; 275 293 BC2E6E781141970C00A63B1E /* RunLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RunLoop.h; sourceTree = "<group>"; }; … … 459 477 BC111B5F112F635E00337BAB /* CoreIPCSupport */, 460 478 BC111B5A112F628200337BAB /* mac */, 479 BC20EBC5116EF10500094A50 /* KURLWrapper.h */, 461 480 BCC57161115ADB42001CCAF9 /* NotImplemented.h */, 462 481 BC1DD7B1114DC396005ADAF3 /* WebCoreTypeArgumentMarshalling.h */, … … 593 612 isa = PBXGroup; 594 613 children = ( 614 BC20EBD0116EF66700094A50 /* cf */, 595 615 BCB63477116BF10600603215 /* WebKit2.h */, 596 616 BC0C376D10F808460076D7CB /* WKAPICast.h */, … … 608 628 BCD597CF112B56AC00EC8C23 /* WKPreferences.cpp */, 609 629 BCD597CE112B56AC00EC8C23 /* WKPreferences.h */, 630 BC20EBAF116EEB0800094A50 /* WKString.cpp */, 631 BC20EBAE116EEB0800094A50 /* WKString.h */, 632 BC20EBB3116EEF7A00094A50 /* WKURL.cpp */, 633 BC20EBB2116EEF7A00094A50 /* WKURL.h */, 610 634 ); 611 635 path = C; … … 688 712 ); 689 713 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; 690 725 sourceTree = "<group>"; 691 726 }; … … 808 843 BC8699B7116AADAA002A925B /* WKViewInternal.h in Headers */, 809 844 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 */, 810 850 ); 811 851 runOnlyForDeploymentPostprocessing = 0; … … 957 997 BC8452BB1162C96F00CAB9B5 /* DrawingAreaUpdateChunk.cpp in Sources */, 958 998 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 */, 959 1003 ); 960 1004 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r57309 r57352 55 55 m_frame->invalidate(); 56 56 57 // Bal ences explicit ref() in WebFrame::createMainFrame and WebFrame::createSubframe.57 // Balances explicit ref() in WebFrame::createMainFrame and WebFrame::createSubframe. 58 58 m_frame->deref(); 59 59 }
Note: See TracChangeset
for help on using the changeset viewer.