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

Side by Side Diff: gin/array_buffer.cc

Issue 654653005: Rewrite gin/function_template.h to use C++11 variadic templates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-add assignment operator. Created 6 years, 2 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
« no previous file with comments | « gin/array_buffer.h ('k') | gin/function_template.h » ('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 <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "gin/array_buffer.h" 8 #include "gin/array_buffer.h"
9 #include "gin/per_isolate_data.h" 9 #include "gin/per_isolate_data.h"
10 10
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 parameter->self_reference_ = NULL; 123 parameter->self_reference_ = NULL;
124 } 124 }
125 125
126 // ArrayBuffer ---------------------------------------------------------------- 126 // ArrayBuffer ----------------------------------------------------------------
127 127
128 ArrayBuffer::ArrayBuffer() 128 ArrayBuffer::ArrayBuffer()
129 : bytes_(0), 129 : bytes_(0),
130 num_bytes_(0) { 130 num_bytes_(0) {
131 } 131 }
132 132
133 ArrayBuffer::ArrayBuffer(const ArrayBuffer& other)
134 : private_(other.private_),
135 bytes_(other.bytes_),
136 num_bytes_(other.num_bytes_) {
137
138 }
139
140
133 ArrayBuffer::ArrayBuffer(v8::Isolate* isolate, 141 ArrayBuffer::ArrayBuffer(v8::Isolate* isolate,
134 v8::Handle<v8::ArrayBuffer> array) { 142 v8::Handle<v8::ArrayBuffer> array) {
135 private_ = ArrayBuffer::Private::From(isolate, array); 143 private_ = ArrayBuffer::Private::From(isolate, array);
136 bytes_ = private_->buffer(); 144 bytes_ = private_->buffer();
137 num_bytes_ = private_->length(); 145 num_bytes_ = private_->length();
138 } 146 }
139 147
140 ArrayBuffer::~ArrayBuffer() { 148 ArrayBuffer::~ArrayBuffer() {
141 } 149 }
142 150
(...skipping 15 matching lines...) Expand all
158 return true; 166 return true;
159 } 167 }
160 168
161 // ArrayBufferView ------------------------------------------------------------ 169 // ArrayBufferView ------------------------------------------------------------
162 170
163 ArrayBufferView::ArrayBufferView() 171 ArrayBufferView::ArrayBufferView()
164 : offset_(0), 172 : offset_(0),
165 num_bytes_(0) { 173 num_bytes_(0) {
166 } 174 }
167 175
176 ArrayBufferView::ArrayBufferView(const ArrayBufferView& other)
177 : array_buffer_(other.array_buffer_),
178 offset_(other.offset_),
179 num_bytes_(other.num_bytes_) {
180 }
181
168 ArrayBufferView::ArrayBufferView(v8::Isolate* isolate, 182 ArrayBufferView::ArrayBufferView(v8::Isolate* isolate,
169 v8::Handle<v8::ArrayBufferView> view) 183 v8::Handle<v8::ArrayBufferView> view)
170 : array_buffer_(isolate, view->Buffer()), 184 : array_buffer_(isolate, view->Buffer()),
171 offset_(view->ByteOffset()), 185 offset_(view->ByteOffset()),
172 num_bytes_(view->ByteLength()) { 186 num_bytes_(view->ByteLength()) {
173 } 187 }
174 188
175 ArrayBufferView::~ArrayBufferView() { 189 ArrayBufferView::~ArrayBufferView() {
176 } 190 }
177 191
(...skipping 10 matching lines...) Expand all
188 bool Converter<ArrayBufferView>::FromV8(v8::Isolate* isolate, 202 bool Converter<ArrayBufferView>::FromV8(v8::Isolate* isolate,
189 v8::Handle<v8::Value> val, 203 v8::Handle<v8::Value> val,
190 ArrayBufferView* out) { 204 ArrayBufferView* out) {
191 if (!val->IsArrayBufferView()) 205 if (!val->IsArrayBufferView())
192 return false; 206 return false;
193 *out = ArrayBufferView(isolate, v8::Handle<v8::ArrayBufferView>::Cast(val)); 207 *out = ArrayBufferView(isolate, v8::Handle<v8::ArrayBufferView>::Cast(val));
194 return true; 208 return true;
195 } 209 }
196 210
197 } // namespace gin 211 } // namespace gin
OLDNEW
« no previous file with comments | « gin/array_buffer.h ('k') | gin/function_template.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698