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

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

Issue 1257613003: bindings: Supports inheritance of [Unforgeable] attributes as accessor-type properties. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Made inherit_unforgeable_attributes more robust. Created 5 years, 4 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"
11 #include "bindings/core/v8/V8DOMConfiguration.h" 11 #include "bindings/core/v8/V8DOMConfiguration.h"
12 #include "bindings/core/v8/V8Location.h"
12 #include "bindings/core/v8/V8ObjectConstructor.h" 13 #include "bindings/core/v8/V8ObjectConstructor.h"
14 #include "core/animation/DocumentAnimation.h"
15 #include "core/css/DocumentFontFaceSet.h"
13 #include "core/dom/ContextFeatures.h" 16 #include "core/dom/ContextFeatures.h"
14 #include "core/dom/Document.h" 17 #include "core/dom/Document.h"
18 #include "core/dom/DocumentFullscreen.h"
19 #include "core/svg/SVGDocumentExtensions.h"
20 #include "core/xml/DocumentXPathEvaluator.h"
15 #include "platform/RuntimeEnabledFeatures.h" 21 #include "platform/RuntimeEnabledFeatures.h"
16 #include "platform/TraceEvent.h" 22 #include "platform/TraceEvent.h"
17 #include "wtf/GetPtr.h" 23 #include "wtf/GetPtr.h"
18 #include "wtf/RefPtr.h" 24 #include "wtf/RefPtr.h"
19 25
20 namespace blink { 26 namespace blink {
21 27
22 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv ial 28 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv ial
23 // and does not depend on another global objects. 29 // and does not depend on another global objects.
24 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) 30 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
25 #pragma clang diagnostic push 31 #pragma clang diagnostic push
26 #pragma clang diagnostic ignored "-Wglobal-constructors" 32 #pragma clang diagnostic ignored "-Wglobal-constructors"
27 #endif 33 #endif
28 const WrapperTypeInfo V8TestInterfaceDocument::wrapperTypeInfo = { gin::kEmbedde rBlink, V8TestInterfaceDocument::domTemplate, V8TestInterfaceDocument::refObject , V8TestInterfaceDocument::derefObject, V8TestInterfaceDocument::trace, 0, 0, V8 TestInterfaceDocument::preparePrototypeObject, V8TestInterfaceDocument::installC onditionallyEnabledProperties, "TestInterfaceDocument", &V8Document::wrapperType Info, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::NodeClassId, WrapperTypeInfo::InheritFromEventTarget, WrapperTypeInfo::Dependent, WrapperTyp eInfo::WillBeGarbageCollectedObject }; 34 const WrapperTypeInfo V8TestInterfaceDocument::wrapperTypeInfo = { gin::kEmbedde rBlink, V8TestInterfaceDocument::domTemplate, V8TestInterfaceDocument::refObject , V8TestInterfaceDocument::derefObject, V8TestInterfaceDocument::trace, 0, 0, V8 TestInterfaceDocument::preparePrototypeObject, V8TestInterfaceDocument::installC onditionallyEnabledProperties, "TestInterfaceDocument", &V8Document::wrapperType Info, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::NodeClassId, WrapperTypeInfo::InheritFromEventTarget, WrapperTypeInfo::Dependent, WrapperTyp eInfo::WillBeGarbageCollectedObject };
29 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) 35 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
30 #pragma clang diagnostic pop 36 #pragma clang diagnostic pop
31 #endif 37 #endif
32 38
33 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac eDocument.h. 39 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac eDocument.h.
34 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in 40 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
35 // bindings/core/v8/ScriptWrappable.h. 41 // bindings/core/v8/ScriptWrappable.h.
36 const WrapperTypeInfo& TestInterfaceDocument::s_wrapperTypeInfo = V8TestInterfac eDocument::wrapperTypeInfo; 42 const WrapperTypeInfo& TestInterfaceDocument::s_wrapperTypeInfo = V8TestInterfac eDocument::wrapperTypeInfo;
37 43
38 namespace TestInterfaceDocumentV8Internal { 44 namespace TestInterfaceDocumentV8Internal {
39 45
46 static void locationAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
47 {
48 v8::Local<v8::Object> holder = info.Holder();
49 TestInterfaceDocument* impl = V8TestInterfaceDocument::toImpl(holder);
50 v8SetReturnValueFast(info, WTF::getPtr(impl->location()), impl);
51 }
52
53 static void locationAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::V alue>& info)
54 {
55 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
56 TestInterfaceDocumentV8Internal::locationAttributeGetter(info);
57 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
58 }
59
60 static void locationAttributeSetter(v8::Local<v8::Value> v8Value, const v8::Func tionCallbackInfo<v8::Value>& info)
61 {
62 v8::Local<v8::Object> holder = info.Holder();
63 TestInterfaceDocument* proxyImpl = V8TestInterfaceDocument::toImpl(holder);
64 RefPtrWillBeRawPtr<Location> impl = WTF::getPtr(proxyImpl->location());
65 if (!impl)
66 return;
67 V8StringResource<> cppValue = v8Value;
68 if (!cppValue.prepare())
69 return;
70 impl->setHref(callingDOMWindow(info.GetIsolate()), enteredDOMWindow(info.Get Isolate()), cppValue);
71 }
72
73 static void locationAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::V alue>& info)
74 {
75 v8::Local<v8::Value> v8Value = info[0];
76 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
77 TestInterfaceDocumentV8Internal::locationAttributeSetter(v8Value, info);
78 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
79 }
80
40 } // namespace TestInterfaceDocumentV8Internal 81 } // namespace TestInterfaceDocumentV8Internal
41 82
83 static const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceDocumentAc cessors[] = {
84 {"location", TestInterfaceDocumentV8Internal::locationAttributeGetterCallbac k, TestInterfaceDocumentV8Internal::locationAttributeSetterCallback, 0, 0, 0, v8 ::DEFAULT, static_cast<v8::PropertyAttribute>(v8::DontDelete), V8DOMConfiguratio n::ExposedToAllScripts, V8DOMConfiguration::OnInstance, V8DOMConfiguration::Chec kHolder},
85 };
86
42 static void installV8TestInterfaceDocumentTemplate(v8::Local<v8::FunctionTemplat e> functionTemplate, v8::Isolate* isolate) 87 static void installV8TestInterfaceDocumentTemplate(v8::Local<v8::FunctionTemplat e> functionTemplate, v8::Isolate* isolate)
43 { 88 {
44 functionTemplate->ReadOnlyPrototype(); 89 functionTemplate->ReadOnlyPrototype();
45 90
46 v8::Local<v8::Signature> defaultSignature; 91 v8::Local<v8::Signature> defaultSignature;
47 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func tionTemplate, "TestInterfaceDocument", V8Document::domTemplate(isolate), V8TestI nterfaceDocument::internalFieldCount, 92 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func tionTemplate, "TestInterfaceDocument", V8Document::domTemplate(isolate), V8TestI nterfaceDocument::internalFieldCount,
48 0, 0, 93 0, 0,
49 0, 0, 94 V8TestInterfaceDocumentAccessors, WTF_ARRAY_LENGTH(V8TestInterfaceDocume ntAccessors),
50 0, 0); 95 0, 0);
51 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate(); 96 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate();
52 ALLOW_UNUSED_LOCAL(instanceTemplate); 97 ALLOW_UNUSED_LOCAL(instanceTemplate);
53 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate(); 98 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate();
54 ALLOW_UNUSED_LOCAL(prototypeTemplate); 99 ALLOW_UNUSED_LOCAL(prototypeTemplate);
55 100
56 // Custom toString template 101 // Custom toString template
57 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :from(isolate)->toStringTemplate()); 102 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :from(isolate)->toStringTemplate());
58 } 103 }
59 104
(...skipping 25 matching lines...) Expand all
85 } 130 }
86 131
87 void V8TestInterfaceDocument::derefObject(ScriptWrappable* scriptWrappable) 132 void V8TestInterfaceDocument::derefObject(ScriptWrappable* scriptWrappable)
88 { 133 {
89 #if !ENABLE(OILPAN) 134 #if !ENABLE(OILPAN)
90 scriptWrappable->toImpl<TestInterfaceDocument>()->deref(); 135 scriptWrappable->toImpl<TestInterfaceDocument>()->deref();
91 #endif 136 #endif
92 } 137 }
93 138
94 } // namespace blink 139 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698