Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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; |
|
abarth-chromium
2013/11/21 02:53:43
I can make this change in a separate CL if you pre
| |
| 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 Loading... | |
| 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 |
| OLD | NEW |