| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 static inline ArrayBuffer* fromInternalPointer(void* impl) | 67 static inline ArrayBuffer* fromInternalPointer(void* impl) |
| 68 { | 68 { |
| 69 return static_cast<ArrayBuffer*>(impl); | 69 return static_cast<ArrayBuffer*>(impl); |
| 70 } | 70 } |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 friend v8::Handle<v8::Object> wrap(ArrayBuffer*, v8::Handle<v8::Object> crea
tionContext, v8::Isolate*); | 73 friend v8::Handle<v8::Object> wrap(ArrayBuffer*, v8::Handle<v8::Object> crea
tionContext, v8::Isolate*); |
| 74 static v8::Handle<v8::Object> createWrapper(PassRefPtr<ArrayBuffer>, v8::Han
dle<v8::Object> creationContext, v8::Isolate*); | 74 static v8::Handle<v8::Object> createWrapper(PassRefPtr<ArrayBuffer>, v8::Han
dle<v8::Object> creationContext, v8::Isolate*); |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 template<> | |
| 78 class WrapperTypeTraits<ArrayBuffer > { | |
| 79 public: | |
| 80 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8ArrayBuffer::wra
pperTypeInfo; } | |
| 81 }; | |
| 82 | |
| 83 | |
| 84 inline v8::Handle<v8::Object> wrap(ArrayBuffer* impl, v8::Handle<v8::Object> cre
ationContext, v8::Isolate* isolate) | 77 inline v8::Handle<v8::Object> wrap(ArrayBuffer* impl, v8::Handle<v8::Object> cre
ationContext, v8::Isolate* isolate) |
| 85 { | 78 { |
| 86 ASSERT(impl); | 79 ASSERT(impl); |
| 87 ASSERT(!DOMDataStore::containsWrapper<V8ArrayBuffer>(impl, isolate)); | 80 ASSERT(!DOMDataStore::containsWrapper<V8ArrayBuffer>(impl, isolate)); |
| 88 return V8ArrayBuffer::createWrapper(impl, creationContext, isolate); | 81 return V8ArrayBuffer::createWrapper(impl, creationContext, isolate); |
| 89 } | 82 } |
| 90 | 83 |
| 91 inline v8::Handle<v8::Value> toV8(ArrayBuffer* impl, v8::Handle<v8::Object> crea
tionContext, v8::Isolate* isolate) | 84 inline v8::Handle<v8::Value> toV8(ArrayBuffer* impl, v8::Handle<v8::Object> crea
tionContext, v8::Isolate* isolate) |
| 92 { | 85 { |
| 93 if (UNLIKELY(!impl)) | 86 if (UNLIKELY(!impl)) |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 150 |
| 158 template<class CallbackInfo, class Wrappable> | 151 template<class CallbackInfo, class Wrappable> |
| 159 inline void v8SetReturnValueFast(const CallbackInfo& info, PassRefPtr< ArrayBuff
er > impl, Wrappable* wrappable) | 152 inline void v8SetReturnValueFast(const CallbackInfo& info, PassRefPtr< ArrayBuff
er > impl, Wrappable* wrappable) |
| 160 { | 153 { |
| 161 v8SetReturnValueFast(info, impl.get(), wrappable); | 154 v8SetReturnValueFast(info, impl.get(), wrappable); |
| 162 } | 155 } |
| 163 | 156 |
| 164 } // namespace WebCore | 157 } // namespace WebCore |
| 165 | 158 |
| 166 #endif // V8ArrayBufferCustom_h | 159 #endif // V8ArrayBufferCustom_h |
| OLD | NEW |