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 namespace TestInterfacePython2V8Internal { | 74 namespace TestInterfacePython2V8Internal { |
75 | 75 |
76 template <typename T> void V8_USE(T) { } | 76 template <typename T> void V8_USE(T) { } |
77 | 77 |
78 } // namespace TestInterfacePython2V8Internal | 78 } // namespace TestInterfacePython2V8Internal |
79 | 79 |
80 void V8TestInterfacePython2::visitDOMWrapper(void* object, const v8::Persistent<
v8::Object>& wrapper, v8::Isolate* isolate) | 80 void V8TestInterfacePython2::visitDOMWrapper(void* object, const v8::Persistent<
v8::Object>& wrapper, v8::Isolate* isolate) |
81 { | 81 { |
82 TestInterfacePython2* impl = fromInternalPointer(object); | 82 TestInterfacePython2* impl = fromInternalPointer(object); |
83 if (Node* owner = impl->ownerNode()) { | 83 // The ownerNode() method may return a reference or a pointer but |
84 Node* root = V8GCController::opaqueRootForGC(owner, isolate); | 84 // RefPtr can be constructed from either. |
| 85 if (RefPtr<Node> owner = PassRefPtr<Node>(impl->ownerNode())) { |
| 86 Node* root = V8GCController::opaqueRootForGC(owner.get(), isolate); |
85 isolate->SetReferenceFromGroup(v8::UniqueId(reinterpret_cast<intptr_t>(r
oot)), wrapper); | 87 isolate->SetReferenceFromGroup(v8::UniqueId(reinterpret_cast<intptr_t>(r
oot)), wrapper); |
86 return; | 88 return; |
87 } | 89 } |
88 setObjectGroup(object, wrapper, isolate); | 90 setObjectGroup(object, wrapper, isolate); |
89 } | 91 } |
90 | 92 |
91 static void configureV8TestInterfacePython2Template(v8::Handle<v8::FunctionTempl
ate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType) | 93 static void configureV8TestInterfacePython2Template(v8::Handle<v8::FunctionTempl
ate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType) |
92 { | 94 { |
93 functionTemplate->ReadOnlyPrototype(); | 95 functionTemplate->ReadOnlyPrototype(); |
94 | 96 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 fromInternalPointer(object)->deref(); | 172 fromInternalPointer(object)->deref(); |
171 } | 173 } |
172 | 174 |
173 template<> | 175 template<> |
174 v8::Handle<v8::Value> toV8NoInline(TestInterfacePython2* impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) | 176 v8::Handle<v8::Value> toV8NoInline(TestInterfacePython2* impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) |
175 { | 177 { |
176 return toV8(impl, creationContext, isolate); | 178 return toV8(impl, creationContext, isolate); |
177 } | 179 } |
178 | 180 |
179 } // namespace WebCore | 181 } // namespace WebCore |
OLD | NEW |