Changeset 64232 in webkit
- Timestamp:
- Jul 28, 2010 2:42:27 PM (14 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 2 added
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r64231 r64232 1 2010-07-28 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Anders Carlsson. 4 5 Patch for https://bugs.webkit.org/show_bug.cgi?id=43097 6 Make all objects in the WebKit2 API inherit from a single base class 7 8 - Adds an APIObject base class for all objects which can get vender through 9 the C API to inherit from. 10 - Adds a WebString class which wraps WebCore::String for now. I am not too fond of 11 this solution, so we continue should iterate on it. 12 - This is a first step toward make a CF-style base type (eg. CFTypeRef) for the C-API. 13 14 * Shared/APIObject.h: Added. 15 (WebKit::APIObject::APIObject): 16 Base class for API objects. 17 18 * Shared/ImmutableArray.h: 19 Make inherit from APIObject. 20 21 * Shared/WebString.h: Added. 22 (WebKit::WebString::create): 23 (WebKit::WebString::isNull): 24 (WebKit::WebString::isEmpty): 25 (WebKit::WebString::string): 26 (WebKit::WebString::WebString): 27 Wraps a WebCore::String so that it can be passed out to the API 28 and still inherit from APIObject. 29 30 * UIProcess/API/C/WKAPICast.h: 31 (WebKit::WebStringAdaptor::WebStringAdaptor): 32 (WebKit::WebStringAdaptor::operator WKStringRef): 33 (WebKit::WebStringAdaptor::operator WKURLRef): 34 Update conversion methods to deal in terms of WebStrings. Added WebStringAdaptor 35 to ease passing strings to client functions. 36 37 * UIProcess/API/C/WKContext.cpp: 38 (WKContextCreateWithInjectedBundlePath): 39 (WKContextPostMessageToInjectedBundle): 40 (_WKContextSetAdditionalPluginPath): 41 (_WKContextRegisterURLSchemeAsEmptyDocument): 42 Get the WebCore::String from the WebString. 43 44 * UIProcess/API/C/WKPage.cpp: 45 (WKPageLoadURL): 46 Ditto. 47 48 * UIProcess/API/C/WKString.cpp: 49 (WKStringIsEmpty): 50 Implement in terms of WebString. 51 52 * UIProcess/API/C/WKURL.cpp: 53 * UIProcess/API/C/cf/WKStringCF.cpp: 54 (WKStringCreateWithCFString): 55 (WKStringCopyCFString): 56 Ditto. 57 58 * UIProcess/API/C/cf/WKURLCF.cpp: 59 (WKURLCreateWithCFURL): 60 (WKURLCopyCFURL): 61 Ditto. 62 63 * UIProcess/WebBackForwardList.h: 64 Make inherit from APIObject. 65 66 * UIProcess/WebBackForwardListItem.h: 67 Ditto. 68 69 * UIProcess/WebContext.cpp: 70 (WebKit::WebContext::didReceiveMessageFromInjectedBundle): 71 (WebKit::WebContext::postMessageToInjectedBundle): 72 (WebKit::WebContext::registerURLSchemeAsEmptyDocument): 73 Use String instead of StringImpl to be consistent. 74 75 * UIProcess/WebContext.h: 76 Make inherit from APIObject. 77 78 * UIProcess/WebFramePolicyListenerProxy.h: 79 Ditto. 80 81 * UIProcess/WebFrameProxy.h: 82 Ditto. 83 84 * UIProcess/WebNavigationData.h: 85 Ditto. 86 87 * UIProcess/WebPageNamespace.h: 88 Ditto. 89 90 * UIProcess/WebPageProxy.h: 91 Ditto. 92 93 * UIProcess/WebPreferences.h: 94 Ditto. 95 96 * UIProcess/WebUIClient.cpp: 97 (WebKit::WebUIClient::runJavaScriptPrompt): 98 Implement in terms of WebString. 99 100 * UIProcess/win/WebView.h: 101 Make inherit from APIObject. 102 103 * WebKit2.xcodeproj/project.pbxproj: 104 Add new files. 105 106 * WebProcess/InjectedBundle/API/c/WKBundle.cpp: 107 (WKBundlePostMessage): 108 Get the WebCore::String from the WebString. 109 110 * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: 111 (WKBundleFramePauseAnimationOnElementWithId): 112 Ditto. 113 114 * WebProcess/InjectedBundle/InjectedBundle.cpp: 115 (WebKit::InjectedBundle::postMessage): 116 * WebProcess/InjectedBundle/InjectedBundle.h: 117 Use String instead of StringImpl to be consistent. 118 119 * WebProcess/WebPage/WebFrame.h: 120 Make inherit from APIObject. 121 122 * WebProcess/WebPage/WebPage.h: 123 Make inherit from APIObject. 124 125 * win/WebKit2.vcproj: 126 Add new files. 127 1 128 2010-07-28 Anders Carlsson <andersca@apple.com> 2 129 -
trunk/WebKit2/Shared/ImmutableArray.h
r62212 r64232 27 27 #define ImmutableArray_h 28 28 29 #include "APIObject.h" 29 30 #include <wtf/PassRefPtr.h> 30 #include <wtf/RefCounted.h>31 31 32 32 namespace WebKit { … … 34 34 // ImmutableArray - An immutable array type suitable for vending to an API. 35 35 36 class ImmutableArray : public RefCounted<ImmutableArray>{36 class ImmutableArray : public APIObject { 37 37 public: 38 38 struct ImmutableArrayCallbacks { -
trunk/WebKit2/UIProcess/API/C/WKAPICast.h
r64172 r64232 29 29 #include "WKBase.h" 30 30 #include "WKPage.h" 31 #include "WebString.h" 31 32 #include <WebCore/FrameLoaderTypes.h> 32 #include <WebCore/PlatformString.h>33 33 34 34 #if defined(WIN32) || defined(_WIN32) … … 48 48 class WebPageProxy; 49 49 class WebPreferences; 50 class WebString; 50 51 51 52 template<typename APIType> struct APITypeInfo { }; … … 56 57 template<> struct APITypeInfo<WKFramePolicyListenerRef> { typedef WebFramePolicyListenerProxy* ImplType; }; 57 58 template<> struct APITypeInfo<WKPreferencesRef> { typedef WebPreferences* ImplType; }; 58 template<> struct APITypeInfo<WKStringRef> { typedef Web Core::StringImpl* ImplType; };59 template<> struct APITypeInfo<WKURLRef> { typedef Web Core::StringImpl* ImplType; };59 template<> struct APITypeInfo<WKStringRef> { typedef WebKit::WebString* ImplType; }; 60 template<> struct APITypeInfo<WKURLRef> { typedef WebKit::WebString* ImplType; }; 60 61 template<> struct APITypeInfo<WKNavigationDataRef> { typedef WebNavigationData* ImplType; }; 61 62 template<> struct APITypeInfo<WKArrayRef> { typedef ImmutableArray* ImplType; }; … … 70 71 template<> struct ImplTypeInfo<WebFramePolicyListenerProxy*> { typedef WKFramePolicyListenerRef APIType; }; 71 72 template<> struct ImplTypeInfo<WebPreferences*> { typedef WKPreferencesRef APIType; }; 72 template<> struct ImplTypeInfo<Web Core::StringImpl*>{ typedef WKStringRef APIType; };73 template<> struct ImplTypeInfo<WebString*> { typedef WKStringRef APIType; }; 73 74 template<> struct ImplTypeInfo<WebNavigationData*> { typedef WKNavigationDataRef APIType; }; 74 75 template<> struct ImplTypeInfo<ImmutableArray*> { typedef WKArrayRef APIType; }; 75 76 template<> struct ImplTypeInfo<WebBackForwardListItem*> { typedef WKBackForwardListItemRef APIType; }; 76 77 template<> struct ImplTypeInfo<WebBackForwardList*> { typedef WKBackForwardListRef APIType; }; 78 79 class WebStringAdaptor { 80 public: 81 WebStringAdaptor(PassRefPtr<WebString> impl) 82 : m_impl(impl) 83 { 84 } 85 86 operator WKStringRef() { return reinterpret_cast<WKStringRef>(m_impl.get()); } 87 operator WKURLRef() { return reinterpret_cast<WKURLRef>(m_impl.get()); } 88 89 private: 90 RefPtr<WebString> m_impl; 91 }; 77 92 78 93 } // namespace WebKit … … 94 109 /* Special cases. */ 95 110 96 inline W KStringReftoRef(WebCore::StringImpl* string)111 inline WebKit::WebStringAdaptor toRef(WebCore::StringImpl* string) 97 112 { 98 113 WebCore::StringImpl* impl = string ? string : WebCore::StringImpl::empty(); 99 return reinterpret_cast<WKStringRef>(impl);114 return WebKit::WebStringAdaptor(WebKit::WebString::create(WebCore::String(impl))); 100 115 } 101 116 102 inline W KURLReftoURLRef(WebCore::StringImpl* string)117 inline WebKit::WebStringAdaptor toURLRef(WebCore::StringImpl* string) 103 118 { 104 119 WebCore::StringImpl* impl = string ? string : WebCore::StringImpl::empty(); 105 return reinterpret_cast<WKURLRef>(impl);120 return WebKit::WebStringAdaptor(WebKit::WebString::create(WebCore::String(impl))) ; 106 121 } 107 122 … … 109 124 { 110 125 WebCore::StringImpl* impl = string.impl() ? string.impl() : WebCore::StringImpl::empty(); 111 impl->ref();112 return reinterpret_cast<WKStringRef>( impl);126 RefPtr<WebKit::WebString> webString = WebKit::WebString::create(WebCore::String(impl)); 127 return reinterpret_cast<WKStringRef>(webString.release().releaseRef()); 113 128 } 114 129 … … 116 131 { 117 132 WebCore::StringImpl* impl = string.impl() ? string.impl() : WebCore::StringImpl::empty(); 118 impl->ref();119 return reinterpret_cast<WKURLRef>( impl);133 RefPtr<WebKit::WebString> webString = WebKit::WebString::create(WebCore::String(impl)); 134 return reinterpret_cast<WKURLRef>(webString.release().releaseRef()); 120 135 } 121 136 -
trunk/WebKit2/UIProcess/API/C/WKContext.cpp
r64070 r64232 44 44 WKContextRef WKContextCreateWithInjectedBundlePath(WKStringRef pathRef) 45 45 { 46 RefPtr<WebContext> context = WebContext::create(toWK(pathRef) );46 RefPtr<WebContext> context = WebContext::create(toWK(pathRef)->string()); 47 47 return toRef(context.release().releaseRef()); 48 48 } … … 76 76 void WKContextPostMessageToInjectedBundle(WKContextRef contextRef, WKStringRef messageRef) 77 77 { 78 toWK(contextRef)->postMessageToInjectedBundle(toWK(messageRef) );78 toWK(contextRef)->postMessageToInjectedBundle(toWK(messageRef)->string()); 79 79 } 80 80 … … 97 97 void _WKContextSetAdditionalPluginPath(WKContextRef contextRef, WKStringRef pluginPath) 98 98 { 99 toWK(contextRef)->setAdditionalPluginPath(toWK(pluginPath) );99 toWK(contextRef)->setAdditionalPluginPath(toWK(pluginPath)->string()); 100 100 } 101 101 102 102 void _WKContextRegisterURLSchemeAsEmptyDocument(WKContextRef contextRef, WKStringRef urlScheme) 103 103 { 104 toWK(contextRef)->registerURLSchemeAsEmptyDocument(toWK(urlScheme) );104 toWK(contextRef)->registerURLSchemeAsEmptyDocument(toWK(urlScheme)->string()); 105 105 } -
trunk/WebKit2/UIProcess/API/C/WKPage.cpp
r64172 r64232 44 44 void WKPageLoadURL(WKPageRef pageRef, WKURLRef URLRef) 45 45 { 46 toWK(pageRef)->loadURL(toWK(URLRef) );46 toWK(pageRef)->loadURL(toWK(URLRef)->string()); 47 47 } 48 48 … … 153 153 void WKPageRunJavaScriptInMainFrame(WKPageRef pageRef, WKStringRef scriptRef, void* context, WKPageRunJavaScriptFunction callback, WKPageRunJavaScriptDisposeFunction disposeFunction) 154 154 { 155 toWK(pageRef)->runJavaScriptInMainFrame(toWK(scriptRef) , ScriptReturnValueCallback::create(context, callback, disposeFunction));155 toWK(pageRef)->runJavaScriptInMainFrame(toWK(scriptRef)->string(), ScriptReturnValueCallback::create(context, callback, disposeFunction)); 156 156 } 157 157 … … 176 176 #endif 177 177 178 void WKPageRenderTreeExternalRepresentation(WKPageRef pageRef, void *context, WKPageRenderTreeExternalRepresentationFunction callback, WKPageRenderTreeExternalRepresentationDisposeFunction disposeFunction)178 void WKPageRenderTreeExternalRepresentation(WKPageRef pageRef, void* context, WKPageRenderTreeExternalRepresentationFunction callback, WKPageRenderTreeExternalRepresentationDisposeFunction disposeFunction) 179 179 { 180 180 toWK(pageRef)->getRenderTreeExternalRepresentation(RenderTreeExternalRepresentationCallback::create(context, callback, disposeFunction)); -
trunk/WebKit2/UIProcess/API/C/WKString.cpp
r64096 r64232 27 27 28 28 #include "WKAPICast.h" 29 #include <WebCore/StringImpl.h>30 29 31 30 WKStringRef WKStringRetain(WKStringRef stringRef) … … 42 41 bool WKStringIsEmpty(WKStringRef stringRef) 43 42 { 44 return !toWK(stringRef)->length();43 return toWK(stringRef)->isEmpty(); 45 44 } -
trunk/WebKit2/UIProcess/API/C/WKURL.cpp
r57645 r64232 27 27 28 28 #include "WKAPICast.h" 29 #include <WebCore/StringImpl.h>30 29 31 30 WKURLRef WKURLRetain(WKURLRef URLRef) -
trunk/WebKit2/UIProcess/API/C/cf/WKStringCF.cpp
r58332 r64232 34 34 { 35 35 String string(cfString); 36 RefPtr<StringImpl> stringImpl = string.impl(); 37 return toRef(stringImpl.release().releaseRef()); 36 return toCopiedRef(string); 38 37 } 39 38 40 39 CFStringRef WKStringCopyCFString(CFAllocatorRef allocatorRef, WKStringRef stringRef) 41 40 { 41 ASSERT(!toWK(stringRef)->string().isNull()); 42 42 43 // NOTE: This does not use StringImpl::createCFString() since that function 43 44 // expects to be called on the thread running WebCore. 44 return CFStringCreateWithCharacters(allocatorRef, reinterpret_cast<const UniChar*>(toWK(stringRef)-> characters()), toWK(stringRef)->length());45 return CFStringCreateWithCharacters(allocatorRef, reinterpret_cast<const UniChar*>(toWK(stringRef)->string().characters()), toWK(stringRef)->string().length()); 45 46 } -
trunk/WebKit2/UIProcess/API/C/cf/WKURLCF.cpp
r60871 r64232 38 38 { 39 39 String urlString(CFURLGetString(cfURL)); 40 RefPtr<StringImpl> urlStringImpl = urlString.impl(); 41 return toURLRef(urlStringImpl.release().releaseRef()); 40 return toCopiedURLRef(urlString); 42 41 } 43 42 44 43 CFURLRef WKURLCopyCFURL(CFAllocatorRef allocatorRef, WKURLRef URLRef) 45 44 { 45 ASSERT(!toWK(URLRef)->string().isNull()); 46 46 47 // We first create a CFString and then create the CFURL from it. This will ensure that the CFURL is stored in 47 48 // UTF-8 which uses less memory and is what WebKit clients might expect. 48 RetainPtr<CFStringRef> urlString(AdoptCF, CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, reinterpret_cast<const UniChar*>(toWK(URLRef)-> characters()),49 toWK(URLRef)-> length(), kCFAllocatorNull));49 RetainPtr<CFStringRef> urlString(AdoptCF, CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, reinterpret_cast<const UniChar*>(toWK(URLRef)->string().characters()), 50 toWK(URLRef)->string().length(), kCFAllocatorNull)); 50 51 51 52 return CFURLCreateWithString(allocatorRef, urlString.get(), 0); -
trunk/WebKit2/UIProcess/WebBackForwardList.h
r62996 r64232 27 27 #define WebBackForwardList_h 28 28 29 #include "APIObject.h" 29 30 #include "ImmutableArray.h" 30 31 #include "WebBackForwardListItem.h" 32 #include <wtf/PassRefPtr.h> 33 #include <wtf/RefPtr.h> 31 34 #include <wtf/Vector.h> 32 #include <wtf/RefPtr.h>33 #include <wtf/PassRefPtr.h>34 #include <wtf/RefCounted.h>35 35 36 36 namespace WebKit { … … 46 46 */ 47 47 48 class WebBackForwardList : public RefCounted<WebBackForwardList>{48 class WebBackForwardList : public APIObject { 49 49 public: 50 50 static PassRefPtr<WebBackForwardList> create(WebPageProxy* page) -
trunk/WebKit2/UIProcess/WebBackForwardListItem.h
r63362 r64232 27 27 #define WebBackForwardListItem_h 28 28 29 #include "APIObject.h" 29 30 #include <WebCore/PlatformString.h> 30 31 #include <wtf/PassRefPtr.h> 31 #include <wtf/RefCounted.h>32 32 33 33 namespace WebKit { … … 35 35 class WebPageProxy; 36 36 37 class WebBackForwardListItem : public RefCounted<WebBackForwardListItem>{37 class WebBackForwardListItem : public APIObject { 38 38 public: 39 39 static PassRefPtr<WebBackForwardListItem> create(const WebCore::String& originalURL, const WebCore::String& url, const WebCore::String& title, uint64_t itemID) -
trunk/WebKit2/UIProcess/WebContext.cpp
r64140 r64232 153 153 // InjectedBundle client 154 154 155 void WebContext::didReceiveMessageFromInjectedBundle(const WebCore::String& message)155 void WebContext::didReceiveMessageFromInjectedBundle(const String& message) 156 156 { 157 157 m_injectedBundleClient.didReceiveMessageFromInjectedBundle(this, message); 158 158 } 159 159 160 void WebContext::postMessageToInjectedBundle( WebCore::StringImpl*message)160 void WebContext::postMessageToInjectedBundle(const String& message) 161 161 { 162 162 if (!m_process) 163 163 return; 164 164 165 m_process->send(WebProcessMessage::PostMessage, 0, CoreIPC::In( String(message)));165 m_process->send(WebProcessMessage::PostMessage, 0, CoreIPC::In(message)); 166 166 } 167 167 … … 184 184 } 185 185 186 void WebContext::registerURLSchemeAsEmptyDocument( WebCore::StringImpl*urlScheme)186 void WebContext::registerURLSchemeAsEmptyDocument(const String& urlScheme) 187 187 { 188 188 ensureWebProcess(); 189 189 190 m_process->send(WebProcessMessage::RegisterURLSchemeAsEmptyDocument, 0, CoreIPC::In( String(urlScheme)));190 m_process->send(WebProcessMessage::RegisterURLSchemeAsEmptyDocument, 0, CoreIPC::In(urlScheme)); 191 191 } 192 192 -
trunk/WebKit2/UIProcess/WebContext.h
r64070 r64232 27 27 #define WebContext_h 28 28 29 #include "APIObject.h" 29 30 #include "PluginInfoStore.h" 30 31 #include "ProcessModel.h" … … 34 35 #include <wtf/HashSet.h> 35 36 #include <wtf/PassRefPtr.h> 36 #include <wtf/RefCounted.h>37 37 #include <wtf/RefPtr.h> 38 38 … … 46 46 class WebProcessProxy; 47 47 48 class WebContext : public RefCounted<WebContext>{48 class WebContext : public APIObject { 49 49 public: 50 50 static WebContext* sharedProcessContext(); … … 79 79 void didReceiveMessageFromInjectedBundle(const WebCore::String&); 80 80 81 void postMessageToInjectedBundle( WebCore::StringImpl*);81 void postMessageToInjectedBundle(const WebCore::String&); 82 82 83 83 void getStatistics(WKContextStatistics* statistics); … … 87 87 WebCore::String applicationCacheDirectory(); 88 88 89 void registerURLSchemeAsEmptyDocument( WebCore::StringImpl*);89 void registerURLSchemeAsEmptyDocument(const WebCore::String&); 90 90 91 91 private: -
trunk/WebKit2/UIProcess/WebFramePolicyListenerProxy.h
r57310 r64232 27 27 #define WebFramePolicyListenerProxy_h 28 28 29 #include "APIObject.h" 29 30 #include <WebCore/FrameLoaderTypes.h> 30 31 #include <wtf/PassRefPtr.h> 31 #include <wtf/RefCounted.h>32 32 #include <wtf/RefPtr.h> 33 33 … … 36 36 class WebFrameProxy; 37 37 38 class WebFramePolicyListenerProxy : public RefCounted<WebFramePolicyListenerProxy>{38 class WebFramePolicyListenerProxy : public APIObject { 39 39 public: 40 40 static PassRefPtr<WebFramePolicyListenerProxy> create(WebFrameProxy* frame, uint64_t listenerID) -
trunk/WebKit2/UIProcess/WebFrameProxy.h
r60850 r64232 27 27 #define WebFrameProxy_h 28 28 29 #include "APIObject.h" 29 30 #include "WebFramePolicyListenerProxy.h" 30 31 #include <WebCore/FrameLoaderTypes.h> 31 32 #include <WebCore/PlatformString.h> 32 33 #include <wtf/PassRefPtr.h> 33 #include <wtf/RefCounted.h>34 34 35 35 namespace CoreIPC { … … 47 47 class WebPageProxy; 48 48 49 class WebFrameProxy : public RefCounted<WebFrameProxy>{49 class WebFrameProxy : public APIObject { 50 50 public: 51 51 static PassRefPtr<WebFrameProxy> create(WebPageProxy* page, uint64_t frameID) -
trunk/WebKit2/UIProcess/WebNavigationData.h
r57676 r64232 27 27 #define WebNavigationData_h 28 28 29 #include "APIObject.h" 29 30 #include "WebNavigationDataStore.h" 30 31 #include <wtf/PassRefPtr.h> 31 #include <wtf/RefCounted.h>32 32 33 33 namespace WebKit { 34 34 35 class WebNavigationData : public RefCounted<WebNavigationData>{35 class WebNavigationData : public APIObject { 36 36 public: 37 37 static PassRefPtr<WebNavigationData> create(const WebNavigationDataStore& store) -
trunk/WebKit2/UIProcess/WebPageNamespace.h
r61500 r64232 27 27 #define WebPageNamespace_h 28 28 29 #include "APIObject.h" 29 30 #include "WebContext.h" 30 31 #include <wtf/PassRefPtr.h> 31 #include <wtf/RefCounted.h>32 32 #include <wtf/RefPtr.h> 33 33 … … 38 38 class WebContext; 39 39 40 class WebPageNamespace : public RefCounted<WebPageNamespace>{40 class WebPageNamespace : public APIObject { 41 41 public: 42 42 static PassRefPtr<WebPageNamespace> create(WebContext* context) -
trunk/WebKit2/UIProcess/WebPageProxy.h
r64155 r64232 27 27 #define WebPageProxy_h 28 28 29 #include "APIObject.h" 29 30 #include "DrawingAreaProxy.h" 30 31 #include "GenericCallback.h" … … 42 43 #include <wtf/PassOwnPtr.h> 43 44 #include <wtf/PassRefPtr.h> 44 #include <wtf/RefCounted.h>45 45 #include <wtf/RefPtr.h> 46 46 … … 71 71 struct WebNavigationDataStore; 72 72 73 typedef GenericCallback<WKStringRef > RenderTreeExternalRepresentationCallback;74 typedef GenericCallback<WKStringRef > ScriptReturnValueCallback;75 76 class WebPageProxy : public RefCounted<WebPageProxy>{73 typedef GenericCallback<WKStringRef, WebCore::StringImpl*> RenderTreeExternalRepresentationCallback; 74 typedef GenericCallback<WKStringRef, WebCore::StringImpl*> ScriptReturnValueCallback; 75 76 class WebPageProxy : public APIObject { 77 77 public: 78 78 static PassRefPtr<WebPageProxy> create(WebPageNamespace*, uint64_t pageID); -
trunk/WebKit2/UIProcess/WebPreferences.h
r63682 r64232 27 27 #define WebPreferences_h 28 28 29 #include "APIObject.h" 29 30 #include "WebPreferencesStore.h" 30 31 #include <wtf/HashSet.h> 31 32 #include <wtf/PassRefPtr.h> 32 #include <wtf/RefCounted.h>33 33 #include <wtf/RefPtr.h> 34 34 … … 37 37 class WebContext; 38 38 39 class WebPreferences : public RefCounted<WebPreferences>{39 class WebPreferences : public APIObject { 40 40 public: 41 41 static WebPreferences* shared(); -
trunk/WebKit2/UIProcess/WebUIClient.cpp
r64065 r64232 92 92 return String(); 93 93 94 StringImpl* impl= toWK(m_pageUIClient.runJavaScriptPrompt(toRef(page), toRef(message.impl()), toRef(defaultValue.impl()), toRef(frame), m_pageUIClient.clientInfo));95 if (! impl)94 WebString* string = toWK(m_pageUIClient.runJavaScriptPrompt(toRef(page), toRef(message.impl()), toRef(defaultValue.impl()), toRef(frame), m_pageUIClient.clientInfo)); 95 if (!string) 96 96 return String(); 97 97 98 String result = impl;99 impl->deref();98 String result = string->string(); 99 string->deref(); 100 100 101 101 return result; -
trunk/WebKit2/UIProcess/win/WebView.h
r63848 r64232 27 27 #define WebView_h 28 28 29 #include "APIObject.h" 29 30 #include "PageClient.h" 30 31 #include "WebPageProxy.h" 31 32 #include <WebCore/WindowMessageListener.h> 32 33 #include <wtf/PassRefPtr.h> 33 #include <wtf/RefCounted.h>34 34 #include <wtf/RefPtr.h> 35 35 … … 43 43 class WebPageNamespace; 44 44 45 class WebView : public RefCounted<WebView>, public PageClient, WebCore::WindowMessageListener {45 class WebView : public APIObject, public PageClient, WebCore::WindowMessageListener { 46 46 public: 47 47 static PassRefPtr<WebView> create(RECT rect, WebPageNamespace* pageNamespace, HWND hostWindow) -
trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj
r64231 r64232 548 548 BCF049E411FE20F600F86A58 /* WKBundleFramePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleFramePrivate.h; sourceTree = "<group>"; }; 549 549 BCF049E511FE20F600F86A58 /* WKBundlePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundlePrivate.h; sourceTree = "<group>"; }; 550 BCF04C8C11FF9B7D00F86A58 /* APIObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIObject.h; sourceTree = "<group>"; }; 551 BCF04C8E11FF9F6E00F86A58 /* WebString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebString.h; sourceTree = "<group>"; }; 550 552 BCF69F841176CD6F00471A52 /* WebHistoryClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebHistoryClient.cpp; sourceTree = "<group>"; }; 551 553 BCF69F851176CD6F00471A52 /* WebHistoryClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebHistoryClient.h; sourceTree = "<group>"; }; … … 746 748 BC111B5F112F635E00337BAB /* CoreIPCSupport */, 747 749 BC111B5A112F628200337BAB /* mac */, 750 BCF04C8C11FF9B7D00F86A58 /* APIObject.h */, 751 BCF04C8E11FF9F6E00F86A58 /* WebString.h */, 748 752 1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */, 749 753 BC64696D11DBE603006455B0 /* ImmutableArray.cpp */, -
trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
r64067 r64232 41 41 void WKBundlePostMessage(WKBundleRef bundleRef, WKStringRef messageRef) 42 42 { 43 toWK(bundleRef)->postMessage(toWK(messageRef) );43 toWK(bundleRef)->postMessage(toWK(messageRef)->string()); 44 44 } 45 45 -
trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
r64172 r64232 57 57 bool WKBundleFramePauseAnimationOnElementWithId(WKBundleFrameRef frameRef, WKStringRef name, WKStringRef elementID, double time) 58 58 { 59 return toWK(frameRef)->pauseAnimationOnElementWithId(toWK(name) , toWK(elementID), time);59 return toWK(frameRef)->pauseAnimationOnElementWithId(toWK(name)->string(), toWK(elementID)->string(), time); 60 60 } 61 61 -
trunk/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
r64029 r64232 56 56 } 57 57 58 void InjectedBundle::postMessage( StringImpl*message)58 void InjectedBundle::postMessage(const String& message) 59 59 { 60 WebProcess::shared().connection()->send(WebProcessProxyMessage::PostMessage, 0, CoreIPC::In( String(message)));60 WebProcess::shared().connection()->send(WebProcessProxyMessage::PostMessage, 0, CoreIPC::In(message)); 61 61 } 62 62 -
trunk/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
r64029 r64232 60 60 // API 61 61 void initializeClient(WKBundleClient*); 62 void postMessage( WebCore::StringImpl*);62 void postMessage(const WebCore::String&); 63 63 void setShouldTrackVisitedLinks(bool); 64 64 void removeAllVisitedLinks(); -
trunk/WebKit2/WebProcess/WebPage/WebFrame.h
r64096 r64232 27 27 #define WebFrame_h 28 28 29 #include "APIObject.h" 29 30 #include "ImmutableArray.h" 30 31 #include "WebFrameLoaderClient.h" … … 34 35 #include <WebCore/PolicyChecker.h> 35 36 #include <wtf/PassRefPtr.h> 36 #include <wtf/RefCounted.h>37 37 #include <wtf/RefPtr.h> 38 38 … … 47 47 class WebPage; 48 48 49 class WebFrame : public RefCounted<WebFrame>{49 class WebFrame : public APIObject { 50 50 public: 51 51 static PassRefPtr<WebFrame> createMainFrame(WebPage*); -
trunk/WebKit2/WebProcess/WebPage/WebPage.h
r64091 r64232 27 27 #define WebPage_h 28 28 29 #include "APIObject.h" 29 30 #include "DrawingArea.h" 30 31 #include "InjectedBundlePageEditorClient.h" … … 36 37 #include <wtf/OwnPtr.h> 37 38 #include <wtf/PassRefPtr.h> 38 #include <wtf/RefCounted.h>39 39 #include <wtf/RefPtr.h> 40 40 … … 62 62 struct WebPreferencesStore; 63 63 64 class WebPage : public RefCounted<WebPage>{64 class WebPage : public APIObject { 65 65 public: 66 66 static PassRefPtr<WebPage> create(uint64_t pageID, const WebCore::IntSize& viewSize, const WebPreferencesStore&, DrawingArea::Type); -
trunk/WebKit2/win/WebKit2.vcproj
r64231 r64232 394 394 > 395 395 <File 396 RelativePath="..\Shared\APIObject.h" 397 > 398 </File> 399 <File 396 400 RelativePath="..\Shared\ImmutableArray.cpp" 397 401 > … … 431 435 <File 432 436 RelativePath="..\Shared\WebPreferencesStore.h" 437 > 438 </File> 439 <File 440 RelativePath="..\Shared\WebString.h" 433 441 > 434 442 </File>
Note: See TracChangeset
for help on using the changeset viewer.