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

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

Issue 1019773006: use non-masking, string interceptors in generated bindings (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix test Created 5 years, 8 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 // 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 "V8TestSpecialOperationsNotEnumerable.h" 8 #include "V8TestSpecialOperationsNotEnumerable.h"
9 9
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
(...skipping 29 matching lines...) Expand all
40 40
41 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall backInfo<v8::Value>& info) 41 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall backInfo<v8::Value>& info)
42 { 42 {
43 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMIndexedProperty"); 43 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMIndexedProperty");
44 TestSpecialOperationsNotEnumerableV8Internal::indexedPropertyGetter(index, i nfo); 44 TestSpecialOperationsNotEnumerableV8Internal::indexedPropertyGetter(index, i nfo);
45 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 45 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
46 } 46 }
47 47
48 static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCall backInfo<v8::Value>& info) 48 static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCall backInfo<v8::Value>& info)
49 { 49 {
50 if (!name->IsString())
51 return;
52 auto nameString = name.As<v8::String>(); 50 auto nameString = name.As<v8::String>();
53 v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext();
54 if (v8CallBoolean(info.Holder()->HasRealNamedProperty(context, nameString)))
55 return;
56 v8::Local<v8::Value> namedPropertyValue;
57 if (info.Holder()->GetRealNamedPropertyInPrototypeChain(context, nameString) .ToLocal(&namedPropertyValue))
58 return;
59
60 TestSpecialOperationsNotEnumerable* impl = V8TestSpecialOperationsNotEnumera ble::toImpl(info.Holder()); 51 TestSpecialOperationsNotEnumerable* impl = V8TestSpecialOperationsNotEnumera ble::toImpl(info.Holder());
61 AtomicString propertyName = toCoreAtomicString(nameString); 52 AtomicString propertyName = toCoreAtomicString(nameString);
62 String result = impl->anonymousNamedGetter(propertyName); 53 String result = impl->anonymousNamedGetter(propertyName);
63 if (result.isNull()) 54 if (result.isNull())
64 return; 55 return;
65 v8SetReturnValueString(info, result, info.GetIsolate()); 56 v8SetReturnValueString(info, result, info.GetIsolate());
66 } 57 }
67 58
68 static void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::Prop ertyCallbackInfo<v8::Value>& info) 59 static void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::Prop ertyCallbackInfo<v8::Value>& info)
69 { 60 {
(...skipping 16 matching lines...) Expand all
86 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate(); 77 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate();
87 ALLOW_UNUSED_LOCAL(instanceTemplate); 78 ALLOW_UNUSED_LOCAL(instanceTemplate);
88 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate(); 79 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate();
89 ALLOW_UNUSED_LOCAL(prototypeTemplate); 80 ALLOW_UNUSED_LOCAL(prototypeTemplate);
90 { 81 {
91 v8::IndexedPropertyHandlerConfiguration config(TestSpecialOperationsNotE numerableV8Internal::indexedPropertyGetterCallback, 0, 0, 0, 0); 82 v8::IndexedPropertyHandlerConfiguration config(TestSpecialOperationsNotE numerableV8Internal::indexedPropertyGetterCallback, 0, 0, 0, 0);
92 functionTemplate->InstanceTemplate()->SetHandler(config); 83 functionTemplate->InstanceTemplate()->SetHandler(config);
93 } 84 }
94 { 85 {
95 v8::NamedPropertyHandlerConfiguration config(TestSpecialOperationsNotEnu merableV8Internal::namedPropertyGetterCallback, 0, 0, 0, 0); 86 v8::NamedPropertyHandlerConfiguration config(TestSpecialOperationsNotEnu merableV8Internal::namedPropertyGetterCallback, 0, 0, 0, 0);
87 config.flags = static_cast<v8::PropertyHandlerFlags>(static_cast<int>(co nfig.flags) | static_cast<int>(v8::PropertyHandlerFlags::kOnlyInterceptStrings)) ;
88 config.flags = static_cast<v8::PropertyHandlerFlags>(static_cast<int>(co nfig.flags) | static_cast<int>(v8::PropertyHandlerFlags::kNonMasking));
96 functionTemplate->InstanceTemplate()->SetHandler(config); 89 functionTemplate->InstanceTemplate()->SetHandler(config);
97 } 90 }
98 91
99 // Custom toString template 92 // Custom toString template
100 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :from(isolate)->toStringTemplate()); 93 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :from(isolate)->toStringTemplate());
101 } 94 }
102 95
103 v8::Local<v8::FunctionTemplate> V8TestSpecialOperationsNotEnumerable::domTemplat e(v8::Isolate* isolate) 96 v8::Local<v8::FunctionTemplate> V8TestSpecialOperationsNotEnumerable::domTemplat e(v8::Isolate* isolate)
104 { 97 {
105 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI nfo*>(&wrapperTypeInfo), installV8TestSpecialOperationsNotEnumerableTemplate); 98 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI nfo*>(&wrapperTypeInfo), installV8TestSpecialOperationsNotEnumerableTemplate);
(...skipping 18 matching lines...) Expand all
124 { 117 {
125 scriptWrappable->toImpl<TestSpecialOperationsNotEnumerable>()->ref(); 118 scriptWrappable->toImpl<TestSpecialOperationsNotEnumerable>()->ref();
126 } 119 }
127 120
128 void V8TestSpecialOperationsNotEnumerable::derefObject(ScriptWrappable* scriptWr appable) 121 void V8TestSpecialOperationsNotEnumerable::derefObject(ScriptWrappable* scriptWr appable)
129 { 122 {
130 scriptWrappable->toImpl<TestSpecialOperationsNotEnumerable>()->deref(); 123 scriptWrappable->toImpl<TestSpecialOperationsNotEnumerable>()->deref();
131 } 124 }
132 125
133 } // namespace blink 126 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698