| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 { | 73 { |
| 74 if (UNLIKELY(!impl)) | 74 if (UNLIKELY(!impl)) |
| 75 return v8NullWithCheck(isolate); | 75 return v8NullWithCheck(isolate); |
| 76 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<Binding>(impl,
isolate); | 76 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<Binding>(impl,
isolate); |
| 77 if (!wrapper.IsEmpty()) | 77 if (!wrapper.IsEmpty()) |
| 78 return wrapper; | 78 return wrapper; |
| 79 return wrap(impl, creationContext, isolate); | 79 return wrap(impl, creationContext, isolate); |
| 80 } | 80 } |
| 81 | 81 |
| 82 template<typename CallbackInfo> | 82 template<typename CallbackInfo> |
| 83 static void v8SetReturnValue(const CallbackInfo& callbackInfo, TypedArray* i
mpl, v8::Handle<v8::Object> creationContext) | 83 static void v8SetReturnValue(const CallbackInfo& callbackInfo, TypedArray* i
mpl) |
| 84 { | 84 { |
| 85 if (UNLIKELY(!impl)) { | 85 if (UNLIKELY(!impl)) { |
| 86 v8SetReturnValueNull(callbackInfo); | 86 v8SetReturnValueNull(callbackInfo); |
| 87 return; | 87 return; |
| 88 } | 88 } |
| 89 if (DOMDataStore::setReturnValueFromWrapper<Binding>(callbackInfo.GetRet
urnValue(), impl)) | 89 if (DOMDataStore::setReturnValueFromWrapper<Binding>(callbackInfo.GetRet
urnValue(), impl)) |
| 90 return; | 90 return; |
| 91 v8::Handle<v8::Object> wrapper = wrap(impl, creationContext, callbackInf
o.GetIsolate()); | 91 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callb
ackInfo.GetIsolate()); |
| 92 callbackInfo.GetReturnValue().Set(wrapper); | 92 callbackInfo.GetReturnValue().Set(wrapper); |
| 93 } | 93 } |
| 94 | 94 |
| 95 template<typename CallbackInfo> | 95 template<typename CallbackInfo> |
| 96 static void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, T
ypedArray* impl, v8::Handle<v8::Object> creationContext) | 96 static void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, T
ypedArray* impl) |
| 97 { | 97 { |
| 98 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); | 98 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); |
| 99 if (UNLIKELY(!impl)) { | 99 if (UNLIKELY(!impl)) { |
| 100 v8SetReturnValueNull(callbackInfo); | 100 v8SetReturnValueNull(callbackInfo); |
| 101 return; | 101 return; |
| 102 } | 102 } |
| 103 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<Binding>(callbac
kInfo.GetReturnValue(), impl)) | 103 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<Binding>(callbac
kInfo.GetReturnValue(), impl)) |
| 104 return; | 104 return; |
| 105 v8::Handle<v8::Value> wrapper = wrap(impl, creationContext, callbackInfo
.GetIsolate()); | 105 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callba
ckInfo.GetIsolate()); |
| 106 callbackInfo.GetReturnValue().Set(wrapper); | 106 callbackInfo.GetReturnValue().Set(wrapper); |
| 107 } | 107 } |
| 108 | 108 |
| 109 template<class CallbackInfo, class Wrappable> | 109 template<class CallbackInfo, class Wrappable> |
| 110 static void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TypedArra
y* impl, Wrappable* wrappable) | 110 static void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TypedArra
y* impl, Wrappable* wrappable) |
| 111 { | 111 { |
| 112 if (UNLIKELY(!impl)) { | 112 if (UNLIKELY(!impl)) { |
| 113 v8SetReturnValueNull(callbackInfo); | 113 v8SetReturnValueNull(callbackInfo); |
| 114 return; | 114 return; |
| 115 } | 115 } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 template <typename TypedArray> | 184 template <typename TypedArray> |
| 185 void V8TypedArray<TypedArray>::derefObject(void* object) | 185 void V8TypedArray<TypedArray>::derefObject(void* object) |
| 186 { | 186 { |
| 187 static_cast<TypedArray*>(object)->deref(); | 187 static_cast<TypedArray*>(object)->deref(); |
| 188 } | 188 } |
| 189 | 189 |
| 190 | 190 |
| 191 } // namespace WebCode | 191 } // namespace WebCode |
| 192 | 192 |
| 193 #endif // V8TypedArrayCustom_h | 193 #endif // V8TypedArrayCustom_h |
| OLD | NEW |