Changeset 64788 in webkit


Ignore:
Timestamp:
Aug 5, 2010 2:32:14 PM (14 years ago)
Author:
weinig@apple.com
Message:

Add script world API for injected bundles
https://bugs.webkit.org/show_bug.cgi?id=43577

Reviewed by Gavin Barraclough.

  • Shared/APIObject.h:

(WebKit::APIObject::):

  • WebKit2.xcodeproj/project.pbxproj:
  • WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:

(WebKit::):

  • WebProcess/InjectedBundle/API/c/WKBundleBase.h:
  • WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp: Added.

(WKBundleScriptWorldGetTypeID):
(WKBundleScriptWorldCreateWorld):
(WKBundleScriptWorldNormalWorld):
(WKBundleScriptWorldRetain):
(WKBundleScriptWorldRelease):

  • WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h: Added.
  • WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
  • WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp: Added.

(WebKit::allWorlds):
(WebKit::InjectedBundleScriptWorld::create):
(WebKit::InjectedBundleScriptWorld::getOrCreate):
(WebKit::InjectedBundleScriptWorld::normalWorld):
(WebKit::InjectedBundleScriptWorld::InjectedBundleScriptWorld):
(WebKit::InjectedBundleScriptWorld::~InjectedBundleScriptWorld):

  • WebProcess/InjectedBundle/InjectedBundleScriptWorld.h: Added.

(WebKit::InjectedBundleScriptWorld::type):

  • win/WebKit2.vcproj:
  • win/WebKit2Generated.make:
