Changeset 64232 in webkit


Ignore:
Timestamp:
Jul 28, 2010 2:42:27 PM (14 years ago)
Author:
weinig@apple.com
Message:

Patch for https://bugs.webkit.org/show_bug.cgi?id=43097
Make all objects in the WebKit2 API inherit from a single base class

Reviewed by Anders Carlsson.

  • Adds an APIObject base class for all objects which can get vender through the C API to inherit from.
  • Adds a WebString class which wraps WebCore::String for now. I am not too fond of this solution, so we continue should iterate on it.
  • This is a first step toward make a CF-style base type (eg. CFTypeRef) for the C-API.
  • Shared/APIObject.h: Added.

(WebKit::APIObject::APIObject):
Base class for API objects.

  • Shared/ImmutableArray.h:

Make inherit from APIObject.

  • Shared/WebString.h: Added.

(WebKit::WebString::create):
(WebKit::WebString::isNull):
(WebKit::WebString::isEmpty):
(WebKit::WebString::string):
(WebKit::WebString::WebString):
Wraps a WebCore::String so that it can be passed out to the API
and still inherit from APIObject.

  • UIProcess/API/C/WKAPICast.h:

(WebKit::WebStringAdaptor::WebStringAdaptor):
(WebKit::WebStringAdaptor::operator WKStringRef):
(WebKit::WebStringAdaptor::operator WKURLRef):
Update conversion methods to deal in terms of WebStrings. Added WebStringAdaptor
to ease passing strings to client functions.

  • UIProcess/API/C/WKContext.cpp:

(WKContextCreateWithInjectedBundlePath):
(WKContextPostMessageToInjectedBundle):
(_WKContextSetAdditionalPluginPath):
(_WKContextRegisterURLSchemeAsEmptyDocument):
Get the WebCore::String from the WebString.

  • UIProcess/API/C/WKPage.cpp:

(WKPageLoadURL):
Ditto.

  • UIProcess/API/C/WKString.cpp:

(WKStringIsEmpty):
Implement in terms of WebString.

  • UIProcess/API/C/WKURL.cpp:
  • UIProcess/API/C/cf/WKStringCF.cpp:

(WKStringCreateWithCFString):
(WKStringCopyCFString):
Ditto.

  • UIProcess/API/C/cf/WKURLCF.cpp:

(WKURLCreateWithCFURL):
(WKURLCopyCFURL):
Ditto.

  • UIProcess/WebBackForwardList.h:

Make inherit from APIObject.

  • UIProcess/WebBackForwardListItem.h:

Ditto.

  • UIProcess/WebContext.cpp:

(WebKit::WebContext::didReceiveMessageFromInjectedBundle):
(WebKit::WebContext::postMessageToInjectedBundle):
(WebKit::WebContext::registerURLSchemeAsEmptyDocument):
Use String instead of StringImpl to be consistent.

  • UIProcess/WebContext.h:

Make inherit from APIObject.

  • UIProcess/WebFramePolicyListenerProxy.h:

Ditto.

  • UIProcess/WebFrameProxy.h:

Ditto.

  • UIProcess/WebNavigationData.h:

Ditto.

  • UIProcess/WebPageNamespace.h:

Ditto.

  • UIProcess/WebPageProxy.h:

Ditto.

  • UIProcess/WebPreferences.h:

Ditto.

  • UIProcess/WebUIClient.cpp:

(WebKit::WebUIClient::runJavaScriptPrompt):
Implement in terms of WebString.

  • UIProcess/win/WebView.h:

Make inherit from APIObject.

  • WebKit2.xcodeproj/project.pbxproj:

Add new files.

  • WebProcess/InjectedBundle/API/c/WKBundle.cpp:

(WKBundlePostMessage):
Get the WebCore::String from the WebString.

  • WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:

(WKBundleFramePauseAnimationOnElementWithId):
Ditto.

  • WebProcess/InjectedBundle/InjectedBundle.cpp:

(WebKit::InjectedBundle::postMessage):

  • WebProcess/InjectedBundle/InjectedBundle.h:

Use String instead of StringImpl to be consistent.

  • WebProcess/WebPage/WebFrame.h:

