| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 #include "config.h" | 29 #include "config.h" |
| 30 #include "public/web/WebArrayBufferView.h" | 30 #include "public/web/WebArrayBufferView.h" |
| 31 | 31 |
| 32 #include "bindings/core/v8/custom/V8ArrayBufferViewCustom.h" | 32 #include "bindings/core/v8/custom/V8ArrayBufferViewCustom.h" |
| 33 #include "wtf/ArrayBufferView.h" | 33 #include "wtf/ArrayBufferView.h" |
| 34 | 34 |
| 35 using namespace WTF; | |
| 36 | |
| 37 namespace blink { | 35 namespace blink { |
| 38 | 36 |
| 39 void WebArrayBufferView::assign(const WebArrayBufferView& other) | 37 void WebArrayBufferView::assign(const WebArrayBufferView& other) |
| 40 { | 38 { |
| 41 m_private = other.m_private; | 39 m_private = other.m_private; |
| 42 } | 40 } |
| 43 | 41 |
| 44 void WebArrayBufferView::reset() | 42 void WebArrayBufferView::reset() |
| 45 { | 43 { |
| 46 m_private.reset(); | 44 m_private.reset(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 58 | 56 |
| 59 unsigned WebArrayBufferView::byteLength() const | 57 unsigned WebArrayBufferView::byteLength() const |
| 60 { | 58 { |
| 61 return m_private->byteLength(); | 59 return m_private->byteLength(); |
| 62 } | 60 } |
| 63 | 61 |
| 64 WebArrayBufferView* WebArrayBufferView::createFromV8Value(v8::Handle<v8::Value>
value) | 62 WebArrayBufferView* WebArrayBufferView::createFromV8Value(v8::Handle<v8::Value>
value) |
| 65 { | 63 { |
| 66 if (!value->IsArrayBufferView()) | 64 if (!value->IsArrayBufferView()) |
| 67 return 0; | 65 return 0; |
| 68 ArrayBufferView* view = blink::V8ArrayBufferView::toNative(value->ToObject()
); | 66 ArrayBufferView* view = V8ArrayBufferView::toNative(value->ToObject()); |
| 69 return new WebArrayBufferView(view); | 67 return new WebArrayBufferView(view); |
| 70 } | 68 } |
| 71 | 69 |
| 72 WebArrayBufferView::WebArrayBufferView(const PassRefPtr<ArrayBufferView>& value) | 70 WebArrayBufferView::WebArrayBufferView(const PassRefPtr<ArrayBufferView>& value) |
| 73 : m_private(value) | 71 : m_private(value) |
| 74 { | 72 { |
| 75 } | 73 } |
| 76 | 74 |
| 77 WebArrayBufferView& WebArrayBufferView::operator=(const PassRefPtr<ArrayBufferVi
ew>& value) | 75 WebArrayBufferView& WebArrayBufferView::operator=(const PassRefPtr<ArrayBufferVi
ew>& value) |
| 78 { | 76 { |
| 79 m_private = value; | 77 m_private = value; |
| 80 return *this; | 78 return *this; |
| 81 } | 79 } |
| 82 | 80 |
| 83 WebArrayBufferView::operator PassRefPtr<ArrayBufferView>() const | 81 WebArrayBufferView::operator PassRefPtr<ArrayBufferView>() const |
| 84 { | 82 { |
| 85 return m_private.get(); | 83 return m_private.get(); |
| 86 } | 84 } |
| 87 | 85 |
| 88 } // namespace blink | 86 } // namespace blink |
| OLD | NEW |