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

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

Issue 531183003: bindings: Retires manual dispatching in createV8{HTML,SVG}Wrapper, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added FIXME comments. Created 6 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "V8TestInterfaceDocument.h" 8 #include "V8TestInterfaceDocument.h"
9 9
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 TestInterfaceDocument* V8TestInterfaceDocument::toNativeWithTypeCheck(v8::Isolat e* isolate, v8::Handle<v8::Value> value) 85 TestInterfaceDocument* V8TestInterfaceDocument::toNativeWithTypeCheck(v8::Isolat e* isolate, v8::Handle<v8::Value> value)
86 { 86 {
87 return hasInstance(value, isolate) ? fromInternalPointer(blink::toInternalPo inter(v8::Handle<v8::Object>::Cast(value))) : 0; 87 return hasInstance(value, isolate) ? fromInternalPointer(blink::toInternalPo inter(v8::Handle<v8::Object>::Cast(value))) : 0;
88 } 88 }
89 89
90 EventTarget* V8TestInterfaceDocument::toEventTarget(v8::Handle<v8::Object> objec t) 90 EventTarget* V8TestInterfaceDocument::toEventTarget(v8::Handle<v8::Object> objec t)
91 { 91 {
92 return toNative(object); 92 return toNative(object);
93 } 93 }
94 94
95 v8::Handle<v8::Object> wrap(TestInterfaceDocument* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
96 {
97 ASSERT(impl);
98 v8::Handle<v8::Object> wrapper = V8TestInterfaceDocument::createWrapper(impl , creationContext, isolate);
99 if (wrapper.IsEmpty())
100 return wrapper;
101 DOMWrapperWorld& world = DOMWrapperWorld::current(isolate);
102 if (world.isMainWorld()) {
103 if (LocalFrame* frame = impl->frame())
104 frame->script().windowProxy(world)->updateDocumentWrapper(wrapper);
105 }
106 return wrapper;
107 }
108
109 v8::Handle<v8::Object> V8TestInterfaceDocument::createWrapper(PassRefPtrWillBeRa wPtr<TestInterfaceDocument> impl, v8::Handle<v8::Object> creationContext, v8::Is olate* isolate)
110 {
111 ASSERT(impl);
112 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceDocument>(impl.get(), i solate));
113 const WrapperTypeInfo* actualInfo = impl->typeInfo();
114 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperType Info. These will both have
115 // the same object de-ref functions, though, so use that as the basis of the check.
116 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
117
118 if (LocalFrame* frame = impl->frame()) {
119 if (frame->script().initializeMainWorld()) {
120 // initializeMainWorld may have created a wrapper for the object, re try from the start.
121 v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapper<V8TestInte rfaceDocument>(impl.get(), isolate);
122 if (!wrapper.IsEmpty())
123 return wrapper;
124 }
125 }
126 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
127 if (UNLIKELY(wrapper.IsEmpty()))
128 return wrapper;
129
130 installConditionallyEnabledProperties(wrapper, isolate);
131 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceDocument>(impl, &wra pperTypeInfo, wrapper, isolate);
132 return wrapper;
133 }
134
135 95
136 void V8TestInterfaceDocument::refObject(ScriptWrappableBase* internalPointer) 96 void V8TestInterfaceDocument::refObject(ScriptWrappableBase* internalPointer)
137 { 97 {
138 #if !ENABLE(OILPAN) 98 #if !ENABLE(OILPAN)
139 fromInternalPointer(internalPointer)->ref(); 99 fromInternalPointer(internalPointer)->ref();
140 #endif 100 #endif
141 } 101 }
142 102
143 void V8TestInterfaceDocument::derefObject(ScriptWrappableBase* internalPointer) 103 void V8TestInterfaceDocument::derefObject(ScriptWrappableBase* internalPointer)
144 { 104 {
(...skipping 12 matching lines...) Expand all
157 #endif 117 #endif
158 } 118 }
159 119
160 template<> 120 template<>
161 v8::Handle<v8::Value> toV8NoInline(TestInterfaceDocument* impl, v8::Handle<v8::O bject> creationContext, v8::Isolate* isolate) 121 v8::Handle<v8::Value> toV8NoInline(TestInterfaceDocument* impl, v8::Handle<v8::O bject> creationContext, v8::Isolate* isolate)
162 { 122 {
163 return toV8(impl, creationContext, isolate); 123 return toV8(impl, creationContext, isolate);
164 } 124 }
165 125
166 } // namespace blink 126 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterfaceDocument.h ('k') | Source/bindings/tests/results/V8TestInterfaceEmpty.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698