diff options
Diffstat (limited to 'third_party/WebKit/Source/bindings/modules/v8')
4 files changed, 19 insertions, 22 deletions
diff --git a/third_party/WebKit/Source/bindings/modules/v8/IDBBindingUtilities.cpp b/third_party/WebKit/Source/bindings/modules/v8/IDBBindingUtilities.cpp index a4d335b..ccfefa7 100644 --- a/third_party/WebKit/Source/bindings/modules/v8/IDBBindingUtilities.cpp +++ b/third_party/WebKit/Source/bindings/modules/v8/IDBBindingUtilities.cpp @@ -27,11 +27,11 @@ #include "bindings/modules/v8/IDBBindingUtilities.h" #include "bindings/core/v8/SerializedScriptValue.h" +#include "bindings/core/v8/V8ArrayBufferView.h" #include "bindings/core/v8/V8Binding.h" #include "bindings/core/v8/V8DOMStringList.h" #include "bindings/core/v8/V8HiddenValue.h" -#include "bindings/core/v8/custom/V8ArrayBufferViewCustom.h" -#include "bindings/core/v8/custom/V8Uint8ArrayCustom.h" +#include "bindings/core/v8/V8Uint8Array.h" #include "bindings/modules/v8/V8IDBCursor.h" #include "bindings/modules/v8/V8IDBCursorWithValue.h" #include "bindings/modules/v8/V8IDBDatabase.h" @@ -46,7 +46,6 @@ #include "modules/indexeddb/IDBTracing.h" #include "platform/RuntimeEnabledFeatures.h" #include "platform/SharedBuffer.h" -#include "wtf/ArrayBufferView.h" #include "wtf/MathExtras.h" #include "wtf/Uint8Array.h" #include "wtf/Vector.h" @@ -90,7 +89,7 @@ static v8::Local<v8::Value> toV8(const IDBKey* key, v8::Local<v8::Object> creati case IDBKey::StringType: return v8String(isolate, key->string()); case IDBKey::BinaryType: - return toV8(Uint8Array::create(reinterpret_cast<const unsigned char*>(key->binary()->data()), key->binary()->size()), creationContext, isolate); + return toV8(DOMUint8Array::create(reinterpret_cast<const unsigned char*>(key->binary()->data()), key->binary()->size()), creationContext, isolate); case IDBKey::DateType: return v8::Date::New(isolate, key->date()); case IDBKey::ArrayType: @@ -184,7 +183,7 @@ static IDBKey* createIDBKeyFromValue(v8::Isolate* isolate, v8::Local<v8::Value> if (value->IsUint8Array() && (allowExperimentalTypes || RuntimeEnabledFeatures::indexedDBExperimentalEnabled())) { // Per discussion in https://www.w3.org/Bugs/Public/show_bug.cgi?id=23332 the // input type is constrained to Uint8Array to match the output type. - ArrayBufferView* view = blink::V8ArrayBufferView::toImpl(value->ToObject()); + DOMArrayBufferView* view = blink::V8ArrayBufferView::toImpl(value->ToObject()); const char* start = static_cast<const char*>(view->baseAddress()); size_t length = view->byteLength(); return IDBKey::createBinary(SharedBuffer::create(start, length)); diff --git a/third_party/WebKit/Source/bindings/modules/v8/custom/V8CryptoCustom.cpp b/third_party/WebKit/Source/bindings/modules/v8/custom/V8CryptoCustom.cpp index e3ae3fc..d85dc06 100644 --- a/third_party/WebKit/Source/bindings/modules/v8/custom/V8CryptoCustom.cpp +++ b/third_party/WebKit/Source/bindings/modules/v8/custom/V8CryptoCustom.cpp @@ -27,11 +27,10 @@ #include "bindings/core/v8/ExceptionMessages.h" #include "bindings/core/v8/ExceptionState.h" +#include "bindings/core/v8/V8ArrayBufferView.h" #include "bindings/core/v8/V8Binding.h" -#include "bindings/core/v8/custom/V8ArrayBufferViewCustom.h" #include "core/dom/ExceptionCode.h" #include "modules/crypto/Crypto.h" -#include "wtf/ArrayBufferView.h" namespace blink { @@ -48,11 +47,11 @@ void V8Crypto::getRandomValuesMethodCustom(const v8::FunctionCallbackInfo<v8::Va if (!V8ArrayBufferView::hasInstance(buffer, info.GetIsolate())) { exceptionState.throwTypeError("First argument is not an ArrayBufferView"); } else { - ArrayBufferView* arrayBufferView = V8ArrayBufferView::toImpl(v8::Local<v8::Object>::Cast(buffer)); + DOMArrayBufferView* arrayBufferView = V8ArrayBufferView::toImpl(v8::Local<v8::Object>::Cast(buffer)); ASSERT(arrayBufferView); Crypto* crypto = V8Crypto::toImpl(info.Holder()); - crypto->getRandomValues(arrayBufferView, exceptionState); + crypto->getRandomValues(arrayBufferView->view(), exceptionState); } if (exceptionState.throwIfNeeded()) diff --git a/third_party/WebKit/Source/bindings/modules/v8/custom/V8CryptoKeyCustom.cpp b/third_party/WebKit/Source/bindings/modules/v8/custom/V8CryptoKeyCustom.cpp index 5dab691..a40bb37 100644 --- a/third_party/WebKit/Source/bindings/modules/v8/custom/V8CryptoKeyCustom.cpp +++ b/third_party/WebKit/Source/bindings/modules/v8/custom/V8CryptoKeyCustom.cpp @@ -7,7 +7,7 @@ #include "bindings/core/v8/Dictionary.h" #include "bindings/core/v8/V8Binding.h" -#include "bindings/core/v8/custom/V8Uint8ArrayCustom.h" +#include "bindings/core/v8/V8Uint8Array.h" #include "public/platform/WebCryptoKeyAlgorithm.h" #include "wtf/Uint8Array.h" @@ -43,8 +43,7 @@ public: virtual void setUint8Array(const char* propertyName, const blink::WebVector<unsigned char>& vector) { - RefPtr<Uint8Array> uint8Array = Uint8Array::create(vector.data(), vector.size()); - m_dictionary.set(propertyName, toV8(uint8Array.get(), m_holder, m_isolate)); + m_dictionary.set(propertyName, toV8(DOMUint8Array::create(vector.data(), vector.size()), m_holder, m_isolate)); } const Dictionary& dictionary() const { return m_dictionary; } diff --git a/third_party/WebKit/Source/bindings/modules/v8/custom/V8SubtleCryptoCustom.cpp b/third_party/WebKit/Source/bindings/modules/v8/custom/V8SubtleCryptoCustom.cpp index 054ab38..990f8ee 100644 --- a/third_party/WebKit/Source/bindings/modules/v8/custom/V8SubtleCryptoCustom.cpp +++ b/third_party/WebKit/Source/bindings/modules/v8/custom/V8SubtleCryptoCustom.cpp @@ -6,8 +6,8 @@ #include "bindings/modules/v8/V8SubtleCrypto.h" #include "bindings/core/v8/Dictionary.h" -#include "bindings/core/v8/custom/V8ArrayBufferCustom.h" -#include "bindings/core/v8/custom/V8ArrayBufferViewCustom.h" +#include "bindings/core/v8/V8ArrayBuffer.h" +#include "bindings/core/v8/V8ArrayBufferView.h" #include "bindings/modules/v8/V8CryptoKey.h" namespace blink { @@ -27,8 +27,8 @@ void verify1Method(const v8::FunctionCallbackInfo<v8::Value>& info) return; } TONATIVE_VOID(CryptoKey*, key, V8CryptoKey::toImplWithTypeCheck(info.GetIsolate(), info[1])); - 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::Local<v8::ArrayBuffer>::Cast(info[3])) : 0); + TONATIVE_VOID(DOMArrayBuffer*, signature, info[2]->IsArrayBuffer() ? V8ArrayBuffer::toImpl(v8::Local<v8::ArrayBuffer>::Cast(info[2])) : 0); + TONATIVE_VOID(DOMArrayBuffer*, 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()); } @@ -42,8 +42,8 @@ void verify2Method(const v8::FunctionCallbackInfo<v8::Value>& info) return; } TONATIVE_VOID(CryptoKey*, key, V8CryptoKey::toImplWithTypeCheck(info.GetIsolate(), info[1])); - 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::Local<v8::ArrayBufferView>::Cast(info[3])) : 0); + TONATIVE_VOID(DOMArrayBuffer*, signature, info[2]->IsArrayBuffer() ? V8ArrayBuffer::toImpl(v8::Local<v8::ArrayBuffer>::Cast(info[2])) : 0); + TONATIVE_VOID(DOMArrayBufferView*, 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()); } @@ -57,8 +57,8 @@ void verify3Method(const v8::FunctionCallbackInfo<v8::Value>& info) return; } TONATIVE_VOID(CryptoKey*, key, V8CryptoKey::toImplWithTypeCheck(info.GetIsolate(), info[1])); - 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::Local<v8::ArrayBuffer>::Cast(info[3])) : 0); + TONATIVE_VOID(DOMArrayBufferView*, signature, info[2]->IsArrayBufferView() ? V8ArrayBufferView::toImpl(v8::Local<v8::ArrayBufferView>::Cast(info[2])) : 0); + TONATIVE_VOID(DOMArrayBuffer*, 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()); } @@ -72,8 +72,8 @@ void verify4Method(const v8::FunctionCallbackInfo<v8::Value>& info) return; } TONATIVE_VOID(CryptoKey*, key, V8CryptoKey::toImplWithTypeCheck(info.GetIsolate(), info[1])); - 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::Local<v8::ArrayBufferView>::Cast(info[3])) : 0); + TONATIVE_VOID(DOMArrayBufferView*, signature, info[2]->IsArrayBufferView() ? V8ArrayBufferView::toImpl(v8::Local<v8::ArrayBufferView>::Cast(info[2])) : 0); + TONATIVE_VOID(DOMArrayBufferView*, 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()); } |