Changeset 69539 in webkit


Ignore:
Timestamp:
Oct 11, 2010 5:05:21 PM (14 years ago)
Author:
weinig@apple.com
Message:

Add ability to convert from a JSObjectRef back to a WKBundleNodeHandleRef
https://bugs.webkit.org/show_bug.cgi?id=47509

Reviewed by Anders Carlsson.

WebCore:

  • WebCore.exp.in: Export toNode.

WebKit2:

Add SPI to convert a JSObjectRef to a WKBundleNodeHandleRef.

  • DerivedSources.pro:
  • WebKit2.pro:
  • WebKit2.xcodeproj/project.pbxproj:
  • WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:

(WKBundleNodeHandleCreate):

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

(WebKit::InjectedBundleNodeHandle::getOrCreate):

  • WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
  • win/WebKit2.vcproj:
  • win/WebKit2Generated.make:
Location:
trunk
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r69530 r69539  
     12010-10-11  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Add ability to convert from a JSObjectRef back to a WKBundleNodeHandleRef
     6        https://bugs.webkit.org/show_bug.cgi?id=47509
     7
     8        * WebCore.exp.in: Export toNode.
     9
    1102010-10-11  Martin Robinson  <mrobinson@igalia.com>
    211
  • trunk/WebCore/WebCore.exp.in

    r69437 r69539  
    673673__ZN7WebCore6WidgetC2EP6NSView
    674674__ZN7WebCore6WidgetD2Ev
     675__ZN7WebCore6toNodeEN3JSC7JSValueE
    675676__ZN7WebCore7Console21shouldPrintExceptionsEv
    676677__ZN7WebCore7Console24setShouldPrintExceptionsEb
     
    734735__ZN7WebCore8Settings25setDeveloperExtrasEnabledEb
    735736__ZN7WebCore8Settings25setFrameFlatteningEnabledEb
    736 __ZN7WebCore8Settings27setSpatialNavigationEnabledEb
    737737__ZN7WebCore8Settings25setMinimumLogicalFontSizeEi
    738738__ZN7WebCore8Settings25setNeedsLeopardMailQuirksEb
     
    745745__ZN7WebCore8Settings27setLoadsImagesAutomaticallyEb
    746746__ZN7WebCore8Settings27setLocalStorageDatabasePathERKN3WTF6StringE
     747__ZN7WebCore8Settings27setSpatialNavigationEnabledEb
    747748__ZN7WebCore8Settings28setForceFTPDirectoryListingsEb
    748749__ZN7WebCore8Settings29setAccelerated2dCanvasEnabledEb
  • trunk/WebKit2/ChangeLog

    r69538 r69539  
     12010-10-11  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Add ability to convert from a JSObjectRef back to a WKBundleNodeHandleRef
     6        https://bugs.webkit.org/show_bug.cgi?id=47509
     7
     8        Add SPI to convert a JSObjectRef to a WKBundleNodeHandleRef.
     9
     10        * DerivedSources.pro:
     11        * WebKit2.pro:
     12        * WebKit2.xcodeproj/project.pbxproj:
     13        * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
     14        (WKBundleNodeHandleCreate):
     15        * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h: Added.
     16        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
     17        (WebKit::InjectedBundleNodeHandle::getOrCreate):
     18        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
     19        * win/WebKit2.vcproj:
     20        * win/WebKit2Generated.make:
     21
    1222010-10-11  Brady Eidson  <beidson@apple.com>
    223
  • trunk/WebKit2/DerivedSources.pro

    r69488 r69539  
    1010    $$OUTPUT_DIR/WebCore/generated/JSElement.h \
    1111    $$OUTPUT_DIR/WebCore/generated/JSHTMLElement.h \
     12    $$OUTPUT_DIR/WebCore/generated/JSNode.h \
    1213    $$OUTPUT_DIR/WebCore/generated/JSRange.h \
    1314
  • trunk/WebKit2/WebKit2.pro

    r69457 r69539  
    258258    UIProcess/WebProcessProxy.h \
    259259    UIProcess/WebUIClient.h \
     260    WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h \
     261    WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h \
     262    WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h \
    260263    WebProcess/InjectedBundle/API/c/WKBundlePage.h \
    261     WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h \
    262264    WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h \
    263265    WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h \
  • trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r69538 r69539  
    284284                BC4BEFE1120A1A4C00FBA0C7 /* WKBundleNodeHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4BEFDF120A1A4C00FBA0C7 /* WKBundleNodeHandle.h */; settings = {ATTRIBUTES = (Public, ); }; };
    285285                BC4BEFE2120A1A4C00FBA0C7 /* WKBundleNodeHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC4BEFE0120A1A4C00FBA0C7 /* WKBundleNodeHandle.cpp */; };
     286                BC57450C1263B155006F0F12 /* WKBundleNodeHandlePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = BC57450B1263B155006F0F12 /* WKBundleNodeHandlePrivate.h */; };
    286287                BC59534210FC04520098F82D /* WebLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BC59534010FC04520098F82D /* WebLoaderClient.h */; };
    287288                BC597075116591D000551FCA /* ProcessModel.h in Headers */ = {isa = PBXBuildFile; fileRef = BC597074116591D000551FCA /* ProcessModel.h */; };
     
    747748                BC4BEFDF120A1A4C00FBA0C7 /* WKBundleNodeHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleNodeHandle.h; sourceTree = "<group>"; };
    748749                BC4BEFE0120A1A4C00FBA0C7 /* WKBundleNodeHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundleNodeHandle.cpp; sourceTree = "<group>"; };
     750                BC57450B1263B155006F0F12 /* WKBundleNodeHandlePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleNodeHandlePrivate.h; sourceTree = "<group>"; };
    749751                BC59534010FC04520098F82D /* WebLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebLoaderClient.h; sourceTree = "<group>"; };
    750752                BC597074116591D000551FCA /* ProcessModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessModel.h; sourceTree = "<group>"; };
     
    15571559                                BC4BEFE0120A1A4C00FBA0C7 /* WKBundleNodeHandle.cpp */,
    15581560                                BC4BEFDF120A1A4C00FBA0C7 /* WKBundleNodeHandle.h */,
     1561                                BC57450B1263B155006F0F12 /* WKBundleNodeHandlePrivate.h */,
    15591562                                BC20528011C94284008F3375 /* WKBundlePage.cpp */,
    15601563                                BC20527F11C94284008F3375 /* WKBundlePage.h */,
     
    19841987                                1A3DD206125E5A2F004515E6 /* APIClient.h in Headers */,
    19851988                                BCC8B374125FB69000DE46A4 /* WKGeometry.h in Headers */,
     1989                                BC57450C1263B155006F0F12 /* WKBundleNodeHandlePrivate.h in Headers */,
    19861990                        );
    19871991                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp

    r69214 r69539  
    2525
    2626#include "WKBundleNodeHandle.h"
     27#include "WKBundleNodeHandlePrivate.h"
    2728
    2829#include "InjectedBundleNodeHandle.h"
     
    3637    return toAPI(InjectedBundleNodeHandle::APIType);
    3738}
     39
     40WKBundleNodeHandleRef WKBundleNodeHandleCreate(JSContextRef contextRef, JSObjectRef objectRef)
     41{
     42    RefPtr<InjectedBundleNodeHandle> nodeHandle = InjectedBundleNodeHandle::getOrCreate(contextRef, objectRef);
     43    return toAPI(nodeHandle.release().releaseRef());
     44}
  • trunk/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp

    r67813 r69539  
    2626#include "InjectedBundleNodeHandle.h"
    2727
     28#include <JavaScriptCore/APICast.h>
     29#include <WebCore/JSNode.h>
    2830#include <WebCore/Node.h>
    2931#include <wtf/HashMap.h>
     
    3941    DEFINE_STATIC_LOCAL(DOMHandleCache, cache, ());
    4042    return cache;
     43}
     44
     45PassRefPtr<InjectedBundleNodeHandle> InjectedBundleNodeHandle::getOrCreate(JSContextRef, JSObjectRef object)
     46{
     47    Node* node = toNode(toJS(object));
     48    return getOrCreate(node);
    4149}
    4250
  • trunk/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h

    r67813 r69539  
    2525
    2626#include "APIObject.h"
     27#include <JavaScriptCore/JSBase.h>
    2728#include <wtf/PassRefPtr.h>
    2829#include <wtf/RefPtr.h>
     
    4041    static const Type APIType = TypeBundleNodeHandle;
    4142
     43    static PassRefPtr<InjectedBundleNodeHandle> getOrCreate(JSContextRef context, JSObjectRef object);
    4244    static PassRefPtr<InjectedBundleNodeHandle> getOrCreate(WebCore::Node*);
     45
    4346    ~InjectedBundleNodeHandle();
    4447
  • trunk/WebKit2/win/WebKit2.vcproj

    r69538 r69539  
    11831183                                                </File>
    11841184                                                <File
     1185                                                        RelativePath="..\WebProcess\InjectedBundle\API\c\WKBundleNodeHandlePrivate.h"
     1186                                                        >
     1187                                                </File>
     1188                                                <File
    11851189                                                        RelativePath="..\WebProcess\InjectedBundle\API\c\WKBundlePage.cpp"
    11861190                                                        >
  • trunk/WebKit2/win/WebKit2Generated.make

    r69457 r69539  
    4949    xcopy /y /d "..\WebProcess\InjectedBundle\API\c\WKBundleInitialize.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
    5050    xcopy /y /d "..\WebProcess\InjectedBundle\API\c\WKBundleNodeHandle.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     51    xcopy /y /d "..\WebProcess\InjectedBundle\API\c\WKBundleNodeHandlePrivate.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
    5152    xcopy /y /d "..\WebProcess\InjectedBundle\API\c\WKBundlePage.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
    5253    xcopy /y /d "..\WebProcess\InjectedBundle\API\c\WKBundlePagePrivate.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
Note: See TracChangeset for help on using the changeset viewer.