[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.16-1409-g5afdf4d
oliver at apple.com
oliver at apple.com
Thu Dec 3 13:41:37 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 01bb6866e14cca30854cea452d903fb81a436f53
Author: oliver at apple.com <oliver at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Nov 20 21:32:03 2009 +0000
<rdar://7409188> WebKit needs to be able to serialize and deserialize objects.
Reviewed by Dave Hyatt.
Expose WebCore object serialization to WebKit.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51256 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 789a19c..8064b55 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2009-11-20 Oliver Hunt <oliver at apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ <rdar://7409188> WebKit needs to be able to serialize and deserialize objects.
+
+ Expose WebCore object serialization to WebKit.
+
+ * WebCore.base.exp:
+ * bindings/js/SerializedScriptValue.cpp:
+ (WebCore::SerializedScriptValue::~SerializedScriptValue):
+ (WebCore::SerializedScriptValue::create):
+ (WebCore::SerializedScriptValue::deserialize):
+ * bindings/js/SerializedScriptValue.h:
+
2009-11-20 Brian Weinstein <bweinstein at apple.com>
Reviewed by Tim Hatcher.
diff --git a/WebCore/WebCore.base.exp b/WebCore/WebCore.base.exp
index d8b9932..3aeaf07 100644
--- a/WebCore/WebCore.base.exp
+++ b/WebCore/WebCore.base.exp
@@ -416,6 +416,9 @@ __ZN7WebCore21JavaScriptDebugServer23recompileAllJSFunctionsEPNS_5TimerIS0_EE
__ZN7WebCore21JavaScriptDebugServer6sharedEv
__ZN7WebCore21PlatformKeyboardEvent24disambiguateKeyDownEventENS0_4TypeEb
__ZN7WebCore21PlatformKeyboardEventC1EP7NSEvent
+__ZN7WebCore21SerializedScriptValue11deserializeEPK15OpaqueJSContextPPK13OpaqueJSValue
+__ZN7WebCore21SerializedScriptValue6createEPK15OpaqueJSContextPK13OpaqueJSValuePS6_
+__ZN7WebCore21SerializedScriptValueD1Ev
__ZN7WebCore21WindowsLatin1EncodingEv
__ZN7WebCore21findEventWithKeyStateEPNS_5EventE
__ZN7WebCore21isBackForwardLoadTypeENS_13FrameLoadTypeE
diff --git a/WebCore/bindings/js/SerializedScriptValue.cpp b/WebCore/bindings/js/SerializedScriptValue.cpp
index 48cd92d..2e17c19 100644
--- a/WebCore/bindings/js/SerializedScriptValue.cpp
+++ b/WebCore/bindings/js/SerializedScriptValue.cpp
@@ -27,6 +27,7 @@
#include "config.h"
#include "SerializedScriptValue.h"
+#include <JavaScriptCore/APICast.h>
#include <runtime/DateInstance.h>
#include <runtime/ExceptionHelpers.h>
#include <runtime/PropertyNameArray.h>
@@ -836,4 +837,36 @@ void SerializedScriptValueData::tearDownSerializedData()
walk<TeardownTreeWalker>(context, *this);
}
+SerializedScriptValue::~SerializedScriptValue()
+{
+}
+
+PassRefPtr<SerializedScriptValue> SerializedScriptValue::create(JSContextRef originContext, JSValueRef apiValue, JSValueRef* exception)
+{
+ ExecState* exec = toJS(originContext);
+ JSValue value = toJS(exec, apiValue);
+ PassRefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create(exec, value);
+ if (exec->hadException()) {
+ if (exception)
+ *exception = toRef(exec, exec->exception());
+ exec->clearException();
+ return 0;
+ }
+
+ return serializedValue;
+}
+
+JSValueRef SerializedScriptValue::deserialize(JSContextRef destinationContext, JSValueRef* exception)
+{
+ ExecState* exec = toJS(destinationContext);
+ JSValue value = deserialize(exec);
+ if (exec->hadException()) {
+ if (exception)
+ *exception = toRef(exec, exec->exception());
+ exec->clearException();
+ return 0;
+ }
+ return toRef(exec, value);
+}
+
}
diff --git a/WebCore/bindings/js/SerializedScriptValue.h b/WebCore/bindings/js/SerializedScriptValue.h
index f8a126f..3eb37ed 100644
--- a/WebCore/bindings/js/SerializedScriptValue.h
+++ b/WebCore/bindings/js/SerializedScriptValue.h
@@ -29,6 +29,9 @@
#include "ScriptValue.h"
+typedef const struct OpaqueJSContext* JSContextRef;
+typedef const struct OpaqueJSValue* JSValueRef;
+
namespace WebCore {
class SerializedObject;
class SerializedArray;
@@ -150,6 +153,8 @@ namespace WebCore {
return adoptRef(new SerializedScriptValue(SerializedScriptValueData::serialize(exec, value)));
}
+ static PassRefPtr<SerializedScriptValue> create(JSContextRef, JSValueRef value, JSValueRef* exception);
+
static PassRefPtr<SerializedScriptValue> create(String string)
{
return adoptRef(new SerializedScriptValue(SerializedScriptValueData(string)));
@@ -182,7 +187,8 @@ namespace WebCore {
return m_value.deserialize(exec, m_mustCopy);
}
- ~SerializedScriptValue() {}
+ JSValueRef deserialize(JSContextRef, JSValueRef* exception);
+ ~SerializedScriptValue();
private:
SerializedScriptValue(SerializedScriptValueData value)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list