| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 return static_cast<TestObj*>(V8EventTarget::fromInternalPointer(object))
; | 70 return static_cast<TestObj*>(V8EventTarget::fromInternalPointer(object))
; |
| 71 } | 71 } |
| 72 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestO
bj*, v8::Isolate*); | 72 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestO
bj*, v8::Isolate*); |
| 73 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*); | 73 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*); |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 friend v8::Handle<v8::Object> wrap(TestObj*, v8::Handle<v8::Object> creation
Context, v8::Isolate*); | 76 friend v8::Handle<v8::Object> wrap(TestObj*, v8::Handle<v8::Object> creation
Context, v8::Isolate*); |
| 77 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestObj>, v8::Handle<
v8::Object> creationContext, v8::Isolate*); | 77 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestObj>, v8::Handle<
v8::Object> creationContext, v8::Isolate*); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 template<> | |
| 81 class WrapperTypeTraits<TestObj > { | |
| 82 public: | |
| 83 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestObject::wrap
perTypeInfo; } | |
| 84 }; | |
| 85 | |
| 86 inline v8::Handle<v8::Object> wrap(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) | 80 inline v8::Handle<v8::Object> wrap(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) |
| 87 { | 81 { |
| 88 ASSERT(impl); | 82 ASSERT(impl); |
| 89 ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl, isolate)); | 83 ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl, isolate)); |
| 90 return V8TestObject::createWrapper(impl, creationContext, isolate); | 84 return V8TestObject::createWrapper(impl, creationContext, isolate); |
| 91 } | 85 } |
| 92 | 86 |
| 93 inline v8::Handle<v8::Value> toV8(TestObj* impl, v8::Handle<v8::Object> creation
Context, v8::Isolate* isolate) | 87 inline v8::Handle<v8::Value> toV8(TestObj* impl, v8::Handle<v8::Object> creation
Context, v8::Isolate* isolate) |
| 94 { | 88 { |
| 95 if (UNLIKELY(!impl)) | 89 if (UNLIKELY(!impl)) |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 } | 152 } |
| 159 | 153 |
| 160 template<class CallbackInfo, class Wrappable> | 154 template<class CallbackInfo, class Wrappable> |
| 161 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stObj> impl, Wrappable* wrappable) | 155 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stObj> impl, Wrappable* wrappable) |
| 162 { | 156 { |
| 163 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 157 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
| 164 } | 158 } |
| 165 | 159 |
| 166 } | 160 } |
| 167 #endif // V8TestObject_h | 161 #endif // V8TestObject_h |
| OLD | NEW |