Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Unified Diff: Source/bindings/v8/SerializedScriptValue.cpp

Issue 18316003: Revert "Use V8 implementation of ArrayBuffer in Blink." (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/tests/results/V8TestOverloadedConstructors.cpp ('k') | Source/bindings/v8/V8Binding.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/SerializedScriptValue.cpp
diff --git a/Source/bindings/v8/SerializedScriptValue.cpp b/Source/bindings/v8/SerializedScriptValue.cpp
index 9ed633f040f7279063187dd1afb4a9b33525de6f..cdad44eeca7902f06315d29a56b9e5face901544 100644
--- a/Source/bindings/v8/SerializedScriptValue.cpp
+++ b/Source/bindings/v8/SerializedScriptValue.cpp
@@ -31,6 +31,7 @@
#include "config.h"
#include "bindings/v8/SerializedScriptValue.h"
+#include "V8ArrayBuffer.h"
#include "V8ArrayBufferView.h"
#include "V8Blob.h"
#include "V8DOMFileSystem.h"
@@ -681,13 +682,13 @@ static v8::Handle<v8::Object> toV8Object(MessagePort* impl, v8::Isolate* isolate
return wrapper.As<v8::Object>();
}
-static v8::Handle<v8::ArrayBuffer> toV8Object(ArrayBuffer* impl, v8::Isolate* isolate)
+static v8::Handle<v8::Object> toV8Object(ArrayBuffer* impl, v8::Isolate* isolate)
{
if (!impl)
- return v8::Handle<v8::ArrayBuffer>();
+ return v8::Handle<v8::Object>();
v8::Handle<v8::Value> wrapper = toV8(impl, v8::Handle<v8::Object>(), isolate);
- ASSERT(wrapper->IsArrayBuffer());
- return wrapper.As<v8::ArrayBuffer>();
+ ASSERT(wrapper->IsObject());
+ return wrapper.As<v8::Object>();
}
class Serializer {
@@ -845,7 +846,7 @@ private:
protected:
virtual StateBase* objectDone(unsigned numProperties, Serializer&) = 0;
- StateBase* serializeProperties(bool ignoreIndexed, Serializer& serializer)
+ StateBase* serializeProperties(bool ignoreIndexed, Serializer& serializer)
{
m_isSerializingAccessor = false;
while (m_index < m_propertyNames->Length()) {
@@ -978,7 +979,7 @@ private:
m_propertyNames = v8::Local<v8::Array>::New(propertyNames);
}
- virtual StateBase* advance(Serializer& serializer)
+ virtual StateBase* advance(Serializer& serializer)
{
return serializeProperties(false, serializer);
}
@@ -1177,7 +1178,7 @@ private:
return 0;
}
- static bool shouldSerializeDensely(uint32_t length, uint32_t propertyCount)
+ static bool shouldSerializeDensely(uint32_t length, uint32_t propertyCount)
{
// Let K be the cost of serializing all property values that are there
// Cost of serializing sparsely: 5*propertyCount + K (5 bytes per uint32_t key)
@@ -1699,7 +1700,7 @@ private:
*value = v8::Number::New(number);
return true;
}
-
+
bool readNumberObject(v8::Handle<v8::Value>* value)
{
double number;
@@ -1771,7 +1772,7 @@ private:
return false;
if (!creator.consumeTopOfStack(&arrayBufferV8Value))
return false;
- if (arrayBufferV8Value.IsEmpty())
+ if (arrayBufferV8Value.IsEmpty())
return false;
arrayBuffer = V8ArrayBuffer::toNative(arrayBufferV8Value.As<v8::Object>());
if (!arrayBuffer)
@@ -2367,19 +2368,8 @@ SerializedScriptValue::SerializedScriptValue()
{
}
-inline void neuterBinding(ArrayBuffer* object)
-{
- Vector<DOMDataStore*>& allStores = V8PerIsolateData::current()->allStores();
- for (size_t i = 0; i < allStores.size(); i++) {
- v8::Handle<v8::Object> wrapper = allStores[i]->get(object);
- if (!wrapper.IsEmpty()) {
- ASSERT(wrapper->IsArrayBuffer());
- v8::Handle<v8::ArrayBuffer>::Cast(wrapper)->Neuter();
- }
- }
-}
-
-inline void neuterBinding(ArrayBufferView* object)
+template<typename T>
+inline void neuterBinding(T* object)
{
Vector<DOMDataStore*>& allStores = V8PerIsolateData::current()->allStores();
for (size_t i = 0; i < allStores.size(); i++) {
« no previous file with comments | « Source/bindings/tests/results/V8TestOverloadedConstructors.cpp ('k') | Source/bindings/v8/V8Binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698