Changeset 69524 in webkit


Ignore:
Timestamp:
Oct 11, 2010 2:08:30 PM (14 years ago)
Author:
jberlin@webkit.org
Message:

Add Private API for creating a WebKit2 WebSerializedScriptValue from the internal
representation of a WebKit1 WebSerializedJSValue.
https://bugs.webkit.org/show_bug.cgi?id=47439

Reviewed by Darin Adler.

WebKit/mac:

  • WebView/WebSerializedJSValue.mm:

(-[WebSerializedJSValue internalRepresentation]):

  • WebView/WebSerializedJSValuePrivate.h:

WebKit/win:

  • Interfaces/IWebSerializedJSValuePrivate.idl:

Because it is taking a void parameter, getInternalRepresentation must be declared [local].

  • WebSerializedJSValue.cpp:

(WebSerializedJSValue::getInternalRepresentation):

  • WebSerializedJSValue.h:

WebKit2:

  • Shared/API/c/WKSerializedScriptValue.cpp:

(WKSerializedScriptValueCreateWithInternalRepresentation):
Use the existing WebSerializedScriptValue constructor that takes a pointer to the internal
representation (a WebCore::SerializedScriptValue).

  • Shared/API/c/WKSerializedScriptValuePrivate.h:
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/mac/ChangeLog

    r69415 r69524  
     12010-10-11  Jessie Berlin  <jberlin@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Add Private API for creating a WebKit2 WebSerializedScriptValue from the internal
     6        representation of a WebKit1 WebSerializedJSValue.
     7        https://bugs.webkit.org/show_bug.cgi?id=47439
     8
     9        * WebView/WebSerializedJSValue.mm:
     10        (-[WebSerializedJSValue internalRepresentation]):
     11        * WebView/WebSerializedJSValuePrivate.h:
     12
    1132010-10-07  Jessie Berlin  <jberlin@apple.com>
    214
  • trunk/WebKit/mac/WebView/WebSerializedJSValue.mm

    r69415 r69524  
    104104}
    105105
     106- (void*)internalRepresentation
     107{
     108    if (!_private)
     109        return 0;
     110    return _private->value.get();
     111}
     112
    106113@end
    107114
  • trunk/WebKit/mac/WebView/WebSerializedJSValuePrivate.h

    r69415 r69524  
    3131@interface WebSerializedJSValue(WebPrivate)
    3232- (id)initWithInternalRepresentation:(void*)internalRepresenatation;
     33- (void*)internalRepresentation;
    3334@end
  • trunk/WebKit/win/ChangeLog

    r69415 r69524  
     12010-10-11  Jessie Berlin  <jberlin@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Add Private API for creating a WebKit2 WebSerializedScriptValue from the internal
     6        representation of a WebKit1 WebSerializedJSValue.
     7        https://bugs.webkit.org/show_bug.cgi?id=47439
     8
     9        * Interfaces/IWebSerializedJSValuePrivate.idl:
     10        Because it is taking a void** parameter, getInternalRepresentation must be declared [local].
     11
     12        * WebSerializedJSValue.cpp:
     13        (WebSerializedJSValue::getInternalRepresentation):
     14        * WebSerializedJSValue.h:
     15
    1162010-10-07  Jessie Berlin  <jberlin@apple.com>
    217
  • trunk/WebKit/win/Interfaces/IWebSerializedJSValuePrivate.idl

    r69415 r69524  
    4242{
    4343    [local] HRESULT setInternalRepresentation([in] void* internalRepresentation);
     44    [local] HRESULT getInternalRepresentation([out, retval] void** internalRepresentation);
    4445}
  • trunk/WebKit/win/WebSerializedJSValue.cpp

    r69415 r69524  
    118118    return S_OK;
    119119}
     120
     121HRESULT WebSerializedJSValue::getInternalRepresentation(void** internalRepresentation)
     122{
     123    if (!m_value)
     124        return E_POINTER;
     125
     126    *internalRepresentation = m_value.get();
     127    return S_OK;
     128}
     129
  • trunk/WebKit/win/WebSerializedJSValue.h

    r69415 r69524  
    4545    virtual HRESULT STDMETHODCALLTYPE deserialize(JSContextRef, JSValueRef* result);
    4646    virtual HRESULT STDMETHODCALLTYPE setInternalRepresentation(void* internalRepresentation);
     47    virtual HRESULT STDMETHODCALLTYPE getInternalRepresentation(void** internalRepresentation);
    4748
    4849private:
  • trunk/WebKit2/ChangeLog

    r69511 r69524  
     12010-10-11  Jessie Berlin  <jberlin@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Add Private API for creating a WebKit2 WebSerializedScriptValue from the internal
     6        representation of a WebKit1 WebSerializedJSValue.
     7        https://bugs.webkit.org/show_bug.cgi?id=47439
     8
     9        * Shared/API/c/WKSerializedScriptValue.cpp:
     10        (WKSerializedScriptValueCreateWithInternalRepresentation):
     11        Use the existing WebSerializedScriptValue constructor that takes a pointer to the internal
     12        representation (a WebCore::SerializedScriptValue).
     13        * Shared/API/c/WKSerializedScriptValuePrivate.h:
     14
    1152010-10-11  Mike Thole  <mthole@apple.com>
    216
  • trunk/WebKit2/Shared/API/c/WKSerializedScriptValue.cpp

    r69415 r69524  
    4343}
    4444
     45WKSerializedScriptValueRef WKSerializedScriptValueCreateWithInternalRepresentation(void* internalRepresentation)
     46{
     47    RefPtr<WebSerializedScriptValue> serializedValue = WebSerializedScriptValue::create(static_cast<WebCore::SerializedScriptValue*>(internalRepresentation));
     48    return toAPI(serializedValue.release().leakRef());
     49}
     50
    4551JSValueRef WKSerializedScriptValueDeserialize(WKSerializedScriptValueRef scriptValueRef, JSContextRef contextRef, JSValueRef* exception)
    4652{
  • trunk/WebKit2/Shared/API/c/WKSerializedScriptValuePrivate.h

    r69415 r69524  
    3434
    3535WK_EXPORT void* WKSerializedScriptValueGetInternalRepresentation(WKSerializedScriptValueRef scriptValueRef);
     36WK_EXPORT WKSerializedScriptValueRef WKSerializedScriptValueCreateWithInternalRepresentation(void*);
    3637
    3738#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.