Changeset 51256 in webkit
- Timestamp:
- Nov 20, 2009 1:32:03 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r51255 r51256 1 2009-11-20 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 <rdar://7409188> WebKit needs to be able to serialize and deserialize objects. 6 7 Expose WebCore object serialization to WebKit. 8 9 * WebCore.base.exp: 10 * bindings/js/SerializedScriptValue.cpp: 11 (WebCore::SerializedScriptValue::~SerializedScriptValue): 12 (WebCore::SerializedScriptValue::create): 13 (WebCore::SerializedScriptValue::deserialize): 14 * bindings/js/SerializedScriptValue.h: 15 1 16 2009-11-20 Brian Weinstein <bweinstein@apple.com> 2 17 -
trunk/WebCore/WebCore.base.exp
r51191 r51256 417 417 __ZN7WebCore21PlatformKeyboardEvent24disambiguateKeyDownEventENS0_4TypeEb 418 418 __ZN7WebCore21PlatformKeyboardEventC1EP7NSEvent 419 __ZN7WebCore21SerializedScriptValue11deserializeEPK15OpaqueJSContextPPK13OpaqueJSValue 420 __ZN7WebCore21SerializedScriptValue6createEPK15OpaqueJSContextPK13OpaqueJSValuePS6_ 421 __ZN7WebCore21SerializedScriptValueD1Ev 419 422 __ZN7WebCore21WindowsLatin1EncodingEv 420 423 __ZN7WebCore21findEventWithKeyStateEPNS_5EventE -
trunk/WebCore/bindings/js/SerializedScriptValue.cpp
r49216 r51256 28 28 #include "SerializedScriptValue.h" 29 29 30 #include <JavaScriptCore/APICast.h> 30 31 #include <runtime/DateInstance.h> 31 32 #include <runtime/ExceptionHelpers.h> … … 837 838 } 838 839 839 } 840 SerializedScriptValue::~SerializedScriptValue() 841 { 842 } 843 844 PassRefPtr<SerializedScriptValue> SerializedScriptValue::create(JSContextRef originContext, JSValueRef apiValue, JSValueRef* exception) 845 { 846 ExecState* exec = toJS(originContext); 847 JSValue value = toJS(exec, apiValue); 848 PassRefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create(exec, value); 849 if (exec->hadException()) { 850 if (exception) 851 *exception = toRef(exec, exec->exception()); 852 exec->clearException(); 853 return 0; 854 } 855 856 return serializedValue; 857 } 858 859 JSValueRef SerializedScriptValue::deserialize(JSContextRef destinationContext, JSValueRef* exception) 860 { 861 ExecState* exec = toJS(destinationContext); 862 JSValue value = deserialize(exec); 863 if (exec->hadException()) { 864 if (exception) 865 *exception = toRef(exec, exec->exception()); 866 exec->clearException(); 867 return 0; 868 } 869 return toRef(exec, value); 870 } 871 872 } -
trunk/WebCore/bindings/js/SerializedScriptValue.h
r49216 r51256 30 30 #include "ScriptValue.h" 31 31 32 typedef const struct OpaqueJSContext* JSContextRef; 33 typedef const struct OpaqueJSValue* JSValueRef; 34 32 35 namespace WebCore { 33 36 class SerializedObject; … … 151 154 } 152 155 156 static PassRefPtr<SerializedScriptValue> create(JSContextRef, JSValueRef value, JSValueRef* exception); 157 153 158 static PassRefPtr<SerializedScriptValue> create(String string) 154 159 { … … 183 188 } 184 189 185 ~SerializedScriptValue() {} 190 JSValueRef deserialize(JSContextRef, JSValueRef* exception); 191 ~SerializedScriptValue(); 186 192 187 193 private:
Note: See TracChangeset
for help on using the changeset viewer.