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

Side by Side Diff: Source/bindings/tests/results/core/V8Uint8ClampedArray.cpp

Issue 1097773004: Sharing of SharedArrayBuffer via PostMessage transfer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: update for non-split typedarray hierarchy Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "V8Uint8ClampedArray.h" 8 #include "V8Uint8ClampedArray.h"
9 9
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
11 #include "bindings/core/v8/V8ArrayBuffer.h" 11 #include "bindings/core/v8/V8ArrayBuffer.h"
12 #include "bindings/core/v8/V8DOMConfiguration.h" 12 #include "bindings/core/v8/V8DOMConfiguration.h"
13 #include "bindings/core/v8/V8ObjectConstructor.h" 13 #include "bindings/core/v8/V8ObjectConstructor.h"
14 #include "bindings/core/v8/V8SharedArrayBuffer.h"
14 #include "core/dom/ContextFeatures.h" 15 #include "core/dom/ContextFeatures.h"
15 #include "core/dom/Document.h" 16 #include "core/dom/Document.h"
16 #include "platform/RuntimeEnabledFeatures.h" 17 #include "platform/RuntimeEnabledFeatures.h"
17 #include "platform/TraceEvent.h" 18 #include "platform/TraceEvent.h"
18 #include "wtf/GetPtr.h" 19 #include "wtf/GetPtr.h"
19 #include "wtf/RefPtr.h" 20 #include "wtf/RefPtr.h"
20 21
21 namespace blink { 22 namespace blink {
22 23
23 const WrapperTypeInfo V8Uint8ClampedArray::wrapperTypeInfo = { gin::kEmbedderBli nk, 0, V8Uint8ClampedArray::refObject, V8Uint8ClampedArray::derefObject, V8Uint8 ClampedArray::trace, 0, 0, V8Uint8ClampedArray::preparePrototypeObject, V8Uint8C lampedArray::installConditionallyEnabledProperties, "Uint8ClampedArray", &V8Arra yBufferView::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototype, Wrapp erTypeInfo::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTy peInfo::Independent, WrapperTypeInfo::RefCountedObject }; 24 const WrapperTypeInfo V8Uint8ClampedArray::wrapperTypeInfo = { gin::kEmbedderBli nk, 0, V8Uint8ClampedArray::refObject, V8Uint8ClampedArray::derefObject, V8Uint8 ClampedArray::trace, 0, 0, V8Uint8ClampedArray::preparePrototypeObject, V8Uint8C lampedArray::installConditionallyEnabledProperties, "Uint8ClampedArray", &V8Arra yBufferView::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototype, Wrapp erTypeInfo::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTy peInfo::Independent, WrapperTypeInfo::RefCountedObject };
24 25
25 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestUint8Cla mpedArray.h. 26 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestUint8Cla mpedArray.h.
26 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in 27 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
27 // bindings/core/v8/ScriptWrappable.h. 28 // bindings/core/v8/ScriptWrappable.h.
28 29
29 bool V8Uint8ClampedArray::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) 30 bool V8Uint8ClampedArray::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
30 { 31 {
31 return v8Value->IsUint8ClampedArray(); 32 return v8Value->IsUint8ClampedArray();
32 } 33 }
33 34
34 TestUint8ClampedArray* V8Uint8ClampedArray::toImpl(v8::Local<v8::Object> object) 35 TestUint8ClampedArray* V8Uint8ClampedArray::toImpl(v8::Local<v8::Object> object)
35 { 36 {
36 ASSERT(object->IsUint8ClampedArray()); 37 ASSERT(object->IsUint8ClampedArray());
37 ScriptWrappable* scriptWrappable = toScriptWrappable(object); 38 ScriptWrappable* scriptWrappable = toScriptWrappable(object);
38 if (scriptWrappable) 39 if (scriptWrappable)
39 return scriptWrappable->toImpl<TestUint8ClampedArray>(); 40 return scriptWrappable->toImpl<TestUint8ClampedArray>();
40 41
41 v8::Local<v8::Uint8ClampedArray> v8View = object.As<v8::Uint8ClampedArray>() ; 42 v8::Local<v8::Uint8ClampedArray> v8View = object.As<v8::Uint8ClampedArray>() ;
42 RefPtr<TestUint8ClampedArray> typedArray = TestUint8ClampedArray::create(V8A rrayBuffer::toImpl(v8View->Buffer()), v8View->ByteOffset(), v8View->Length()); 43 v8::Local<v8::Object> arrayBuffer = v8View->Buffer();
44 RefPtr<TestUint8ClampedArray> typedArray;
45 if (arrayBuffer->IsArrayBuffer()) {
46 typedArray = TestUint8ClampedArray::create(V8ArrayBuffer::toImpl(arrayBu ffer), v8View->ByteOffset(), v8View->Length());
47 } else if (arrayBuffer->IsSharedArrayBuffer()) {
48 typedArray = TestUint8ClampedArray::create(V8SharedArrayBuffer::toImpl(a rrayBuffer), v8View->ByteOffset(), v8View->Length());
49 } else {
50 ASSERT_NOT_REACHED();
51 }
43 typedArray->associateWithWrapper(v8::Isolate::GetCurrent(), typedArray->wrap perTypeInfo(), object); 52 typedArray->associateWithWrapper(v8::Isolate::GetCurrent(), typedArray->wrap perTypeInfo(), object);
44 53
45 return typedArray->toImpl<TestUint8ClampedArray>(); 54 return typedArray->toImpl<TestUint8ClampedArray>();
46 } 55 }
47 56
48 TestUint8ClampedArray* V8Uint8ClampedArray::toImplWithTypeCheck(v8::Isolate* iso late, v8::Local<v8::Value> value) 57 TestUint8ClampedArray* V8Uint8ClampedArray::toImplWithTypeCheck(v8::Isolate* iso late, v8::Local<v8::Value> value)
49 { 58 {
50 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu e)) : 0; 59 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu e)) : 0;
51 } 60 }
52 61
53 void V8Uint8ClampedArray::refObject(ScriptWrappable* scriptWrappable) 62 void V8Uint8ClampedArray::refObject(ScriptWrappable* scriptWrappable)
54 { 63 {
55 scriptWrappable->toImpl<TestUint8ClampedArray>()->ref(); 64 scriptWrappable->toImpl<TestUint8ClampedArray>()->ref();
56 } 65 }
57 66
58 void V8Uint8ClampedArray::derefObject(ScriptWrappable* scriptWrappable) 67 void V8Uint8ClampedArray::derefObject(ScriptWrappable* scriptWrappable)
59 { 68 {
60 scriptWrappable->toImpl<TestUint8ClampedArray>()->deref(); 69 scriptWrappable->toImpl<TestUint8ClampedArray>()->deref();
61 } 70 }
62 71
63 } // namespace blink 72 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698