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

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

Issue 1186863005: Add a ref-counted data holder to ArrayBufferContents (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: type in ArrayBuffer::shareContentsWith 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 "V8ArrayBuffer.h" 8 #include "V8ArrayBuffer.h"
9 9
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
(...skipping 28 matching lines...) Expand all
39 if (v8buffer->IsExternal()) { 39 if (v8buffer->IsExternal()) {
40 const WrapperTypeInfo* wrapperTypeInfo = toWrapperTypeInfo(object); 40 const WrapperTypeInfo* wrapperTypeInfo = toWrapperTypeInfo(object);
41 RELEASE_ASSERT(wrapperTypeInfo); 41 RELEASE_ASSERT(wrapperTypeInfo);
42 RELEASE_ASSERT(wrapperTypeInfo->ginEmbedder == gin::kEmbedderBlink); 42 RELEASE_ASSERT(wrapperTypeInfo->ginEmbedder == gin::kEmbedderBlink);
43 return toScriptWrappable(object)->toImpl<TestArrayBuffer>(); 43 return toScriptWrappable(object)->toImpl<TestArrayBuffer>();
44 } 44 }
45 45
46 // Transfer the ownership of the allocated memory to an ArrayBuffer without 46 // Transfer the ownership of the allocated memory to an ArrayBuffer without
47 // copying. 47 // copying.
48 v8::ArrayBuffer::Contents v8Contents = v8buffer->Externalize(); 48 v8::ArrayBuffer::Contents v8Contents = v8buffer->Externalize();
49 WTF::ArrayBufferContents contents(v8Contents.Data(), v8Contents.ByteLength() ); 49 WTF::ArrayBufferContents contents(v8Contents.Data(), v8Contents.ByteLength() , WTF::ArrayBufferContents::NotShared);
50 RefPtr<TestArrayBuffer> buffer = TestArrayBuffer::create(contents); 50 RefPtr<TestArrayBuffer> buffer = TestArrayBuffer::create(contents);
51 buffer->associateWithWrapper(v8::Isolate::GetCurrent(), buffer->wrapperTypeI nfo(), object); 51 buffer->associateWithWrapper(v8::Isolate::GetCurrent(), buffer->wrapperTypeI nfo(), object);
52 52
53 return buffer.get(); 53 return buffer.get();
54 } 54 }
55 55
56 TestArrayBuffer* V8ArrayBuffer::toImplWithTypeCheck(v8::Isolate* isolate, v8::Lo cal<v8::Value> value) 56 TestArrayBuffer* V8ArrayBuffer::toImplWithTypeCheck(v8::Isolate* isolate, v8::Lo cal<v8::Value> value)
57 { 57 {
58 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu e)) : 0; 58 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu e)) : 0;
59 } 59 }
60 60
61 void V8ArrayBuffer::refObject(ScriptWrappable* scriptWrappable) 61 void V8ArrayBuffer::refObject(ScriptWrappable* scriptWrappable)
62 { 62 {
63 scriptWrappable->toImpl<TestArrayBuffer>()->ref(); 63 scriptWrappable->toImpl<TestArrayBuffer>()->ref();
64 } 64 }
65 65
66 void V8ArrayBuffer::derefObject(ScriptWrappable* scriptWrappable) 66 void V8ArrayBuffer::derefObject(ScriptWrappable* scriptWrappable)
67 { 67 {
68 scriptWrappable->toImpl<TestArrayBuffer>()->deref(); 68 scriptWrappable->toImpl<TestArrayBuffer>()->deref();
69 } 69 }
70 70
71 } // namespace blink 71 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698