Location:
trunk/WebKit2
Files:
4 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r64778 r64788  
     12010-08-05  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Gavin Barraclough.
     4
     5        Add script world API for injected bundles
     6        https://bugs.webkit.org/show_bug.cgi?id=43577
     7
     8        * Shared/APIObject.h:
     9        (WebKit::APIObject::):
     10        * WebKit2.xcodeproj/project.pbxproj:
     11        * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
     12        (WebKit::):
     13        * WebProcess/InjectedBundle/API/c/WKBundleBase.h:
     14        * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp: Added.
     15        (WKBundleScriptWorldGetTypeID):
     16        (WKBundleScriptWorldCreateWorld):
     17        (WKBundleScriptWorldNormalWorld):
     18        (WKBundleScriptWorldRetain):
     19        (WKBundleScriptWorldRelease):
     20        * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h: Added.
     21        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
     22        * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp: Added.
     23        (WebKit::allWorlds):
     24        (WebKit::InjectedBundleScriptWorld::create):
     25        (WebKit::InjectedBundleScriptWorld::getOrCreate):
     26        (WebKit::InjectedBundleScriptWorld::normalWorld):
     27        (WebKit::InjectedBundleScriptWorld::InjectedBundleScriptWorld):
     28        (WebKit::InjectedBundleScriptWorld::~InjectedBundleScriptWorld):
     29        * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h: Added.
     30        (WebKit::InjectedBundleScriptWorld::type):
     31        * win/WebKit2.vcproj:
     32        * win/WebKit2Generated.make:
     33
    1342010-08-05  Sam Weinig  <sam@webkit.org>
    235
  • trunk/WebKit2/Shared/APIObject.h

    r64778 r64788  
    5656        TypeBundleFrame,
    5757        TypeBundlePage,
     58        TypeBundleScriptWorld,
    5859        TypeBundleNodeHandle,
    5960
  • trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r64778 r64788  
    152152                BC111B65112F638300337BAB /* WebProcessMessageKinds.h in Headers */ = {isa = PBXBuildFile; fileRef = BC111B62112F638300337BAB /* WebProcessMessageKinds.h */; };
    153153                BC131BC911726C2800B69727 /* CoreIPCMessageKinds.h in Headers */ = {isa = PBXBuildFile; fileRef = BC131BC811726C2800B69727 /* CoreIPCMessageKinds.h */; };
     154                BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */ = {isa = PBXBuildFile; fileRef = BC14DF75120B5B7900826C0C /* InjectedBundleScriptWorld.h */; };
     155                BC14DF78120B5B7900826C0C /* InjectedBundleScriptWorld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC14DF76120B5B7900826C0C /* InjectedBundleScriptWorld.cpp */; };
     156                BC14DF9E120B635F00826C0C /* WKBundleScriptWorld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC14DF9C120B635F00826C0C /* WKBundleScriptWorld.cpp */; };
     157                BC14DF9F120B635F00826C0C /* WKBundleScriptWorld.h in Headers */ = {isa = PBXBuildFile; fileRef = BC14DF9D120B635F00826C0C /* WKBundleScriptWorld.h */; };
    154158                BC177465118B9FF4007D9E9A /* WKPagePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = BC177464118B9FF4007D9E9A /* WKPagePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
    155159                BC17753F118BABF0007D9E9A /* GenericCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = BC17753E118BABF0007D9E9A /* GenericCallback.h */; };
     
    473477                BC111B62112F638300337BAB /* WebProcessMessageKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebProcessMessageKinds.h; sourceTree = "<group>"; };
    474478                BC131BC811726C2800B69727 /* CoreIPCMessageKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreIPCMessageKinds.h; sourceTree = "<group>"; };
     479                BC14DF75120B5B7900826C0C /* InjectedBundleScriptWorld.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleScriptWorld.h; sourceTree = "<group>"; };
     480                BC14DF76120B5B7900826C0C /* InjectedBundleScriptWorld.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleScriptWorld.cpp; sourceTree = "<group>"; };
     481                BC14DF9C120B635F00826C0C /* WKBundleScriptWorld.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundleScriptWorld.cpp; sourceTree = "<group>"; };
     482                BC14DF9D120B635F00826C0C /* WKBundleScriptWorld.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleScriptWorld.h; sourceTree = "<group>"; };
    475483                BC177464118B9FF4007D9E9A /* WKPagePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPagePrivate.h; sourceTree = "<group>"; };
    476484                BC17753E118BABF0007D9E9A /* GenericCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GenericCallback.h; sourceTree = "<group>"; };
     
    11341142                                BCA8C6AD11E3C08700812FB7 /* InjectedBundlePageUIClient.cpp */,
    11351143                                BCA8C6AE11E3C08700812FB7 /* InjectedBundlePageUIClient.h */,
     1144                                BC14DF76120B5B7900826C0C /* InjectedBundleScriptWorld.cpp */,
     1145                                BC14DF75120B5B7900826C0C /* InjectedBundleScriptWorld.h */,
    11361146                        );
    11371147                        path = InjectedBundle;
     
    11751185                                E1EE55F711F8F1BC00CCBEE4 /* WKBundleRange.cpp */,
    11761186                                E1EE55F311F8F18900CCBEE4 /* WKBundleRange.h */,
     1187                                BC14DF9C120B635F00826C0C /* WKBundleScriptWorld.cpp */,
     1188                                BC14DF9D120B635F00826C0C /* WKBundleScriptWorld.h */,
    11771189                        );
    11781190                        path = c;
     
    14191431                                BC4BEEAB120A0A5F00FBA0C7 /* InjectedBundleNodeHandle.h in Headers */,
    14201432                                BC4BEFE1120A1A4C00FBA0C7 /* WKBundleNodeHandle.h in Headers */,
     1433                                BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */,
     1434                                BC14DF9F120B635F00826C0C /* WKBundleScriptWorld.h in Headers */,
    14211435                        );
    14221436                        runOnlyForDeploymentPostprocessing = 0;
     
    16311645                                BC4BEEAC120A0A5F00FBA0C7 /* InjectedBundleNodeHandle.cpp in Sources */,
    16321646                                BC4BEFE2120A1A4C00FBA0C7 /* WKBundleNodeHandle.cpp in Sources */,
     1647                                BC14DF78120B5B7900826C0C /* InjectedBundleScriptWorld.cpp in Sources */,
     1648                                BC14DF9E120B635F00826C0C /* WKBundleScriptWorld.cpp in Sources */,
    16331649                        );
    16341650                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h

    r64778 r64788  
    4242class InjectedBundle;
    4343class InjectedBundleNodeHandle;
     44class InjectedBundleScriptWorld;
    4445class WebFrame;
    4546class WebPage;
     
    5051template<> struct BundleAPITypeInfo<WKBundleRef>                        { typedef InjectedBundle* ImplType; };
    5152template<> struct BundleAPITypeInfo<WKBundleNodeHandleRef>              { typedef InjectedBundleNodeHandle* ImplType; };
     53template<> struct BundleAPITypeInfo<WKBundleScriptWorldRef>             { typedef InjectedBundleScriptWorld* ImplType; };
    5254template<> struct BundleAPITypeInfo<WKBundleNodeRef>                    { typedef WebCore::Node* ImplType; };
    5355template<> struct BundleAPITypeInfo<WKBundleRangeRef>                   { typedef WebCore::Range* ImplType; };
     
    5759template<> struct BundleImplTypeInfo<InjectedBundle*>                   { typedef WKBundleRef APIType; };
    5860template<> struct BundleImplTypeInfo<InjectedBundleNodeHandle*>         { typedef WKBundleNodeHandleRef APIType; };
     61template<> struct BundleImplTypeInfo<InjectedBundleScriptWorld*>        { typedef WKBundleScriptWorldRef APIType; };
    5962template<> struct BundleImplTypeInfo<WebFrame*>                         { typedef WKBundleFrameRef APIType; };
    6063template<> struct BundleImplTypeInfo<WebPage*>                          { typedef WKBundlePageRef APIType; };
  • trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBase.h

    r64778 r64788  
    3131typedef struct OpaqueWKBundleNodeHandle* WKBundleNodeHandleRef;
    3232typedef struct OpaqueWKBundlePage* WKBundlePageRef;
     33typedef struct OpaqueWKBundleScriptWorld* WKBundleScriptWorldRef;
    3334
    3435typedef struct OpaqueWKBundleDOMCSSStyleDeclaration* WKBundleCSSStyleDeclarationRef;
  • trunk/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp

    r64778 r64788  
    4141}
    4242
    43 static inline InjectedBundleNodeHandle* getDOMHandle(Node* domObject)
    44 {
    45     return domHandleCache().get(domObject);
    46 }
    47 
    48 static inline void setDOMHandle(Node* domObject, InjectedBundleNodeHandle* handle)
    49 {
    50     domHandleCache().set(domObject, handle);
    51 }
    52 
    53 static inline void removeDOMHandle(Node* domObject)
    54 {
    55     domHandleCache().remove(domObject);
    56 }
    57 
    5843PassRefPtr<InjectedBundleNodeHandle> InjectedBundleNodeHandle::getOrCreate(Node* node)
    5944{
  • trunk/WebKit2/win/WebKit2.vcproj

    r64778 r64788  
    732732                                        >
    733733                                </File>
     734                                <File
     735                                        RelativePath="..\WebProcess\InjectedBundle\InjectedBundleScriptWorld.cpp"
     736                                        >
     737                                </File>
     738                                <File
     739                                        RelativePath="..\WebProcess\InjectedBundle\InjectedBundleScriptWorld.h"
     740                                        >
     741                                </File>
    734742                                <Filter
    735743                                        Name="API"
     
    808816                                                <File
    809817                                                        RelativePath="..\WebProcess\InjectedBundle\API\c\WKBundleRange.h"
     818                                                        >
     819                                                </File>
     820                                                <File
     821                                                        RelativePath="..\WebProcess\InjectedBundle\API\c\WKBundleScriptWorld.cpp"
     822                                                        >
     823                                                </File>
     824                                                <File
     825                                                        RelativePath="..\WebProcess\InjectedBundle\API\c\WKBundleScriptWorld.h"
    810826                                                        >
    811827                                                </File>
  • trunk/WebKit2/win/WebKit2Generated.make

    r64778 r64788  
    3636    xcopy /y /d "..\WebProcess\InjectedBundle\API\c\WKBundlePrivate.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
    3737    xcopy /y /d "..\WebProcess\InjectedBundle\API\c\WKBundleRange.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     38    xcopy /y /d "..\WebProcess\InjectedBundle\API\c\WKBundleScriptWorld.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
    3839    -del "$(WEBKITOUTPUTDIR)\buildfailed"
    3940
Note: See TracChangeset for help on using the changeset viewer.