Commit dacf56ce authored by vartul.k@samsung.com's avatar vartul.k@samsung.com

v8::Handle should be replaced with v8::Local in Source/bindings/modules

v8::Handle<T> is just an alias of v8::Local<T>

BUG=424445

Review URL: https://codereview.chromium.org/660243003

git-svn-id: svn://svn.chromium.org/blink/trunk@183938 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 5882af00
...@@ -53,9 +53,9 @@ ...@@ -53,9 +53,9 @@
namespace blink { namespace blink {
static v8::Handle<v8::Value> deserializeIDBValueBuffer(v8::Isolate*, SharedBuffer*, const Vector<blink::WebBlobInfo>*); static v8::Local<v8::Value> deserializeIDBValueBuffer(v8::Isolate*, SharedBuffer*, const Vector<blink::WebBlobInfo>*);
static v8::Handle<v8::Value> toV8(const IDBKeyPath& value, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) static v8::Local<v8::Value> toV8(const IDBKeyPath& value, v8::Local<v8::Object> creationContext, v8::Isolate* isolate)
{ {
switch (value.type()) { switch (value.type()) {
case IDBKeyPath::NullType: case IDBKeyPath::NullType:
...@@ -72,7 +72,7 @@ static v8::Handle<v8::Value> toV8(const IDBKeyPath& value, v8::Handle<v8::Object ...@@ -72,7 +72,7 @@ static v8::Handle<v8::Value> toV8(const IDBKeyPath& value, v8::Handle<v8::Object
return v8::Undefined(isolate); return v8::Undefined(isolate);
} }
static v8::Handle<v8::Value> toV8(const IDBKey* key, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) static v8::Local<v8::Value> toV8(const IDBKey* key, v8::Local<v8::Object> creationContext, v8::Isolate* isolate)
{ {
if (!key) { if (!key) {
// This should be undefined, not null. // This should be undefined, not null.
...@@ -106,7 +106,7 @@ static v8::Handle<v8::Value> toV8(const IDBKey* key, v8::Handle<v8::Object> crea ...@@ -106,7 +106,7 @@ static v8::Handle<v8::Value> toV8(const IDBKey* key, v8::Handle<v8::Object> crea
return v8Undefined(); return v8Undefined();
} }
static v8::Handle<v8::Value> toV8(const IDBAny* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) static v8::Local<v8::Value> toV8(const IDBAny* impl, v8::Local<v8::Object> creationContext, v8::Isolate* isolate)
{ {
if (!impl) if (!impl)
return v8::Null(isolate); return v8::Null(isolate);
...@@ -121,8 +121,8 @@ static v8::Handle<v8::Value> toV8(const IDBAny* impl, v8::Handle<v8::Object> cre ...@@ -121,8 +121,8 @@ static v8::Handle<v8::Value> toV8(const IDBAny* impl, v8::Handle<v8::Object> cre
case IDBAny::IDBCursorType: { case IDBAny::IDBCursorType: {
// Ensure request wrapper is kept alive at least as long as the cursor wrapper, // Ensure request wrapper is kept alive at least as long as the cursor wrapper,
// so that event listeners are retained. // so that event listeners are retained.
v8::Handle<v8::Value> cursor = toV8(impl->idbCursor(), creationContext, isolate); v8::Local<v8::Value> cursor = toV8(impl->idbCursor(), creationContext, isolate);
v8::Handle<v8::Value> request = toV8(impl->idbCursor()->request(), creationContext, isolate); v8::Local<v8::Value> request = toV8(impl->idbCursor()->request(), creationContext, isolate);
// FIXME: Due to race at worker shutdown, V8 may return empty handles. // FIXME: Due to race at worker shutdown, V8 may return empty handles.
if (!cursor.IsEmpty()) if (!cursor.IsEmpty())
...@@ -132,8 +132,8 @@ static v8::Handle<v8::Value> toV8(const IDBAny* impl, v8::Handle<v8::Object> cre ...@@ -132,8 +132,8 @@ static v8::Handle<v8::Value> toV8(const IDBAny* impl, v8::Handle<v8::Object> cre
case IDBAny::IDBCursorWithValueType: { case IDBAny::IDBCursorWithValueType: {
// Ensure request wrapper is kept alive at least as long as the cursor wrapper, // Ensure request wrapper is kept alive at least as long as the cursor wrapper,
// so that event listeners are retained. // so that event listeners are retained.
v8::Handle<v8::Value> cursor = toV8(impl->idbCursorWithValue(), creationContext, isolate); v8::Local<v8::Value> cursor = toV8(impl->idbCursorWithValue(), creationContext, isolate);
v8::Handle<v8::Value> request = toV8(impl->idbCursorWithValue()->request(), creationContext, isolate); v8::Local<v8::Value> request = toV8(impl->idbCursorWithValue()->request(), creationContext, isolate);
// FIXME: Due to race at worker shutdown, V8 may return empty handles. // FIXME: Due to race at worker shutdown, V8 may return empty handles.
if (!cursor.IsEmpty()) if (!cursor.IsEmpty())
...@@ -159,8 +159,8 @@ static v8::Handle<v8::Value> toV8(const IDBAny* impl, v8::Handle<v8::Object> cre ...@@ -159,8 +159,8 @@ static v8::Handle<v8::Value> toV8(const IDBAny* impl, v8::Handle<v8::Object> cre
case IDBAny::KeyPathType: case IDBAny::KeyPathType:
return toV8(impl->keyPath(), creationContext, isolate); return toV8(impl->keyPath(), creationContext, isolate);
case IDBAny::BufferKeyAndKeyPathType: { case IDBAny::BufferKeyAndKeyPathType: {
v8::Handle<v8::Value> value = deserializeIDBValueBuffer(isolate, impl->buffer(), impl->blobInfo()); v8::Local<v8::Value> value = deserializeIDBValueBuffer(isolate, impl->buffer(), impl->blobInfo());
v8::Handle<v8::Value> key = toV8(impl->key(), creationContext, isolate); v8::Local<v8::Value> key = toV8(impl->key(), creationContext, isolate);
bool injected = injectV8KeyIntoV8Value(isolate, key, value, impl->keyPath()); bool injected = injectV8KeyIntoV8Value(isolate, key, value, impl->keyPath());
ASSERT_UNUSED(injected, injected); ASSERT_UNUSED(injected, injected);
return value; return value;
...@@ -173,7 +173,7 @@ static v8::Handle<v8::Value> toV8(const IDBAny* impl, v8::Handle<v8::Object> cre ...@@ -173,7 +173,7 @@ static v8::Handle<v8::Value> toV8(const IDBAny* impl, v8::Handle<v8::Object> cre
static const size_t maximumDepth = 2000; static const size_t maximumDepth = 2000;
static IDBKey* createIDBKeyFromValue(v8::Isolate* isolate, v8::Handle<v8::Value> value, Vector<v8::Handle<v8::Array> >& stack, bool allowExperimentalTypes = false) static IDBKey* createIDBKeyFromValue(v8::Isolate* isolate, v8::Local<v8::Value> value, Vector<v8::Local<v8::Array> >& stack, bool allowExperimentalTypes = false)
{ {
if (value->IsNumber() && !std::isnan(value->NumberValue())) if (value->IsNumber() && !std::isnan(value->NumberValue()))
return IDBKey::createNumber(value->NumberValue()); return IDBKey::createNumber(value->NumberValue());
...@@ -190,7 +190,7 @@ static IDBKey* createIDBKeyFromValue(v8::Isolate* isolate, v8::Handle<v8::Value> ...@@ -190,7 +190,7 @@ static IDBKey* createIDBKeyFromValue(v8::Isolate* isolate, v8::Handle<v8::Value>
return IDBKey::createBinary(SharedBuffer::create(start, length)); return IDBKey::createBinary(SharedBuffer::create(start, length));
} }
if (value->IsArray()) { if (value->IsArray()) {
v8::Handle<v8::Array> array = v8::Handle<v8::Array>::Cast(value); v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(value);
if (stack.contains(array)) if (stack.contains(array))
return 0; return 0;
...@@ -215,16 +215,16 @@ static IDBKey* createIDBKeyFromValue(v8::Isolate* isolate, v8::Handle<v8::Value> ...@@ -215,16 +215,16 @@ static IDBKey* createIDBKeyFromValue(v8::Isolate* isolate, v8::Handle<v8::Value>
return 0; return 0;
} }
static IDBKey* createIDBKeyFromValue(v8::Isolate* isolate, v8::Handle<v8::Value> value, bool allowExperimentalTypes = false) static IDBKey* createIDBKeyFromValue(v8::Isolate* isolate, v8::Local<v8::Value> value, bool allowExperimentalTypes = false)
{ {
Vector<v8::Handle<v8::Array> > stack; Vector<v8::Local<v8::Array> > stack;
if (IDBKey* key = createIDBKeyFromValue(isolate, value, stack, allowExperimentalTypes)) if (IDBKey* key = createIDBKeyFromValue(isolate, value, stack, allowExperimentalTypes))
return key; return key;
return IDBKey::createInvalid(); return IDBKey::createInvalid();
} }
template<typename T> template<typename T>
static bool getValueFrom(T indexOrName, v8::Handle<v8::Value>& v8Value) static bool getValueFrom(T indexOrName, v8::Local<v8::Value>& v8Value)
{ {
v8::Local<v8::Object> object = v8Value->ToObject(); v8::Local<v8::Object> object = v8Value->ToObject();
if (!object->Has(indexOrName)) if (!object->Has(indexOrName))
...@@ -234,38 +234,38 @@ static bool getValueFrom(T indexOrName, v8::Handle<v8::Value>& v8Value) ...@@ -234,38 +234,38 @@ static bool getValueFrom(T indexOrName, v8::Handle<v8::Value>& v8Value)
} }
template<typename T> template<typename T>
static bool setValue(v8::Handle<v8::Value>& v8Object, T indexOrName, const v8::Handle<v8::Value>& v8Value) static bool setValue(v8::Local<v8::Value>& v8Object, T indexOrName, const v8::Local<v8::Value>& v8Value)
{ {
v8::Local<v8::Object> object = v8Object->ToObject(); v8::Local<v8::Object> object = v8Object->ToObject();
return object->Set(indexOrName, v8Value); return object->Set(indexOrName, v8Value);
} }
static bool get(v8::Isolate* isolate, v8::Handle<v8::Value>& object, const String& keyPathElement, v8::Handle<v8::Value>& result) static bool get(v8::Isolate* isolate, v8::Local<v8::Value>& object, const String& keyPathElement, v8::Local<v8::Value>& result)
{ {
if (object->IsString() && keyPathElement == "length") { if (object->IsString() && keyPathElement == "length") {
int32_t length = v8::Handle<v8::String>::Cast(object)->Length(); int32_t length = v8::Local<v8::String>::Cast(object)->Length();
result = v8::Number::New(isolate, length); result = v8::Number::New(isolate, length);
return true; return true;
} }
return object->IsObject() && getValueFrom(v8String(isolate, keyPathElement), result); return object->IsObject() && getValueFrom(v8String(isolate, keyPathElement), result);
} }
static bool canSet(v8::Handle<v8::Value>& object, const String& keyPathElement) static bool canSet(v8::Local<v8::Value>& object, const String& keyPathElement)
{ {
return object->IsObject(); return object->IsObject();
} }
static bool set(v8::Isolate* isolate, v8::Handle<v8::Value>& object, const String& keyPathElement, const v8::Handle<v8::Value>& v8Value) static bool set(v8::Isolate* isolate, v8::Local<v8::Value>& object, const String& keyPathElement, const v8::Local<v8::Value>& v8Value)
{ {
return canSet(object, keyPathElement) && setValue(object, v8String(isolate, keyPathElement), v8Value); return canSet(object, keyPathElement) && setValue(object, v8String(isolate, keyPathElement), v8Value);
} }
static v8::Handle<v8::Value> getNthValueOnKeyPath(v8::Isolate* isolate, v8::Handle<v8::Value>& rootValue, const Vector<String>& keyPathElements, size_t index) static v8::Local<v8::Value> getNthValueOnKeyPath(v8::Isolate* isolate, v8::Local<v8::Value>& rootValue, const Vector<String>& keyPathElements, size_t index)
{ {
v8::Handle<v8::Value> currentValue(rootValue); v8::Local<v8::Value> currentValue(rootValue);
ASSERT(index <= keyPathElements.size()); ASSERT(index <= keyPathElements.size());
for (size_t i = 0; i < index; ++i) { for (size_t i = 0; i < index; ++i) {
v8::Handle<v8::Value> parentValue(currentValue); v8::Local<v8::Value> parentValue(currentValue);
if (!get(isolate, parentValue, keyPathElements[i], currentValue)) if (!get(isolate, parentValue, keyPathElements[i], currentValue))
return v8Undefined(); return v8Undefined();
} }
...@@ -273,16 +273,16 @@ static v8::Handle<v8::Value> getNthValueOnKeyPath(v8::Isolate* isolate, v8::Hand ...@@ -273,16 +273,16 @@ static v8::Handle<v8::Value> getNthValueOnKeyPath(v8::Isolate* isolate, v8::Hand
return currentValue; return currentValue;
} }
static bool canInjectNthValueOnKeyPath(v8::Isolate* isolate, v8::Handle<v8::Value>& rootValue, const Vector<String>& keyPathElements, size_t index) static bool canInjectNthValueOnKeyPath(v8::Isolate* isolate, v8::Local<v8::Value>& rootValue, const Vector<String>& keyPathElements, size_t index)
{ {
if (!rootValue->IsObject()) if (!rootValue->IsObject())
return false; return false;
v8::Handle<v8::Value> currentValue(rootValue); v8::Local<v8::Value> currentValue(rootValue);
ASSERT(index <= keyPathElements.size()); ASSERT(index <= keyPathElements.size());
for (size_t i = 0; i < index; ++i) { for (size_t i = 0; i < index; ++i) {
v8::Handle<v8::Value> parentValue(currentValue); v8::Local<v8::Value> parentValue(currentValue);
const String& keyPathElement = keyPathElements[i]; const String& keyPathElement = keyPathElements[i];
if (!get(isolate, parentValue, keyPathElement, currentValue)) if (!get(isolate, parentValue, keyPathElement, currentValue))
return canSet(parentValue, keyPathElement); return canSet(parentValue, keyPathElement);
...@@ -291,16 +291,16 @@ static bool canInjectNthValueOnKeyPath(v8::Isolate* isolate, v8::Handle<v8::Valu ...@@ -291,16 +291,16 @@ static bool canInjectNthValueOnKeyPath(v8::Isolate* isolate, v8::Handle<v8::Valu
} }
static v8::Handle<v8::Value> ensureNthValueOnKeyPath(v8::Isolate* isolate, v8::Handle<v8::Value>& rootValue, const Vector<String>& keyPathElements, size_t index) static v8::Local<v8::Value> ensureNthValueOnKeyPath(v8::Isolate* isolate, v8::Local<v8::Value>& rootValue, const Vector<String>& keyPathElements, size_t index)
{ {
v8::Handle<v8::Value> currentValue(rootValue); v8::Local<v8::Value> currentValue(rootValue);
ASSERT(index <= keyPathElements.size()); ASSERT(index <= keyPathElements.size());
for (size_t i = 0; i < index; ++i) { for (size_t i = 0; i < index; ++i) {
v8::Handle<v8::Value> parentValue(currentValue); v8::Local<v8::Value> parentValue(currentValue);
const String& keyPathElement = keyPathElements[i]; const String& keyPathElement = keyPathElements[i];
if (!get(isolate, parentValue, keyPathElement, currentValue)) { if (!get(isolate, parentValue, keyPathElement, currentValue)) {
v8::Handle<v8::Object> object = v8::Object::New(isolate); v8::Local<v8::Object> object = v8::Object::New(isolate);
if (!set(isolate, parentValue, keyPathElement, object)) if (!set(isolate, parentValue, keyPathElement, object))
return v8Undefined(); return v8Undefined();
currentValue = object; currentValue = object;
...@@ -319,8 +319,8 @@ static IDBKey* createIDBKeyFromScriptValueAndKeyPathInternal(v8::Isolate* isolat ...@@ -319,8 +319,8 @@ static IDBKey* createIDBKeyFromScriptValueAndKeyPathInternal(v8::Isolate* isolat
ASSERT(isolate->InContext()); ASSERT(isolate->InContext());
v8::HandleScope handleScope(isolate); v8::HandleScope handleScope(isolate);
v8::Handle<v8::Value> v8Value(value.v8Value()); v8::Local<v8::Value> v8Value(value.v8Value());
v8::Handle<v8::Value> v8Key(getNthValueOnKeyPath(isolate, v8Value, keyPathElements, keyPathElements.size())); v8::Local<v8::Value> v8Key(getNthValueOnKeyPath(isolate, v8Value, keyPathElements, keyPathElements.size()));
if (v8Key.IsEmpty()) if (v8Key.IsEmpty())
return 0; return 0;
return createIDBKeyFromValue(isolate, v8Key, allowExperimentalTypes); return createIDBKeyFromValue(isolate, v8Key, allowExperimentalTypes);
...@@ -352,7 +352,7 @@ IDBKey* createIDBKeyFromScriptValueAndKeyPath(v8::Isolate* isolate, const Script ...@@ -352,7 +352,7 @@ IDBKey* createIDBKeyFromScriptValueAndKeyPath(v8::Isolate* isolate, const Script
return createIDBKeyFromScriptValueAndKeyPathInternal(isolate, value, keyPath); return createIDBKeyFromScriptValueAndKeyPathInternal(isolate, value, keyPath);
} }
static v8::Handle<v8::Value> deserializeIDBValueBuffer(v8::Isolate* isolate, SharedBuffer* buffer, const Vector<blink::WebBlobInfo>* blobInfo) static v8::Local<v8::Value> deserializeIDBValueBuffer(v8::Isolate* isolate, SharedBuffer* buffer, const Vector<blink::WebBlobInfo>* blobInfo)
{ {
ASSERT(isolate->InContext()); ASSERT(isolate->InContext());
if (!buffer) if (!buffer)
...@@ -365,7 +365,7 @@ static v8::Handle<v8::Value> deserializeIDBValueBuffer(v8::Isolate* isolate, Sha ...@@ -365,7 +365,7 @@ static v8::Handle<v8::Value> deserializeIDBValueBuffer(v8::Isolate* isolate, Sha
return serializedValue->deserialize(isolate, 0, blobInfo); return serializedValue->deserialize(isolate, 0, blobInfo);
} }
bool injectV8KeyIntoV8Value(v8::Isolate* isolate, v8::Handle<v8::Value> key, v8::Handle<v8::Value> value, const IDBKeyPath& keyPath) bool injectV8KeyIntoV8Value(v8::Isolate* isolate, v8::Local<v8::Value> key, v8::Local<v8::Value> value, const IDBKeyPath& keyPath)
{ {
IDB_TRACE("injectIDBV8KeyIntoV8Value"); IDB_TRACE("injectIDBV8KeyIntoV8Value");
ASSERT(isolate->InContext()); ASSERT(isolate->InContext());
...@@ -380,7 +380,7 @@ bool injectV8KeyIntoV8Value(v8::Isolate* isolate, v8::Handle<v8::Value> key, v8: ...@@ -380,7 +380,7 @@ bool injectV8KeyIntoV8Value(v8::Isolate* isolate, v8::Handle<v8::Value> key, v8:
return false; return false;
v8::HandleScope handleScope(isolate); v8::HandleScope handleScope(isolate);
v8::Handle<v8::Value> parent(ensureNthValueOnKeyPath(isolate, value, keyPathElements, keyPathElements.size() - 1)); v8::Local<v8::Value> parent(ensureNthValueOnKeyPath(isolate, value, keyPathElements, keyPathElements.size() - 1));
if (parent.IsEmpty()) if (parent.IsEmpty())
return false; return false;
...@@ -402,7 +402,7 @@ bool canInjectIDBKeyIntoScriptValue(v8::Isolate* isolate, const ScriptValue& scr ...@@ -402,7 +402,7 @@ bool canInjectIDBKeyIntoScriptValue(v8::Isolate* isolate, const ScriptValue& scr
if (!keyPathElements.size()) if (!keyPathElements.size())
return false; return false;
v8::Handle<v8::Value> v8Value(scriptValue.v8Value()); v8::Local<v8::Value> v8Value(scriptValue.v8Value());
return canInjectNthValueOnKeyPath(isolate, v8Value, keyPathElements, keyPathElements.size() - 1); return canInjectNthValueOnKeyPath(isolate, v8Value, keyPathElements, keyPathElements.size() - 1);
} }
...@@ -410,7 +410,7 @@ ScriptValue idbAnyToScriptValue(ScriptState* scriptState, IDBAny* any) ...@@ -410,7 +410,7 @@ ScriptValue idbAnyToScriptValue(ScriptState* scriptState, IDBAny* any)
{ {
v8::Isolate* isolate = scriptState->isolate(); v8::Isolate* isolate = scriptState->isolate();
v8::HandleScope handleScope(isolate); v8::HandleScope handleScope(isolate);
v8::Handle<v8::Value> v8Value(toV8(any, scriptState->context()->Global(), isolate)); v8::Local<v8::Value> v8Value(toV8(any, scriptState->context()->Global(), isolate));
return ScriptValue(scriptState, v8Value); return ScriptValue(scriptState, v8Value);
} }
...@@ -418,7 +418,7 @@ ScriptValue idbKeyToScriptValue(ScriptState* scriptState, IDBKey* key) ...@@ -418,7 +418,7 @@ ScriptValue idbKeyToScriptValue(ScriptState* scriptState, IDBKey* key)
{ {
v8::Isolate* isolate = scriptState->isolate(); v8::Isolate* isolate = scriptState->isolate();
v8::HandleScope handleScope(isolate); v8::HandleScope handleScope(isolate);
v8::Handle<v8::Value> v8Value(toV8(key, scriptState->context()->Global(), isolate)); v8::Local<v8::Value> v8Value(toV8(key, scriptState->context()->Global(), isolate));
return ScriptValue(scriptState, v8Value); return ScriptValue(scriptState, v8Value);
} }
...@@ -426,14 +426,14 @@ IDBKey* scriptValueToIDBKey(v8::Isolate* isolate, const ScriptValue& scriptValue ...@@ -426,14 +426,14 @@ IDBKey* scriptValueToIDBKey(v8::Isolate* isolate, const ScriptValue& scriptValue
{ {
ASSERT(isolate->InContext()); ASSERT(isolate->InContext());
v8::HandleScope handleScope(isolate); v8::HandleScope handleScope(isolate);
v8::Handle<v8::Value> v8Value(scriptValue.v8Value()); v8::Local<v8::Value> v8Value(scriptValue.v8Value());
return createIDBKeyFromValue(isolate, v8Value); return createIDBKeyFromValue(isolate, v8Value);
} }
IDBKeyRange* scriptValueToIDBKeyRange(v8::Isolate* isolate, const ScriptValue& scriptValue) IDBKeyRange* scriptValueToIDBKeyRange(v8::Isolate* isolate, const ScriptValue& scriptValue)
{ {
v8::HandleScope handleScope(isolate); v8::HandleScope handleScope(isolate);
v8::Handle<v8::Value> value(scriptValue.v8Value()); v8::Local<v8::Value> value(scriptValue.v8Value());
return V8IDBKeyRange::toImplWithTypeCheck(isolate, value); return V8IDBKeyRange::toImplWithTypeCheck(isolate, value);
} }
......
...@@ -42,7 +42,7 @@ class SharedBuffer; ...@@ -42,7 +42,7 @@ class SharedBuffer;
class WebBlobInfo; class WebBlobInfo;
// Exposed for unit testing: // Exposed for unit testing:
bool injectV8KeyIntoV8Value(v8::Isolate*, v8::Handle<v8::Value> key, v8::Handle<v8::Value>, const IDBKeyPath&); bool injectV8KeyIntoV8Value(v8::Isolate*, v8::Local<v8::Value> key, v8::Local<v8::Value>, const IDBKeyPath&);
// For use by Source/modules/indexeddb: // For use by Source/modules/indexeddb:
IDBKey* createIDBKeyFromScriptValueAndKeyPath(v8::Isolate*, const ScriptValue&, const IDBKeyPath&); IDBKey* createIDBKeyFromScriptValueAndKeyPath(v8::Isolate*, const ScriptValue&, const IDBKeyPath&);
......
...@@ -44,11 +44,11 @@ void V8Crypto::getRandomValuesMethodCustom(const v8::FunctionCallbackInfo<v8::Va ...@@ -44,11 +44,11 @@ void V8Crypto::getRandomValuesMethodCustom(const v8::FunctionCallbackInfo<v8::Va
return; return;
} }
v8::Handle<v8::Value> buffer = info[0]; v8::Local<v8::Value> buffer = info[0];
if (!V8ArrayBufferView::hasInstance(buffer, info.GetIsolate())) { if (!V8ArrayBufferView::hasInstance(buffer, info.GetIsolate())) {
exceptionState.throwTypeError("First argument is not an ArrayBufferView"); exceptionState.throwTypeError("First argument is not an ArrayBufferView");
} else { } else {
ArrayBufferView* arrayBufferView = V8ArrayBufferView::toImpl(v8::Handle<v8::Object>::Cast(buffer)); ArrayBufferView* arrayBufferView = V8ArrayBufferView::toImpl(v8::Local<v8::Object>::Cast(buffer));
ASSERT(arrayBufferView); ASSERT(arrayBufferView);
Crypto* crypto = V8Crypto::toImpl(info.Holder()); Crypto* crypto = V8Crypto::toImpl(info.Holder());
......
...@@ -15,7 +15,7 @@ namespace blink { ...@@ -15,7 +15,7 @@ namespace blink {
class DictionaryBuilder : public blink::WebCryptoKeyAlgorithmDictionary { class DictionaryBuilder : public blink::WebCryptoKeyAlgorithmDictionary {
public: public:
DictionaryBuilder(v8::Handle<v8::Object> holder, v8::Isolate* isolate) DictionaryBuilder(v8::Local<v8::Object> holder, v8::Isolate* isolate)
: m_holder(holder) : m_holder(holder)
, m_isolate(isolate) , m_isolate(isolate)
, m_dictionary(Dictionary::createEmpty(isolate)) , m_dictionary(Dictionary::createEmpty(isolate))
...@@ -50,7 +50,7 @@ public: ...@@ -50,7 +50,7 @@ public:
const Dictionary& dictionary() const { return m_dictionary; } const Dictionary& dictionary() const { return m_dictionary; }
private: private:
v8::Handle<v8::Object> m_holder; v8::Local<v8::Object> m_holder;
v8::Isolate* m_isolate; v8::Isolate* m_isolate;
Dictionary m_dictionary; Dictionary m_dictionary;
}; };
......
...@@ -50,8 +50,8 @@ bool V8SQLStatementErrorCallback::handleEvent(SQLTransaction* transaction, SQLEr ...@@ -50,8 +50,8 @@ bool V8SQLStatementErrorCallback::handleEvent(SQLTransaction* transaction, SQLEr
ScriptState::Scope scope(m_scriptState.get()); ScriptState::Scope scope(m_scriptState.get());
v8::Handle<v8::Value> transactionHandle = toV8(transaction, m_scriptState->context()->Global(), isolate); v8::Local<v8::Value> transactionHandle = toV8(transaction, m_scriptState->context()->Global(), isolate);
v8::Handle<v8::Value> errorHandle = toV8(error, m_scriptState->context()->Global(), isolate); v8::Local<v8::Value> errorHandle = toV8(error, m_scriptState->context()->Global(), isolate);
if (transactionHandle.IsEmpty() || errorHandle.IsEmpty()) { if (transactionHandle.IsEmpty() || errorHandle.IsEmpty()) {
if (!isScriptControllerTerminating()) if (!isScriptControllerTerminating())
CRASH(); CRASH();
...@@ -60,7 +60,7 @@ bool V8SQLStatementErrorCallback::handleEvent(SQLTransaction* transaction, SQLEr ...@@ -60,7 +60,7 @@ bool V8SQLStatementErrorCallback::handleEvent(SQLTransaction* transaction, SQLEr
ASSERT(transactionHandle->IsObject()); ASSERT(transactionHandle->IsObject());
v8::Handle<v8::Value> argv[] = { v8::Local<v8::Value> argv[] = {
transactionHandle, transactionHandle,
errorHandle errorHandle
}; };
...@@ -68,7 +68,7 @@ bool V8SQLStatementErrorCallback::handleEvent(SQLTransaction* transaction, SQLEr ...@@ -68,7 +68,7 @@ bool V8SQLStatementErrorCallback::handleEvent(SQLTransaction* transaction, SQLEr
v8::TryCatch exceptionCatcher; v8::TryCatch exceptionCatcher;
exceptionCatcher.SetVerbose(true); exceptionCatcher.SetVerbose(true);
v8::Handle<v8::Value> result = ScriptController::callFunction(executionContext(), m_callback.newLocal(isolate), m_scriptState->context()->Global(), WTF_ARRAY_LENGTH(argv), argv, isolate); v8::Local<v8::Value> result = ScriptController::callFunction(executionContext(), m_callback.newLocal(isolate), m_scriptState->context()->Global(), WTF_ARRAY_LENGTH(argv), argv, isolate);
// FIXME: This comment doesn't make much sense given what the code is actually doing. // FIXME: This comment doesn't make much sense given what the code is actually doing.
// //
......
...@@ -69,7 +69,7 @@ void V8SQLResultSetRowList::itemMethodCustom(const v8::FunctionCallbackInfo<v8:: ...@@ -69,7 +69,7 @@ void V8SQLResultSetRowList::itemMethodCustom(const v8::FunctionCallbackInfo<v8::
for (unsigned i = 0; i < numColumns; ++i) { for (unsigned i = 0; i < numColumns; ++i) {
const SQLValue& sqlValue = rowList->values()[valuesIndex + i]; const SQLValue& sqlValue = rowList->values()[valuesIndex + i];
v8::Handle<v8::Value> value; v8::Local<v8::Value> value;
switch (sqlValue.type()) { switch (sqlValue.type()) {
case SQLValue::StringValue: case SQLValue::StringValue:
value = v8String(info.GetIsolate(), sqlValue.string()); value = v8String(info.GetIsolate(), sqlValue.string());
......
...@@ -74,7 +74,7 @@ void V8SQLTransaction::executeSqlMethodCustom(const v8::FunctionCallbackInfo<v8: ...@@ -74,7 +74,7 @@ void V8SQLTransaction::executeSqlMethodCustom(const v8::FunctionCallbackInfo<v8:
sqlArgsLength = length->Uint32Value(); sqlArgsLength = length->Uint32Value();
for (unsigned i = 0; i < sqlArgsLength; ++i) { for (unsigned i = 0; i < sqlArgsLength; ++i) {
v8::Handle<v8::Integer> key = v8::Integer::New(info.GetIsolate(), i); v8::Local<v8::Integer> key = v8::Integer::New(info.GetIsolate(), i);
TONATIVE_VOID(v8::Local<v8::Value>, value, sqlArgsObject->Get(key)); TONATIVE_VOID(v8::Local<v8::Value>, value, sqlArgsObject->Get(key));
if (value.IsEmpty() || value->IsNull()) { if (value.IsEmpty() || value->IsNull()) {
...@@ -97,7 +97,7 @@ void V8SQLTransaction::executeSqlMethodCustom(const v8::FunctionCallbackInfo<v8: ...@@ -97,7 +97,7 @@ void V8SQLTransaction::executeSqlMethodCustom(const v8::FunctionCallbackInfo<v8:
exceptionState.throwIfNeeded(); exceptionState.throwIfNeeded();
return; return;
} }
callback = V8SQLStatementCallback::create(v8::Handle<v8::Function>::Cast(info[2]), ScriptState::current(info.GetIsolate())); callback = V8SQLStatementCallback::create(v8::Local<v8::Function>::Cast(info[2]), ScriptState::current(info.GetIsolate()));
} else { } else {
callback = nullptr; callback = nullptr;
} }
...@@ -109,7 +109,7 @@ void V8SQLTransaction::executeSqlMethodCustom(const v8::FunctionCallbackInfo<v8: ...@@ -109,7 +109,7 @@ void V8SQLTransaction::executeSqlMethodCustom(const v8::FunctionCallbackInfo<v8:
exceptionState.throwIfNeeded(); exceptionState.throwIfNeeded();
return; return;
} }
errorCallback = V8SQLStatementErrorCallback::create(v8::Handle<v8::Function>::Cast(info[3]), ScriptState::current(info.GetIsolate())); errorCallback = V8SQLStatementErrorCallback::create(v8::Local<v8::Function>::Cast(info[3]), ScriptState::current(info.GetIsolate()));
} else { } else {
errorCallback = nullptr; errorCallback = nullptr;
} }
......
...@@ -27,8 +27,8 @@ void verify1Method(const v8::FunctionCallbackInfo<v8::Value>& info) ...@@ -27,8 +27,8 @@ void verify1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
return; return;
} }
TONATIVE_VOID(CryptoKey*, key, V8CryptoKey::toImplWithTypeCheck(info.GetIsolate(), info[1])); TONATIVE_VOID(CryptoKey*, key, V8CryptoKey::toImplWithTypeCheck(info.GetIsolate(), info[1]));
TONATIVE_VOID(ArrayBuffer*, signature, info[2]->IsArrayBuffer() ? V8ArrayBuffer::toImpl(v8::Handle<v8::ArrayBuffer>::Cast(info[2])) : 0); TONATIVE_VOID(ArrayBuffer*, signature, info[2]->IsArrayBuffer() ? V8ArrayBuffer::toImpl(v8::Local<v8::ArrayBuffer>::Cast(info[2])) : 0);
TONATIVE_VOID(ArrayBuffer*, data, info[3]->IsArrayBuffer() ? V8ArrayBuffer::toImpl(v8::Handle<v8::ArrayBuffer>::Cast(info[3])) : 0); TONATIVE_VOID(ArrayBuffer*, data, info[3]->IsArrayBuffer() ? V8ArrayBuffer::toImpl(v8::Local<v8::ArrayBuffer>::Cast(info[3])) : 0);
v8SetReturnValue(info, impl->verifySignature(ScriptState::current(info.GetIsolate()), algorithm, key, signature, data).v8Value()); v8SetReturnValue(info, impl->verifySignature(ScriptState::current(info.GetIsolate()), algorithm, key, signature, data).v8Value());
} }
...@@ -42,8 +42,8 @@ void verify2Method(const v8::FunctionCallbackInfo<v8::Value>& info) ...@@ -42,8 +42,8 @@ void verify2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
return; return;
} }
TONATIVE_VOID(CryptoKey*, key, V8CryptoKey::toImplWithTypeCheck(info.GetIsolate(), info[1])); TONATIVE_VOID(CryptoKey*, key, V8CryptoKey::toImplWithTypeCheck(info.GetIsolate(), info[1]));
TONATIVE_VOID(ArrayBuffer*, signature, info[2]->IsArrayBuffer() ? V8ArrayBuffer::toImpl(v8::Handle<v8::ArrayBuffer>::Cast(info[2])) : 0); TONATIVE_VOID(ArrayBuffer*, signature, info[2]->IsArrayBuffer() ? V8ArrayBuffer::toImpl(v8::Local<v8::ArrayBuffer>::Cast(info[2])) : 0);
TONATIVE_VOID(ArrayBufferView*, data, info[3]->IsArrayBufferView() ? V8ArrayBufferView::toImpl(v8::Handle<v8::ArrayBufferView>::Cast(info[3])) : 0); TONATIVE_VOID(ArrayBufferView*, data, info[3]->IsArrayBufferView() ? V8ArrayBufferView::toImpl(v8::Local<v8::ArrayBufferView>::Cast(info[3])) : 0);
v8SetReturnValue(info, impl->verifySignature(ScriptState::current(info.GetIsolate()), algorithm, key, signature, data).v8Value()); v8SetReturnValue(info, impl->verifySignature(ScriptState::current(info.GetIsolate()), algorithm, key, signature, data).v8Value());
} }
...@@ -57,8 +57,8 @@ void verify3Method(const v8::FunctionCallbackInfo<v8::Value>& info) ...@@ -57,8 +57,8 @@ void verify3Method(const v8::FunctionCallbackInfo<v8::Value>& info)
return; return;
} }
TONATIVE_VOID(CryptoKey*, key, V8CryptoKey::toImplWithTypeCheck(info.GetIsolate(), info[1])); TONATIVE_VOID(CryptoKey*, key, V8CryptoKey::toImplWithTypeCheck(info.GetIsolate(), info[1]));
TONATIVE_VOID(ArrayBufferView*, signature, info[2]->IsArrayBufferView() ? V8ArrayBufferView::toImpl(v8::Handle<v8::ArrayBufferView>::Cast(info[2])) : 0); TONATIVE_VOID(ArrayBufferView*, signature, info[2]->IsArrayBufferView() ? V8ArrayBufferView::toImpl(v8::Local<v8::ArrayBufferView>::Cast(info[2])) : 0);
TONATIVE_VOID(ArrayBuffer*, data, info[3]->IsArrayBuffer() ? V8ArrayBuffer::toImpl(v8::Handle<v8::ArrayBuffer>::Cast(info[3])) : 0); TONATIVE_VOID(ArrayBuffer*, data, info[3]->IsArrayBuffer() ? V8ArrayBuffer::toImpl(v8::Local<v8::ArrayBuffer>::Cast(info[3])) : 0);
v8SetReturnValue(info, impl->verifySignature(ScriptState::current(info.GetIsolate()), algorithm, key, signature, data).v8Value()); v8SetReturnValue(info, impl->verifySignature(ScriptState::current(info.GetIsolate()), algorithm, key, signature, data).v8Value());
} }
...@@ -72,8 +72,8 @@ void verify4Method(const v8::FunctionCallbackInfo<v8::Value>& info) ...@@ -72,8 +72,8 @@ void verify4Method(const v8::FunctionCallbackInfo<v8::Value>& info)
return; return;
} }
TONATIVE_VOID(CryptoKey*, key, V8CryptoKey::toImplWithTypeCheck(info.GetIsolate(), info[1])); TONATIVE_VOID(CryptoKey*, key, V8CryptoKey::toImplWithTypeCheck(info.GetIsolate(), info[1]));
TONATIVE_VOID(ArrayBufferView*, signature, info[2]->IsArrayBufferView() ? V8ArrayBufferView::toImpl(v8::Handle<v8::ArrayBufferView>::Cast(info[2])) : 0); TONATIVE_VOID(ArrayBufferView*, signature, info[2]->IsArrayBufferView() ? V8ArrayBufferView::toImpl(v8::Local<v8::ArrayBufferView>::Cast(info[2])) : 0);
TONATIVE_VOID(ArrayBufferView*, data, info[3]->IsArrayBufferView() ? V8ArrayBufferView::toImpl(v8::Handle<v8::ArrayBufferView>::Cast(info[3])) : 0); TONATIVE_VOID(ArrayBufferView*, data, info[3]->IsArrayBufferView() ? V8ArrayBufferView::toImpl(v8::Local<v8::ArrayBufferView>::Cast(info[3])) : 0);
v8SetReturnValue(info, impl->verifySignature(ScriptState::current(info.GetIsolate()), algorithm, key, signature, data).v8Value()); v8SetReturnValue(info, impl->verifySignature(ScriptState::current(info.GetIsolate()), algorithm, key, signature, data).v8Value());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment