Use APIEntryShim instead of JSLock in SerializedScriptValue.
Source/JavaScriptCore: Make APIShims usable from WebCore.
Reviewed by Oliver Hunt.
* ForwardingHeaders/JavaScriptCore/APIShims.h: Added.
* GNUmakefile.am:
* JavaScriptCore.exp:
* JavaScriptCore.gypi:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
Source/WebCore: Use APIEntryShim instead of JSLock in SerializedScriptValue to allow it to be used
by contexts not created by WebCore.
https://webkit.org/b/55642
Reviewed by Oliver Hunt.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::create): Use APIEntryShim instead of JSLock.
(WebCore::SerializedScriptValue::deserialize): Ditto.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80254 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/bindings/js/SerializedScriptValue.cpp b/Source/WebCore/bindings/js/SerializedScriptValue.cpp
index 41ad198..b3d07ca 100644
--- a/Source/WebCore/bindings/js/SerializedScriptValue.cpp
+++ b/Source/WebCore/bindings/js/SerializedScriptValue.cpp
@@ -39,10 +39,10 @@
#include "SharedBuffer.h"
#include <limits>
#include <JavaScriptCore/APICast.h>
+#include <JavaScriptCore/APIShims.h>
#include <runtime/DateInstance.h>
#include <runtime/Error.h>
#include <runtime/ExceptionHelpers.h>
-#include <runtime/JSLock.h>
#include <runtime/PropertyNameArray.h>
#include <runtime/RegExp.h>
#include <runtime/RegExpObject.h>
@@ -1381,8 +1381,8 @@
PassRefPtr<SerializedScriptValue> SerializedScriptValue::create(JSContextRef originContext, JSValueRef apiValue, JSValueRef* exception)
{
- JSLock lock(SilenceAssertionsOnly);
ExecState* exec = toJS(originContext);
+ APIEntryShim entryShim(exec);
JSValue value = toJS(exec, apiValue);
PassRefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create(exec, value);
if (exec->hadException()) {
@@ -1407,8 +1407,8 @@
JSValueRef SerializedScriptValue::deserialize(JSContextRef destinationContext, JSValueRef* exception)
{
- JSLock lock(SilenceAssertionsOnly);
ExecState* exec = toJS(destinationContext);
+ APIEntryShim entryShim(exec);
JSValue value = deserialize(exec, exec->lexicalGlobalObject());
if (exec->hadException()) {
if (exception)