Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: Source/bindings/tests/results/V8TestInterfacePython2.cpp

Issue 209893002: Custom wrap constructor overloads. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
73 namespace WebCore { 73 namespace WebCore {
74 const WrapperTypeInfo V8TestInterfacePython2::wrapperTypeInfo = { gin::kEmbedder Blink, V8TestInterfacePython2::domTemplate, V8TestInterfacePython2::derefObject, 0, 0, V8TestInterfacePython2::visitDOMWrapper, V8TestInterfacePython2::installP erContextEnabledMethods, 0, WrapperTypeObjectPrototype, false }; 74 const WrapperTypeInfo V8TestInterfacePython2::wrapperTypeInfo = { gin::kEmbedder Blink, V8TestInterfacePython2::domTemplate, V8TestInterfacePython2::derefObject, 0, 0, V8TestInterfacePython2::visitDOMWrapper, V8TestInterfacePython2::installP erContextEnabledMethods, 0, WrapperTypeObjectPrototype, false };
75 75
76 namespace TestInterfacePython2V8Internal { 76 namespace TestInterfacePython2V8Internal {
77 77
78 template <typename T> void V8_USE(T) { } 78 template <typename T> void V8_USE(T) { }
79 79
80 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 80 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
81 { 81 {
82 RefPtr<TestInterfacePython2> impl = TestInterfacePython2::create(); 82 RefPtr<TestInterfacePython2> impl = TestInterfacePython2::create();
83 v8::Handle<v8::Object> wrapper = info.Holder();
84 83
85 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfacePython2>(impl.releas e(), &V8TestInterfacePython2::wrapperTypeInfo, wrapper, info.GetIsolate(), Wrapp erConfiguration::Dependent); 84 v8SetReturnValue(info, wrap(impl.get(), info.Holder(), info.GetIsolate()));
86 v8SetReturnValue(info, wrapper);
87 } 85 }
88 86
89 } // namespace TestInterfacePython2V8Internal 87 } // namespace TestInterfacePython2V8Internal
90 88
91 void V8TestInterfacePython2::visitDOMWrapper(void* object, const v8::Persistent< v8::Object>& wrapper, v8::Isolate* isolate) 89 void V8TestInterfacePython2::visitDOMWrapper(void* object, const v8::Persistent< v8::Object>& wrapper, v8::Isolate* isolate)
92 { 90 {
93 TestInterfacePython2* impl = fromInternalPointer(object); 91 TestInterfacePython2* impl = fromInternalPointer(object);
94 // The ownerNode() method may return a reference or a pointer. 92 // The ownerNode() method may return a reference or a pointer.
95 if (Node* owner = WTF::getPtr(impl->ownerNode())) { 93 if (Node* owner = WTF::getPtr(impl->ownerNode())) {
96 Node* root = V8GCController::opaqueRootForGC(owner, isolate); 94 Node* root = V8GCController::opaqueRootForGC(owner, isolate);
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 fromInternalPointer(object)->deref(); 198 fromInternalPointer(object)->deref();
201 } 199 }
202 200
203 template<> 201 template<>
204 v8::Handle<v8::Value> toV8NoInline(TestInterfacePython2* impl, v8::Handle<v8::Ob ject> creationContext, v8::Isolate* isolate) 202 v8::Handle<v8::Value> toV8NoInline(TestInterfacePython2* impl, v8::Handle<v8::Ob ject> creationContext, v8::Isolate* isolate)
205 { 203 {
206 return toV8(impl, creationContext, isolate); 204 return toV8(impl, creationContext, isolate);
207 } 205 }
208 206
209 } // namespace WebCore 207 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698