WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-93315-20120808103236.patch (text/plain), 11.05 KB, created by
Kentaro Hara
on 2012-08-07 18:33:02 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Kentaro Hara
Created:
2012-08-07 18:33:02 PDT
Size:
11.05 KB
patch
obsolete
>Subversion Revision: 124820 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 0b904bb70d7ed5f82fae1615cdc4aca6e14a68e0..1e25eb2fc35f0c7182604d8ebea2b1d137c61f47 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,47 @@ >+2012-08-06 Kentaro Hara <haraken@chromium.org> >+ >+ [V8] Pass Isolate to ArrayValue and Dictionary >+ https://bugs.webkit.org/show_bug.cgi?id=93315 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch passes Isolate to ArrayValue and Dictionary. >+ >+ Rationale 1: We want to replace V8Proxy::throwError(ExceptionCode) >+ with setDOMException(ExceptionCode, Isolate*). For the replacement, >+ we need to pass Isolate to V8Utilities::extractTransferables(). >+ To pass Isolate to V8Utilities::extractTransferables(), ( ...omitted... ), >+ we need to pass Isolate to ArrayValue and Dictionary. >+ >+ Rationale 2: JSC already passes ExecState to ArrayValue and Dictionary. >+ >+ Tests: storage/indexeddb/* >+ fast/files/* >+ >+ * bindings/scripts/CodeGeneratorV8.pm: >+ (GenerateEventConstructorCallback): >+ (JSValueToNative): >+ * bindings/scripts/test/V8/V8TestEventConstructor.cpp: >+ (WebCore::V8TestEventConstructor::constructorCallback): >+ * bindings/scripts/test/V8/V8TestObj.cpp: >+ (WebCore::TestObjV8Internal::optionsObjectCallback): >+ * bindings/v8/ArrayValue.cpp: >+ (WebCore::ArrayValue::operator=): >+ (WebCore::ArrayValue::get): >+ * bindings/v8/ArrayValue.h: >+ (WebCore::ArrayValue::ArrayValue): >+ (ArrayValue): >+ * bindings/v8/Dictionary.cpp: >+ (WebCore::Dictionary::Dictionary): >+ (WebCore::Dictionary::operator=): >+ (WebCore::Dictionary::get): >+ * bindings/v8/Dictionary.h: >+ (Dictionary): >+ * bindings/v8/custom/V8BlobCustom.cpp: >+ (WebCore::V8Blob::constructorCallback): >+ * bindings/v8/custom/V8IntentConstructor.cpp: >+ (WebCore::V8Intent::constructorCallback): >+ > 2012-08-06 Max Vujovic <mvujovic@adobe.com> > > [CSS Shaders] Parse mix function >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm >index 6f16fec8f538064b2be9615d952e019f5209ab84..cbffc6b29ef7aad6b0cef836b77dd75c7839cbda 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm >@@ -1892,7 +1892,7 @@ v8::Handle<v8::Value> V8${implClassName}::constructorCallback(const v8::Argument > STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, type, args[0]); > ${implClassName}Init eventInit; > if (args.Length() >= 2) { >- EXCEPTION_BLOCK(Dictionary, options, args[1]); >+ EXCEPTION_BLOCK(Dictionary, options, Dictionary(args[1], args.GetIsolate())); > if (!fill${implClassName}Init(eventInit, options)) > return v8Undefined(); > } >@@ -3727,7 +3727,7 @@ sub JSValueToNative > > if ($type eq "Dictionary") { > AddToImplIncludes("Dictionary.h"); >- return $value; >+ return "Dictionary($value, $getIsolate)"; > } > > if ($type eq "DOMObject") { >diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp >index 21073501fd0ba22edcdc5c5a3bca333cad8d39cb..229367545f76ea7e2b4ef4cd00b4494e595347de 100644 >--- a/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp >+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp >@@ -79,7 +79,7 @@ v8::Handle<v8::Value> V8TestEventConstructor::constructorCallback(const v8::Argu > STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, type, args[0]); > TestEventConstructorInit eventInit; > if (args.Length() >= 2) { >- EXCEPTION_BLOCK(Dictionary, options, args[1]); >+ EXCEPTION_BLOCK(Dictionary, options, Dictionary(args[1], args.GetIsolate())); > if (!fillTestEventConstructorInit(eventInit, options)) > return v8Undefined(); > } >diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp >index 608a48fdcf879985bbc9804cc5711d96715b4d70..1d057fd2595dd45ff7d5394beedddbfb7245aee5 100644 >--- a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp >+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp >@@ -1181,14 +1181,14 @@ static v8::Handle<v8::Value> optionsObjectCallback(const v8::Arguments& args) > if (args.Length() < 1) > return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate()); > TestObj* imp = V8TestObj::toNative(args.Holder()); >- EXCEPTION_BLOCK(Dictionary, oo, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)); >+ EXCEPTION_BLOCK(Dictionary, oo, Dictionary(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined), args.GetIsolate())); > if (!oo.isUndefinedOrNull() && !oo.isObject()) > return V8Proxy::throwTypeError("Not an object.", args.GetIsolate()); > if (args.Length() <= 1) { > imp->optionsObject(oo); > return v8Undefined(); > } >- EXCEPTION_BLOCK(Dictionary, ooo, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)); >+ EXCEPTION_BLOCK(Dictionary, ooo, Dictionary(MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined), args.GetIsolate())); > if (!ooo.isUndefinedOrNull() && !ooo.isObject()) > return V8Proxy::throwTypeError("Not an object.", args.GetIsolate()); > imp->optionsObject(oo, ooo); >diff --git a/Source/WebCore/bindings/v8/ArrayValue.cpp b/Source/WebCore/bindings/v8/ArrayValue.cpp >index f9900789e670668773133b569a05815a870ba6f2..540f5e1aea76983a8b97513ec9110a42de52d9c8 100644 >--- a/Source/WebCore/bindings/v8/ArrayValue.cpp >+++ b/Source/WebCore/bindings/v8/ArrayValue.cpp >@@ -34,6 +34,7 @@ namespace WebCore { > ArrayValue& ArrayValue::operator=(const ArrayValue& other) > { > m_array = other.m_array; >+ m_isolate = other.m_isolate; > return *this; > } > >@@ -63,7 +64,9 @@ bool ArrayValue::get(size_t index, Dictionary& value) const > if (indexedValue.IsEmpty() || !indexedValue->IsObject()) > return false; > >- value = Dictionary(indexedValue); >+ ASSERT(m_isolate); >+ ASSERT(m_isolate == v8::Isolate::GetCurrent()); >+ value = Dictionary(indexedValue, m_isolate); > return true; > } > >diff --git a/Source/WebCore/bindings/v8/ArrayValue.h b/Source/WebCore/bindings/v8/ArrayValue.h >index be01541df865515eb63f54040590fd00254da2c3..dc9cf69778a2dce0d026156dab8db80e5c728c49 100644 >--- a/Source/WebCore/bindings/v8/ArrayValue.h >+++ b/Source/WebCore/bindings/v8/ArrayValue.h >@@ -34,8 +34,13 @@ class Dictionary; > > class ArrayValue { > public: >- ArrayValue() { } >- explicit ArrayValue(const v8::Local<v8::Array>& array) : m_array(array) { } >+ ArrayValue() : m_isolate(0) { } >+ explicit ArrayValue(const v8::Local<v8::Array>& array, v8::Isolate* isolate) >+ : m_array(array) >+ , m_isolate(isolate) >+ { >+ ASSERT(m_isolate); >+ } > ~ArrayValue() { } > > ArrayValue& operator=(const ArrayValue&); >@@ -52,6 +57,7 @@ private: > static void operator delete(void *); > > v8::Local<v8::Array> m_array; >+ v8::Isolate* m_isolate; > }; > > } >diff --git a/Source/WebCore/bindings/v8/Dictionary.cpp b/Source/WebCore/bindings/v8/Dictionary.cpp >index 6cf56791ee1b4556555af98b1df14346d2af53c6..7d36c8ec1a6987a6ce3a88d2e084e76c5e0eb3e8 100644 >--- a/Source/WebCore/bindings/v8/Dictionary.cpp >+++ b/Source/WebCore/bindings/v8/Dictionary.cpp >@@ -61,12 +61,15 @@ > namespace WebCore { > > Dictionary::Dictionary() >+ : m_isolate(0) > { > } > >-Dictionary::Dictionary(const v8::Local<v8::Value>& options) >+Dictionary::Dictionary(const v8::Local<v8::Value>& options, v8::Isolate* isolate) > : m_options(options) >+ , m_isolate(isolate) > { >+ ASSERT(m_isolate); > } > > Dictionary::~Dictionary() >@@ -76,6 +79,7 @@ Dictionary::~Dictionary() > Dictionary& Dictionary::operator=(const Dictionary& optionsObject) > { > m_options = optionsObject.m_options; >+ m_isolate = optionsObject.m_isolate; > return *this; > } > >@@ -419,8 +423,11 @@ bool Dictionary::get(const String& key, Dictionary& value) const > if (!getKey(key, v8Value)) > return false; > >- if (v8Value->IsObject()) >- value = Dictionary(v8Value); >+ if (v8Value->IsObject()) { >+ ASSERT(m_isolate); >+ ASSERT(m_isolate == v8::Isolate::GetCurrent()); >+ value = Dictionary(v8Value, m_isolate); >+ } > > return true; > } >@@ -452,7 +459,9 @@ bool Dictionary::get(const String& key, ArrayValue& value) const > if (!v8Value->IsArray()) > return false; > >- value = ArrayValue(v8::Local<v8::Array>::Cast(v8Value)); >+ ASSERT(m_isolate); >+ ASSERT(m_isolate == v8::Isolate::GetCurrent()); >+ value = ArrayValue(v8::Local<v8::Array>::Cast(v8Value), m_isolate); > return true; > } > >diff --git a/Source/WebCore/bindings/v8/Dictionary.h b/Source/WebCore/bindings/v8/Dictionary.h >index 192b31f72d402c1310e5fcacdf1b7d1aeb44599f..8373c7b28d3a2412bd66c3c097bc9b44d7451054 100644 >--- a/Source/WebCore/bindings/v8/Dictionary.h >+++ b/Source/WebCore/bindings/v8/Dictionary.h >@@ -52,7 +52,7 @@ class TrackBase; > class Dictionary { > public: > Dictionary(); >- Dictionary(const v8::Local<v8::Value>& options); >+ Dictionary(const v8::Local<v8::Value>& options, v8::Isolate*); > ~Dictionary(); > > Dictionary& operator=(const Dictionary&); >@@ -104,6 +104,7 @@ private: > static void operator delete(void *); > > v8::Local<v8::Value> m_options; >+ v8::Isolate* m_isolate; > }; > > } >diff --git a/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp b/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp >index bac3b0f20954e90930096fb557cfefbb7370c286..ec5ab3f221e484928059f586c52fe5faf49e9744 100644 >--- a/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp >@@ -87,7 +87,7 @@ v8::Handle<v8::Value> V8Blob::constructorCallback(const v8::Arguments& args) > if (!args[1]->IsObject()) > return V8Proxy::throwTypeError("Second argument of the constructor is not of type Object", args.GetIsolate()); > >- Dictionary dictionary(args[1]); >+ EXCEPTION_BLOCK(Dictionary, dictionary, Dictionary(args[1], args.GetIsolate())); > > v8::TryCatch tryCatchEndings; > bool containsEndings = dictionary.get("endings", endings); >diff --git a/Source/WebCore/bindings/v8/custom/V8IntentConstructor.cpp b/Source/WebCore/bindings/v8/custom/V8IntentConstructor.cpp >index 79d4d24fdfbec74c2a99da80eb335346c06d92de..991dfdb9f62d3f420253295f55cf987695a3fcdc 100644 >--- a/Source/WebCore/bindings/v8/custom/V8IntentConstructor.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8IntentConstructor.cpp >@@ -57,7 +57,7 @@ v8::Handle<v8::Value> V8Intent::constructorCallback(const v8::Arguments& args) > if (args.Length() == 1) { > // Use the dictionary constructor. This block will return if the > // argument isn't a valid Dictionary. >- EXCEPTION_BLOCK(Dictionary, options, args[0]); >+ EXCEPTION_BLOCK(Dictionary, options, Dictionary(args[0], args.GetIsolate())); > ExceptionCode ec = 0; > RefPtr<Intent> impl = Intent::create(ScriptState::current(), options, ec); > if (ec)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 93315
:
156818
|
156825
|
157078
| 157079