Make inherit from APIObject.

  • WebProcess/WebPage/WebPage.h:

Make inherit from APIObject.

  • win/WebKit2.vcproj:

Add new files.

Location:
trunk/WebKit2
Files:
2 added
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r64231 r64232  
     12010-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
    11282010-07-28  Anders Carlsson  <andersca@apple.com>
    2129
  • trunk/WebKit2/Shared/ImmutableArray.h

    r62212 r64232  
    2727#define ImmutableArray_h
    2828
     29#include "APIObject.h"
    2930#include <wtf/PassRefPtr.h>
    30 #include <wtf/RefCounted.h>
    3131
    3232namespace WebKit {
     
    3434// ImmutableArray - An immutable array type suitable for vending to an API.
    3535
    36 class ImmutableArray : public RefCounted<ImmutableArray> {
     36class ImmutableArray : public APIObject {
    3737public:
    3838    struct ImmutableArrayCallbacks {
  • trunk/WebKit2/UIProcess/API/C/WKAPICast.h

    r64172 r64232  
    2929#include "WKBase.h"
    3030#include "WKPage.h"
     31#include "WebString.h"
    3132#include <WebCore/FrameLoaderTypes.h>
    32 #include <WebCore/PlatformString.h>
    3333
    3434#if defined(WIN32) || defined(_WIN32)
     
    4848class WebPageProxy;
    4949class WebPreferences;
     50class WebString;
    5051
    5152template<typename APIType> struct APITypeInfo { };
     
    5657template<> struct APITypeInfo<WKFramePolicyListenerRef>         { typedef WebFramePolicyListenerProxy* ImplType; };
    5758template<> struct APITypeInfo<WKPreferencesRef>                 { typedef WebPreferences* ImplType; };
    58 template<> struct APITypeInfo<WKStringRef>                      { typedef WebCore::StringImpl* ImplType; };
    59 template<> struct APITypeInfo<WKURLRef>                         { typedef WebCore::StringImpl* ImplType; };
     59template<> struct APITypeInfo<WKStringRef>                      { typedef WebKit::WebString* ImplType; };
     60template<> struct APITypeInfo<WKURLRef>                         { typedef WebKit::WebString* ImplType; };
    6061template<> struct APITypeInfo<WKNavigationDataRef>              { typedef WebNavigationData* ImplType; };
    6162template<> struct APITypeInfo<WKArrayRef>                       { typedef ImmutableArray* ImplType; };
     
    7071template<> struct ImplTypeInfo<WebFramePolicyListenerProxy*>    { typedef WKFramePolicyListenerRef APIType; };
    7172template<> struct ImplTypeInfo<WebPreferences*>                 { typedef WKPreferencesRef APIType; };
    72 template<> struct ImplTypeInfo<WebCore::StringImpl*>            { typedef WKStringRef APIType; };
     73template<> struct ImplTypeInfo<WebString*>                      { typedef WKStringRef APIType; };
    7374template<> struct ImplTypeInfo<WebNavigationData*>              { typedef WKNavigationDataRef APIType; };
    7475template<> struct ImplTypeInfo<ImmutableArray*>                 { typedef WKArrayRef APIType; };
    7576template<> struct ImplTypeInfo<WebBackForwardListItem*>         { typedef WKBackForwardListItemRef APIType; };
    7677template<> struct ImplTypeInfo<WebBackForwardList*>             { typedef WKBackForwardListRef APIType; };
     78
     79class WebStringAdaptor {
     80public:
     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
     89private:
     90    RefPtr<WebString> m_impl;
     91};
    7792
    7893} // namespace WebKit
     
    94109/* Special cases. */
    95110
    96 inline WKStringRef toRef(WebCore::StringImpl* string)
     111inline WebKit::WebStringAdaptor toRef(WebCore::StringImpl* string)
    97112{
    98113    WebCore::StringImpl* impl = string ? string : WebCore::StringImpl::empty();
    99     return reinterpret_cast<WKStringRef>(impl);
     114    return WebKit::WebStringAdaptor(WebKit::WebString::create(WebCore::String(impl)));
    100115}
    101116
    102 inline WKURLRef toURLRef(WebCore::StringImpl* string)
     117inline WebKit::WebStringAdaptor toURLRef(WebCore::StringImpl* string)
    103118{
    104119    WebCore::StringImpl* impl = string ? string : WebCore::StringImpl::empty();
    105     return reinterpret_cast<WKURLRef>(impl);
     120    return WebKit::WebStringAdaptor(WebKit::WebString::create(WebCore::String(impl)))   ;
    106121}
    107122
     
    109124{
    110125    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());
    113128}
    114129
     
    116131{
    117132    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());
    120135}
    121136
  • trunk/WebKit2/UIProcess/API/C/WKContext.cpp

    r64070 r64232  
    4444WKContextRef WKContextCreateWithInjectedBundlePath(WKStringRef pathRef)
    4545{
    46     RefPtr<WebContext> context = WebContext::create(toWK(pathRef));
     46    RefPtr<WebContext> context = WebContext::create(toWK(pathRef)->string());
    4747    return toRef(context.release().releaseRef());
    4848}
     
    7676void WKContextPostMessageToInjectedBundle(WKContextRef contextRef, WKStringRef messageRef)
    7777{
    78     toWK(contextRef)->postMessageToInjectedBundle(toWK(messageRef));
     78    toWK(contextRef)->postMessageToInjectedBundle(toWK(messageRef)->string());
    7979}
    8080
     
    9797void _WKContextSetAdditionalPluginPath(WKContextRef contextRef, WKStringRef pluginPath)
    9898{
    99     toWK(contextRef)->setAdditionalPluginPath(toWK(pluginPath));
     99    toWK(contextRef)->setAdditionalPluginPath(toWK(pluginPath)->string());
    100100}
    101101
    102102void _WKContextRegisterURLSchemeAsEmptyDocument(WKContextRef contextRef, WKStringRef urlScheme)
    103103{
    104     toWK(contextRef)->registerURLSchemeAsEmptyDocument(toWK(urlScheme));
     104    toWK(contextRef)->registerURLSchemeAsEmptyDocument(toWK(urlScheme)->string());
    105105}
  • trunk/WebKit2/UIProcess/API/C/WKPage.cpp

    r64172 r64232  
    4444void WKPageLoadURL(WKPageRef pageRef, WKURLRef URLRef)
    4545{
    46     toWK(pageRef)->loadURL(toWK(URLRef));
     46    toWK(pageRef)->loadURL(toWK(URLRef)->string());
    4747}
    4848
     
    153153void WKPageRunJavaScriptInMainFrame(WKPageRef pageRef, WKStringRef scriptRef, void* context, WKPageRunJavaScriptFunction callback, WKPageRunJavaScriptDisposeFunction disposeFunction)
    154154{
    155     toWK(pageRef)->runJavaScriptInMainFrame(toWK(scriptRef), ScriptReturnValueCallback::create(context, callback, disposeFunction));
     155    toWK(pageRef)->runJavaScriptInMainFrame(toWK(scriptRef)->string(), ScriptReturnValueCallback::create(context, callback, disposeFunction));
    156156}
    157157
     
    176176#endif
    177177
    178 void WKPageRenderTreeExternalRepresentation(WKPageRef pageRef, void *context, WKPageRenderTreeExternalRepresentationFunction callback, WKPageRenderTreeExternalRepresentationDisposeFunction disposeFunction)
     178void WKPageRenderTreeExternalRepresentation(WKPageRef pageRef, void* context, WKPageRenderTreeExternalRepresentationFunction callback, WKPageRenderTreeExternalRepresentationDisposeFunction disposeFunction)
    179179{
    180180    toWK(pageRef)->getRenderTreeExternalRepresentation(RenderTreeExternalRepresentationCallback::create(context, callback, disposeFunction));
  • trunk/WebKit2/UIProcess/API/C/WKString.cpp

    r64096 r64232  
    2727
    2828#include "WKAPICast.h"
    29 #include <WebCore/StringImpl.h>
    3029
    3130WKStringRef WKStringRetain(WKStringRef stringRef)
     
    4241bool WKStringIsEmpty(WKStringRef stringRef)
    4342{
    44     return !toWK(stringRef)->length();
     43    return toWK(stringRef)->isEmpty();
    4544}
  • trunk/WebKit2/UIProcess/API/C/WKURL.cpp

    r57645 r64232  
    2727
    2828#include "WKAPICast.h"
    29 #include <WebCore/StringImpl.h>
    3029
    3130WKURLRef WKURLRetain(WKURLRef URLRef)
  • trunk/WebKit2/UIProcess/API/C/cf/WKStringCF.cpp

    r58332 r64232  
    3434{
    3535    String string(cfString);
    36     RefPtr<StringImpl> stringImpl = string.impl();
    37     return toRef(stringImpl.release().releaseRef());
     36    return toCopiedRef(string);
    3837}
    3938
    4039CFStringRef WKStringCopyCFString(CFAllocatorRef allocatorRef, WKStringRef stringRef)
    4140{
     41    ASSERT(!toWK(stringRef)->string().isNull());
     42
    4243    // NOTE: This does not use StringImpl::createCFString() since that function
    4344    // 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());
    4546}
  • trunk/WebKit2/UIProcess/API/C/cf/WKURLCF.cpp

    r60871 r64232  
    3838{
    3939    String urlString(CFURLGetString(cfURL));
    40     RefPtr<StringImpl> urlStringImpl = urlString.impl();
    41     return toURLRef(urlStringImpl.release().releaseRef());
     40    return toCopiedURLRef(urlString);
    4241}
    4342
    4443CFURLRef WKURLCopyCFURL(CFAllocatorRef allocatorRef, WKURLRef URLRef)
    4544{
     45    ASSERT(!toWK(URLRef)->string().isNull());
     46
    4647    // We first create a CFString and then create the CFURL from it. This will ensure that the CFURL is stored in
    4748    // 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));
    5051
    5152    return CFURLCreateWithString(allocatorRef, urlString.get(), 0);
  • trunk/WebKit2/UIProcess/WebBackForwardList.h

    r62996 r64232  
    2727#define WebBackForwardList_h
    2828
     29#include "APIObject.h"
    2930#include "ImmutableArray.h"
    3031#include "WebBackForwardListItem.h"
     32#include <wtf/PassRefPtr.h>
     33#include <wtf/RefPtr.h>
    3134#include <wtf/Vector.h>
    32 #include <wtf/RefPtr.h>
    33 #include <wtf/PassRefPtr.h>
    34 #include <wtf/RefCounted.h>
    3535
    3636namespace WebKit {
     
    4646 */
    4747
    48 class WebBackForwardList : public RefCounted<WebBackForwardList> {
     48class WebBackForwardList : public APIObject {
    4949public:
    5050    static PassRefPtr<WebBackForwardList> create(WebPageProxy* page)
  • trunk/WebKit2/UIProcess/WebBackForwardListItem.h

    r63362 r64232  
    2727#define WebBackForwardListItem_h
    2828
     29#include "APIObject.h"
    2930#include <WebCore/PlatformString.h>
    3031#include <wtf/PassRefPtr.h>
    31 #include <wtf/RefCounted.h>
    3232
    3333namespace WebKit {
     
    3535class WebPageProxy;
    3636
    37 class WebBackForwardListItem : public RefCounted<WebBackForwardListItem> {
     37class WebBackForwardListItem : public APIObject {
    3838public:
    3939    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  
    153153// InjectedBundle client
    154154
    155 void WebContext::didReceiveMessageFromInjectedBundle(const WebCore::String& message)
     155void WebContext::didReceiveMessageFromInjectedBundle(const String& message)
    156156{
    157157    m_injectedBundleClient.didReceiveMessageFromInjectedBundle(this, message);
    158158}
    159159
    160 void WebContext::postMessageToInjectedBundle(WebCore::StringImpl* message)
     160void WebContext::postMessageToInjectedBundle(const String& message)
    161161{
    162162    if (!m_process)
    163163        return;
    164164
    165     m_process->send(WebProcessMessage::PostMessage, 0, CoreIPC::In(String(message)));
     165    m_process->send(WebProcessMessage::PostMessage, 0, CoreIPC::In(message));
    166166}
    167167
     
    184184}
    185185
    186 void WebContext::registerURLSchemeAsEmptyDocument(WebCore::StringImpl* urlScheme)
     186void WebContext::registerURLSchemeAsEmptyDocument(const String& urlScheme)
    187187{
    188188    ensureWebProcess();
    189189
    190     m_process->send(WebProcessMessage::RegisterURLSchemeAsEmptyDocument, 0, CoreIPC::In(String(urlScheme)));
     190    m_process->send(WebProcessMessage::RegisterURLSchemeAsEmptyDocument, 0, CoreIPC::In(urlScheme));
    191191}
    192192
  • trunk/WebKit2/UIProcess/WebContext.h

    r64070 r64232  
    2727#define WebContext_h
    2828
     29#include "APIObject.h"
    2930#include "PluginInfoStore.h"
    3031#include "ProcessModel.h"
     
    3435#include <wtf/HashSet.h>
    3536#include <wtf/PassRefPtr.h>
    36 #include <wtf/RefCounted.h>
    3737#include <wtf/RefPtr.h>
    3838
     
    4646class WebProcessProxy;
    4747
    48 class WebContext : public RefCounted<WebContext> {
     48class WebContext : public APIObject {
    4949public:
    5050    static WebContext* sharedProcessContext();
     
    7979    void didReceiveMessageFromInjectedBundle(const WebCore::String&);
    8080
    81     void postMessageToInjectedBundle(WebCore::StringImpl*);
     81    void postMessageToInjectedBundle(const WebCore::String&);
    8282
    8383    void getStatistics(WKContextStatistics* statistics);
     
    8787    WebCore::String applicationCacheDirectory();
    8888   
    89     void registerURLSchemeAsEmptyDocument(WebCore::StringImpl*);
     89    void registerURLSchemeAsEmptyDocument(const WebCore::String&);
    9090
    9191private:
  • trunk/WebKit2/UIProcess/WebFramePolicyListenerProxy.h

    r57310 r64232  
    2727#define WebFramePolicyListenerProxy_h
    2828
     29#include "APIObject.h"
    2930#include <WebCore/FrameLoaderTypes.h>
    3031#include <wtf/PassRefPtr.h>
    31 #include <wtf/RefCounted.h>
    3232#include <wtf/RefPtr.h>
    3333
     
    3636class WebFrameProxy;
    3737
    38 class WebFramePolicyListenerProxy : public RefCounted<WebFramePolicyListenerProxy> {
     38class WebFramePolicyListenerProxy : public APIObject {
    3939public:
    4040    static PassRefPtr<WebFramePolicyListenerProxy> create(WebFrameProxy* frame, uint64_t listenerID)
  • trunk/WebKit2/UIProcess/WebFrameProxy.h

    r60850 r64232  
    2727#define WebFrameProxy_h
    2828
     29#include "APIObject.h"
    2930#include "WebFramePolicyListenerProxy.h"
    3031#include <WebCore/FrameLoaderTypes.h>
    3132#include <WebCore/PlatformString.h>
    3233#include <wtf/PassRefPtr.h>
    33 #include <wtf/RefCounted.h>
    3434
    3535namespace CoreIPC {
     
    4747class WebPageProxy;
    4848
    49 class WebFrameProxy : public RefCounted<WebFrameProxy> {
     49class WebFrameProxy : public APIObject {
    5050public:
    5151    static PassRefPtr<WebFrameProxy> create(WebPageProxy* page, uint64_t frameID)
  • trunk/WebKit2/UIProcess/WebNavigationData.h

    r57676 r64232  
    2727#define WebNavigationData_h
    2828
     29#include "APIObject.h"
    2930#include "WebNavigationDataStore.h"
    3031#include <wtf/PassRefPtr.h>
    31 #include <wtf/RefCounted.h>
    3232
    3333namespace WebKit {
    3434
    35 class WebNavigationData : public RefCounted<WebNavigationData> {
     35class WebNavigationData : public APIObject {
    3636public:
    3737    static PassRefPtr<WebNavigationData> create(const WebNavigationDataStore& store)
  • trunk/WebKit2/UIProcess/WebPageNamespace.h

    r61500 r64232  
    2727#define WebPageNamespace_h
    2828
     29#include "APIObject.h"
    2930#include "WebContext.h"
    3031#include <wtf/PassRefPtr.h>
    31 #include <wtf/RefCounted.h>
    3232#include <wtf/RefPtr.h>
    3333
     
    3838class WebContext;
    3939
    40 class WebPageNamespace : public RefCounted<WebPageNamespace> {
     40class WebPageNamespace : public APIObject {
    4141public:
    4242    static PassRefPtr<WebPageNamespace> create(WebContext* context)
  • trunk/WebKit2/UIProcess/WebPageProxy.h

    r64155 r64232  
    2727#define WebPageProxy_h
    2828
     29#include "APIObject.h"
    2930#include "DrawingAreaProxy.h"
    3031#include "GenericCallback.h"
     
    4243#include <wtf/PassOwnPtr.h>
    4344#include <wtf/PassRefPtr.h>
    44 #include <wtf/RefCounted.h>
    4545#include <wtf/RefPtr.h>
    4646
     
    7171struct WebNavigationDataStore;
    7272
    73 typedef GenericCallback<WKStringRef> RenderTreeExternalRepresentationCallback;
    74 typedef GenericCallback<WKStringRef> ScriptReturnValueCallback;
    75 
    76 class WebPageProxy : public RefCounted<WebPageProxy> {
     73typedef GenericCallback<WKStringRef, WebCore::StringImpl*> RenderTreeExternalRepresentationCallback;
     74typedef GenericCallback<WKStringRef, WebCore::StringImpl*> ScriptReturnValueCallback;
     75
     76class WebPageProxy : public APIObject {
    7777public:
    7878    static PassRefPtr<WebPageProxy> create(WebPageNamespace*, uint64_t pageID);
  • trunk/WebKit2/UIProcess/WebPreferences.h

    r63682 r64232  
    2727#define WebPreferences_h
    2828
     29#include "APIObject.h"
    2930#include "WebPreferencesStore.h"
    3031#include <wtf/HashSet.h>
    3132#include <wtf/PassRefPtr.h>
    32 #include <wtf/RefCounted.h>
    3333#include <wtf/RefPtr.h>
    3434
     
    3737class WebContext;
    3838
    39 class WebPreferences : public RefCounted<WebPreferences> {
     39class WebPreferences : public APIObject {
    4040public:
    4141    static WebPreferences* shared();
  • trunk/WebKit2/UIProcess/WebUIClient.cpp

    r64065 r64232  
    9292        return String();
    9393
    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)
    9696        return String();
    9797
    98     String result = impl;
    99     impl->deref();
     98    String result = string->string();
     99    string->deref();
    100100
    101101    return result;
  • trunk/WebKit2/UIProcess/win/WebView.h

    r63848 r64232  
    2727#define WebView_h
    2828
     29#include "APIObject.h"
    2930#include "PageClient.h"
    3031#include "WebPageProxy.h"
    3132#include <WebCore/WindowMessageListener.h>
    3233#include <wtf/PassRefPtr.h>
    33 #include <wtf/RefCounted.h>
    3434#include <wtf/RefPtr.h>
    3535
     
    4343class WebPageNamespace;
    4444
    45 class WebView : public RefCounted<WebView>, public PageClient, WebCore::WindowMessageListener {
     45class WebView : public APIObject, public PageClient, WebCore::WindowMessageListener {
    4646public:
    4747    static PassRefPtr<WebView> create(RECT rect, WebPageNamespace* pageNamespace, HWND hostWindow)
  • trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r64231 r64232  
    548548                BCF049E411FE20F600F86A58 /* WKBundleFramePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleFramePrivate.h; sourceTree = "<group>"; };
    549549                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>"; };
    550552                BCF69F841176CD6F00471A52 /* WebHistoryClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebHistoryClient.cpp; sourceTree = "<group>"; };
    551553                BCF69F851176CD6F00471A52 /* WebHistoryClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebHistoryClient.h; sourceTree = "<group>"; };
     
    746748                                BC111B5F112F635E00337BAB /* CoreIPCSupport */,
    747749                                BC111B5A112F628200337BAB /* mac */,
     750                                BCF04C8C11FF9B7D00F86A58 /* APIObject.h */,
     751                                BCF04C8E11FF9F6E00F86A58 /* WebString.h */,
    748752                                1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */,
    749753                                BC64696D11DBE603006455B0 /* ImmutableArray.cpp */,
  • trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp

    r64067 r64232  
    4141void WKBundlePostMessage(WKBundleRef bundleRef, WKStringRef messageRef)
    4242{
    43     toWK(bundleRef)->postMessage(toWK(messageRef));
     43    toWK(bundleRef)->postMessage(toWK(messageRef)->string());
    4444}
    4545
  • trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp

    r64172 r64232  
    5757bool WKBundleFramePauseAnimationOnElementWithId(WKBundleFrameRef frameRef, WKStringRef name, WKStringRef elementID, double time)
    5858{
    59     return toWK(frameRef)->pauseAnimationOnElementWithId(toWK(name), toWK(elementID), time);
     59    return toWK(frameRef)->pauseAnimationOnElementWithId(toWK(name)->string(), toWK(elementID)->string(), time);
    6060}
    6161
  • trunk/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp

    r64029 r64232  
    5656}
    5757
    58 void InjectedBundle::postMessage(StringImpl* message)
     58void InjectedBundle::postMessage(const String& message)
    5959{
    60     WebProcess::shared().connection()->send(WebProcessProxyMessage::PostMessage, 0, CoreIPC::In(String(message)));
     60    WebProcess::shared().connection()->send(WebProcessProxyMessage::PostMessage, 0, CoreIPC::In(message));
    6161}
    6262
  • trunk/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h

    r64029 r64232  
    6060    // API
    6161    void initializeClient(WKBundleClient*);
    62     void postMessage(WebCore::StringImpl*);
     62    void postMessage(const WebCore::String&);
    6363    void setShouldTrackVisitedLinks(bool);
    6464    void removeAllVisitedLinks();
  • trunk/WebKit2/WebProcess/WebPage/WebFrame.h

    r64096 r64232  
    2727#define WebFrame_h
    2828
     29#include "APIObject.h"
    2930#include "ImmutableArray.h"
    3031#include "WebFrameLoaderClient.h"
     
    3435#include <WebCore/PolicyChecker.h>
    3536#include <wtf/PassRefPtr.h>
    36 #include <wtf/RefCounted.h>
    3737#include <wtf/RefPtr.h>
    3838
     
    4747class WebPage;
    4848
    49 class WebFrame : public RefCounted<WebFrame> {
     49class WebFrame : public APIObject {
    5050public:
    5151    static PassRefPtr<WebFrame> createMainFrame(WebPage*);
  • trunk/WebKit2/WebProcess/WebPage/WebPage.h

    r64091 r64232  
    2727#define WebPage_h
    2828
     29#include "APIObject.h"
    2930#include "DrawingArea.h"
    3031#include "InjectedBundlePageEditorClient.h"
     
    3637#include <wtf/OwnPtr.h>
    3738#include <wtf/PassRefPtr.h>
    38 #include <wtf/RefCounted.h>
    3939#include <wtf/RefPtr.h>
    4040
     
    6262struct WebPreferencesStore;
    6363
    64 class WebPage : public RefCounted<WebPage> {
     64class WebPage : public APIObject {
    6565public:
    6666    static PassRefPtr<WebPage> create(uint64_t pageID, const WebCore::IntSize& viewSize, const WebPreferencesStore&, DrawingArea::Type);
  • trunk/WebKit2/win/WebKit2.vcproj

    r64231 r64232  
    394394                        >
    395395                        <File
     396                                RelativePath="..\Shared\APIObject.h"
     397                                >
     398                        </File>
     399                        <File
    396400                                RelativePath="..\Shared\ImmutableArray.cpp"
    397401                                >
     
    431435                        <File
    432436                                RelativePath="..\Shared\WebPreferencesStore.h"
     437                                >
     438                        </File>
     439                        <File
     440                                RelativePath="..\Shared\WebString.h"
    433441                                >
    434442                        </File>
Note: See TracChangeset for help on using the changeset viewer.