| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |