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

Side by Side Diff: gin/array_buffer.cc

Issue 79203004: [Gin] Add a mechanism for wrapping C++ object (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disallow copy and assign Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | gin/dictionary.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "gin/array_buffer.h" 5 #include "gin/array_buffer.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 namespace gin { 9 namespace gin {
10 10
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 100 }
101 101
102 ArrayBuffer::Private::~Private() { 102 ArrayBuffer::Private::~Private() {
103 ArrayBufferAllocator::SharedInstance()->Free(buffer_, length_); 103 ArrayBufferAllocator::SharedInstance()->Free(buffer_, length_);
104 } 104 }
105 105
106 void ArrayBuffer::Private::WeakCallback( 106 void ArrayBuffer::Private::WeakCallback(
107 const v8::WeakCallbackData<v8::ArrayBuffer, Private>& data) { 107 const v8::WeakCallbackData<v8::ArrayBuffer, Private>& data) {
108 Private* parameter = data.GetParameter(); 108 Private* parameter = data.GetParameter();
109 parameter->array_buffer_.Reset(); 109 parameter->array_buffer_.Reset();
110 // parameter->self_reference_.clear(); 110 parameter->self_reference_ = NULL;
111 } 111 }
112 112
113 // ArrayBuffer ---------------------------------------------------------------- 113 // ArrayBuffer ----------------------------------------------------------------
114 114
115 ArrayBuffer::ArrayBuffer(v8::Isolate* isolate) 115 ArrayBuffer::ArrayBuffer(v8::Isolate* isolate)
116 : isolate_(isolate), 116 : isolate_(isolate),
117 bytes_(0), 117 bytes_(0),
118 num_bytes_(0) { 118 num_bytes_(0) {
119 } 119 }
120 120
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 bool Converter<ArrayBufferView>::FromV8(v8::Handle<v8::Value> val, 162 bool Converter<ArrayBufferView>::FromV8(v8::Handle<v8::Value> val,
163 ArrayBufferView* out) { 163 ArrayBufferView* out) {
164 if (!val->IsArrayBufferView()) 164 if (!val->IsArrayBufferView())
165 return false; 165 return false;
166 *out = ArrayBufferView(out->isolate(), 166 *out = ArrayBufferView(out->isolate(),
167 v8::Handle<v8::ArrayBufferView>::Cast(val)); 167 v8::Handle<v8::ArrayBufferView>::Cast(val));
168 return true; 168 return true;
169 } 169 }
170 170
171 } // namespace gin 171 } // namespace gin
OLDNEW
« no previous file with comments | « no previous file | gin/dictionary.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698