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

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

Issue 202203009: Rename |imp| => |impl| in bindings generation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: custom/v8 too 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 | Annotate | Revision Log
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 namespace WebCore { 69 namespace WebCore {
70 const WrapperTypeInfo V8TestInterfaceCheckSecurity::wrapperTypeInfo = { gin::kEm bedderBlink, V8TestInterfaceCheckSecurity::domTemplate, V8TestInterfaceCheckSecu rity::derefObject, 0, 0, 0, V8TestInterfaceCheckSecurity::installPerContextEnabl edMethods, 0, WrapperTypeObjectPrototype, false }; 70 const WrapperTypeInfo V8TestInterfaceCheckSecurity::wrapperTypeInfo = { gin::kEm bedderBlink, V8TestInterfaceCheckSecurity::domTemplate, V8TestInterfaceCheckSecu rity::derefObject, 0, 0, 0, V8TestInterfaceCheckSecurity::installPerContextEnabl edMethods, 0, WrapperTypeObjectPrototype, false };
71 71
72 namespace TestInterfaceCheckSecurityV8Internal { 72 namespace TestInterfaceCheckSecurityV8Internal {
73 73
74 template <typename T> void V8_USE(T) { } 74 template <typename T> void V8_USE(T) { }
75 75
76 static void longAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Valu e>& info) 76 static void longAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Valu e>& info)
77 { 77 {
78 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(inf o.Holder()); 78 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(in fo.Holder());
79 v8SetReturnValueInt(info, imp->longAttribute()); 79 v8SetReturnValueInt(info, impl->longAttribute());
80 } 80 }
81 81
82 static void longAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8 ::PropertyCallbackInfo<v8::Value>& info) 82 static void longAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8 ::PropertyCallbackInfo<v8::Value>& info)
83 { 83 {
84 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 84 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
85 TestInterfaceCheckSecurityV8Internal::longAttributeAttributeGetter(info); 85 TestInterfaceCheckSecurityV8Internal::longAttributeAttributeGetter(info);
86 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 86 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
87 } 87 }
88 88
89 static void doNotCheckSecurityLongAttributeAttributeGetter(const v8::PropertyCal lbackInfo<v8::Value>& info) 89 static void doNotCheckSecurityLongAttributeAttributeGetter(const v8::PropertyCal lbackInfo<v8::Value>& info)
90 { 90 {
91 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(inf o.Holder()); 91 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(in fo.Holder());
92 v8SetReturnValueInt(info, imp->doNotCheckSecurityLongAttribute()); 92 v8SetReturnValueInt(info, impl->doNotCheckSecurityLongAttribute());
93 } 93 }
94 94
95 static void doNotCheckSecurityLongAttributeAttributeGetterCallback(v8::Local<v8: :String>, const v8::PropertyCallbackInfo<v8::Value>& info) 95 static void doNotCheckSecurityLongAttributeAttributeGetterCallback(v8::Local<v8: :String>, const v8::PropertyCallbackInfo<v8::Value>& info)
96 { 96 {
97 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 97 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
98 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttribu teGetter(info); 98 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttribu teGetter(info);
99 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 99 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
100 } 100 }
101 101
102 static void doNotCheckSecurityLongAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 102 static void doNotCheckSecurityLongAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
103 { 103 {
104 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecu rityLongAttribute", "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate ()); 104 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecu rityLongAttribute", "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate ());
105 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(inf o.Holder()); 105 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(in fo.Holder());
106 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e xceptionState); 106 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e xceptionState);
107 imp->setDoNotCheckSecurityLongAttribute(cppValue); 107 impl->setDoNotCheckSecurityLongAttribute(cppValue);
108 } 108 }
109 109
110 static void doNotCheckSecurityLongAttributeAttributeSetterCallback(v8::Local<v8: :String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& in fo) 110 static void doNotCheckSecurityLongAttributeAttributeSetterCallback(v8::Local<v8: :String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& in fo)
111 { 111 {
112 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 112 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
113 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttribu teSetter(jsValue, info); 113 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttribu teSetter(jsValue, info);
114 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 114 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
115 } 115 }
116 116
117 static void doNotCheckSecurityReadonlyLongAttributeAttributeGetter(const v8::Pro pertyCallbackInfo<v8::Value>& info) 117 static void doNotCheckSecurityReadonlyLongAttributeAttributeGetter(const v8::Pro pertyCallbackInfo<v8::Value>& info)
118 { 118 {
119 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(inf o.Holder()); 119 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(in fo.Holder());
120 v8SetReturnValueInt(info, imp->doNotCheckSecurityReadonlyLongAttribute()); 120 v8SetReturnValueInt(info, impl->doNotCheckSecurityReadonlyLongAttribute());
121 } 121 }
122 122
123 static void doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback(v8::L ocal<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 123 static void doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback(v8::L ocal<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
124 { 124 {
125 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 125 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
126 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadonlyLongAttribut eAttributeGetter(info); 126 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadonlyLongAttribut eAttributeGetter(info);
127 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 127 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
128 } 128 }
129 129
130 static void doNotCheckSecurityOnSetterLongAttributeAttributeGetter(const v8::Pro pertyCallbackInfo<v8::Value>& info) 130 static void doNotCheckSecurityOnSetterLongAttributeAttributeGetter(const v8::Pro pertyCallbackInfo<v8::Value>& info)
131 { 131 {
132 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(inf o.Holder()); 132 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(in fo.Holder());
133 v8SetReturnValueInt(info, imp->doNotCheckSecurityOnSetterLongAttribute()); 133 v8SetReturnValueInt(info, impl->doNotCheckSecurityOnSetterLongAttribute());
134 } 134 }
135 135
136 static void doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback(v8::L ocal<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 136 static void doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback(v8::L ocal<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
137 { 137 {
138 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 138 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
139 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttribut eAttributeGetter(info); 139 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttribut eAttributeGetter(info);
140 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 140 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
141 } 141 }
142 142
143 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetter(v8::Local<v8: :Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 143 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetter(v8::Local<v8: :Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
144 { 144 {
145 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecu rityOnSetterLongAttribute", "TestInterfaceCheckSecurity", info.Holder(), info.Ge tIsolate()); 145 ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecu rityOnSetterLongAttribute", "TestInterfaceCheckSecurity", info.Holder(), info.Ge tIsolate());
146 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(inf o.Holder()); 146 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(in fo.Holder());
147 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e xceptionState); 147 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), e xceptionState);
148 imp->setDoNotCheckSecurityOnSetterLongAttribute(cppValue); 148 impl->setDoNotCheckSecurityOnSetterLongAttribute(cppValue);
149 } 149 }
150 150
151 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback(v8::L ocal<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v oid>& info) 151 static void doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback(v8::L ocal<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v oid>& info)
152 { 152 {
153 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 153 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
154 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttribut eAttributeSetter(jsValue, info); 154 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttribut eAttributeSetter(jsValue, info);
155 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 155 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
156 } 156 }
157 157
158 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetter(co nst v8::PropertyCallbackInfo<v8::Value>& info) 158 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetter(co nst v8::PropertyCallbackInfo<v8::Value>& info)
159 { 159 {
160 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(inf o.Holder()); 160 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(in fo.Holder());
161 v8SetReturnValueInt(info, imp->doNotCheckSecurityReplaceableReadonlyLongAttr ibute()); 161 v8SetReturnValueInt(info, impl->doNotCheckSecurityReplaceableReadonlyLongAtt ribute());
162 } 162 }
163 163
164 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetterCal lback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 164 static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetterCal lback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
165 { 165 {
166 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 166 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
167 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyL ongAttributeAttributeGetter(info); 167 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyL ongAttributeAttributeGetter(info);
168 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 168 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
169 } 169 }
170 170
171 static void TestInterfaceCheckSecurityReplaceableAttributeSetter(v8::Local<v8::S tring> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 171 static void TestInterfaceCheckSecurityReplaceableAttributeSetter(v8::Local<v8::S tring> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
172 { 172 {
173 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(inf o.Holder()); 173 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(in fo.Holder());
174 v8::String::Utf8Value attributeName(name); 174 v8::String::Utf8Value attributeName(name);
175 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate()); 175 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate());
176 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame (), exceptionState)) { 176 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram e(), exceptionState)) {
177 exceptionState.throwIfNeeded(); 177 exceptionState.throwIfNeeded();
178 return; 178 return;
179 } 179 }
180 info.This()->ForceSet(name, jsValue); 180 info.This()->ForceSet(name, jsValue);
181 } 181 }
182 182
183 static void TestInterfaceCheckSecurityReplaceableAttributeSetterCallback(v8::Loc al<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInf o<void>& info) 183 static void TestInterfaceCheckSecurityReplaceableAttributeSetterCallback(v8::Loc al<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInf o<void>& info)
184 { 184 {
185 TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityReplaceableA ttributeSetter(name, jsValue, info); 185 TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityReplaceableA ttributeSetter(name, jsValue, info);
186 } 186 }
187 187
188 bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::Access Type type, v8::Local<v8::Value>) 188 bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::Access Type type, v8::Local<v8::Value>)
189 { 189 {
190 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(ho st); 190 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(ho st);
191 return BindingSecurity::shouldAllowAccessToFrame(v8::Isolate::GetCurrent(), imp->frame(), DoNotReportSecurityError); 191 return BindingSecurity::shouldAllowAccessToFrame(v8::Isolate::GetCurrent(), impl->frame(), DoNotReportSecurityError);
192 } 192 }
193 193
194 bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8 ::AccessType type, v8::Local<v8::Value>) 194 bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8 ::AccessType type, v8::Local<v8::Value>)
195 { 195 {
196 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(ho st); 196 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(ho st);
197 return BindingSecurity::shouldAllowAccessToFrame(v8::Isolate::GetCurrent(), imp->frame(), DoNotReportSecurityError); 197 return BindingSecurity::shouldAllowAccessToFrame(v8::Isolate::GetCurrent(), impl->frame(), DoNotReportSecurityError);
198 } 198 }
199 199
200 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 200 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
201 { 201 {
202 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethod" , "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate()); 202 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethod" , "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate());
203 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(inf o.Holder()); 203 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(in fo.Holder());
204 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame (), exceptionState)) { 204 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram e(), exceptionState)) {
205 exceptionState.throwIfNeeded(); 205 exceptionState.throwIfNeeded();
206 return; 206 return;
207 } 207 }
208 imp->voidMethod(); 208 impl->voidMethod();
209 } 209 }
210 210
211 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 211 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
212 { 212 {
213 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 213 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
214 TestInterfaceCheckSecurityV8Internal::voidMethodMethod(info); 214 TestInterfaceCheckSecurityV8Internal::voidMethodMethod(info);
215 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 215 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
216 } 216 }
217 217
218 static void doNotCheckSecurityVoidMethodMethod(const v8::FunctionCallbackInfo<v8 ::Value>& info) 218 static void doNotCheckSecurityVoidMethodMethod(const v8::FunctionCallbackInfo<v8 ::Value>& info)
219 { 219 {
220 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(inf o.Holder()); 220 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(in fo.Holder());
221 imp->doNotCheckSecurityVoidMethod(); 221 impl->doNotCheckSecurityVoidMethod();
222 } 222 }
223 223
224 static void doNotCheckSecurityVoidMethodMethodCallback(const v8::FunctionCallbac kInfo<v8::Value>& info) 224 static void doNotCheckSecurityVoidMethodMethodCallback(const v8::FunctionCallbac kInfo<v8::Value>& info)
225 { 225 {
226 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 226 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
227 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodMethod(inf o); 227 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodMethod(inf o);
228 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 228 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
229 } 229 }
230 230
231 static void doNotCheckSecurityVoidMethodOriginSafeMethodGetter(const v8::Propert yCallbackInfo<v8::Value>& info) 231 static void doNotCheckSecurityVoidMethodOriginSafeMethodGetter(const v8::Propert yCallbackInfo<v8::Value>& info)
232 { 232 {
233 static int domTemplateKey; // This address is used for a key to look up the dom template. 233 static int domTemplateKey; // This address is used for a key to look up the dom template.
234 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); 234 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
235 v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(&domTem plateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodMeth odCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestInterface CheckSecurity::domTemplate(info.GetIsolate())), 0); 235 v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(&domTem plateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodMeth odCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestInterface CheckSecurity::domTemplate(info.GetIsolate())), 0);
236 236
237 v8::Handle<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceIn PrototypeChain(info.This(), info.GetIsolate()); 237 v8::Handle<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceIn PrototypeChain(info.This(), info.GetIsolate());
238 if (holder.IsEmpty()) { 238 if (holder.IsEmpty()) {
239 // This is only reachable via |object.__proto__.func|, in which case it 239 // This is only reachable via |object.__proto__.func|, in which case it
240 // has already passed the same origin security check 240 // has already passed the same origin security check
241 v8SetReturnValue(info, privateTemplate->GetFunction()); 241 v8SetReturnValue(info, privateTemplate->GetFunction());
242 return; 242 return;
243 } 243 }
244 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol der); 244 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(ho lder);
245 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame (), DoNotReportSecurityError)) { 245 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram e(), DoNotReportSecurityError)) {
246 static int sharedTemplateKey; // This address is used for a key to look up the dom template. 246 static int sharedTemplateKey; // This address is used for a key to look up the dom template.
247 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(&sha redTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMeth odMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestInt erfaceCheckSecurity::domTemplate(info.GetIsolate())), 0); 247 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(&sha redTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMeth odMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestInt erfaceCheckSecurity::domTemplate(info.GetIsolate())), 0);
248 v8SetReturnValue(info, sharedTemplate->GetFunction()); 248 v8SetReturnValue(info, sharedTemplate->GetFunction());
249 return; 249 return;
250 } 250 }
251 251
252 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin g(info.GetIsolate(), "doNotCheckSecurityVoidMethod")); 252 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin g(info.GetIsolate(), "doNotCheckSecurityVoidMethod"));
253 if (!hiddenValue.IsEmpty()) { 253 if (!hiddenValue.IsEmpty()) {
254 v8SetReturnValue(info, hiddenValue); 254 v8SetReturnValue(info, hiddenValue);
255 return; 255 return;
256 } 256 }
257 257
258 v8SetReturnValue(info, privateTemplate->GetFunction()); 258 v8SetReturnValue(info, privateTemplate->GetFunction());
259 } 259 }
260 260
261 static void doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback(v8::Local <v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 261 static void doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback(v8::Local <v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
262 { 262 {
263 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 263 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
264 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodOriginSafe MethodGetter(info); 264 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodOriginSafe MethodGetter(info);
265 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 265 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
266 } 266 }
267 267
268 static void doNotCheckSecurityDoNotCheckSignatureVoidMethodMethod(const v8::Func tionCallbackInfo<v8::Value>& info) 268 static void doNotCheckSecurityDoNotCheckSignatureVoidMethodMethod(const v8::Func tionCallbackInfo<v8::Value>& info)
269 { 269 {
270 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(inf o.Holder()); 270 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(in fo.Holder());
271 imp->doNotCheckSecurityDoNotCheckSignatureVoidMethod(); 271 impl->doNotCheckSecurityDoNotCheckSignatureVoidMethod();
272 } 272 }
273 273
274 static void doNotCheckSecurityDoNotCheckSignatureVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 274 static void doNotCheckSecurityDoNotCheckSignatureVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
275 { 275 {
276 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 276 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
277 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSignatureV oidMethodMethod(info); 277 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSignatureV oidMethodMethod(info);
278 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 278 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
279 } 279 }
280 280
281 static void doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeMethodGette r(const v8::PropertyCallbackInfo<v8::Value>& info) 281 static void doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeMethodGette r(const v8::PropertyCallbackInfo<v8::Value>& info)
282 { 282 {
283 static int domTemplateKey; // This address is used for a key to look up the dom template. 283 static int domTemplateKey; // This address is used for a key to look up the dom template.
284 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); 284 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
285 v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(&domTem plateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSign atureVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0); 285 v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(&domTem plateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSign atureVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0);
286 286
287 v8::Handle<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceIn PrototypeChain(info.This(), info.GetIsolate()); 287 v8::Handle<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceIn PrototypeChain(info.This(), info.GetIsolate());
288 if (holder.IsEmpty()) { 288 if (holder.IsEmpty()) {
289 // This is only reachable via |object.__proto__.func|, in which case it 289 // This is only reachable via |object.__proto__.func|, in which case it
290 // has already passed the same origin security check 290 // has already passed the same origin security check
291 v8SetReturnValue(info, privateTemplate->GetFunction()); 291 v8SetReturnValue(info, privateTemplate->GetFunction());
292 return; 292 return;
293 } 293 }
294 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol der); 294 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(ho lder);
295 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame (), DoNotReportSecurityError)) { 295 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram e(), DoNotReportSecurityError)) {
296 static int sharedTemplateKey; // This address is used for a key to look up the dom template. 296 static int sharedTemplateKey; // This address is used for a key to look up the dom template.
297 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(&sha redTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotChe ckSignatureVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0); 297 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(&sha redTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotChe ckSignatureVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0);
298 v8SetReturnValue(info, sharedTemplate->GetFunction()); 298 v8SetReturnValue(info, sharedTemplate->GetFunction());
299 return; 299 return;
300 } 300 }
301 301
302 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin g(info.GetIsolate(), "doNotCheckSecurityDoNotCheckSignatureVoidMethod")); 302 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin g(info.GetIsolate(), "doNotCheckSecurityDoNotCheckSignatureVoidMethod"));
303 if (!hiddenValue.IsEmpty()) { 303 if (!hiddenValue.IsEmpty()) {
304 v8SetReturnValue(info, hiddenValue); 304 v8SetReturnValue(info, hiddenValue);
305 return; 305 return;
306 } 306 }
307 307
308 v8SetReturnValue(info, privateTemplate->GetFunction()); 308 v8SetReturnValue(info, privateTemplate->GetFunction());
309 } 309 }
310 310
311 static void doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeMethodGette rCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info ) 311 static void doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeMethodGette rCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info )
312 { 312 {
313 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 313 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
314 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSignatureV oidMethodOriginSafeMethodGetter(info); 314 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSignatureV oidMethodOriginSafeMethodGetter(info);
315 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 315 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
316 } 316 }
317 317
318 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethod(const v8::Functio nCallbackInfo<v8::Value>& info) 318 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethod(const v8::Functio nCallbackInfo<v8::Value>& info)
319 { 319 {
320 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(inf o.Holder()); 320 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(in fo.Holder());
321 imp->doNotCheckSecurityPerWorldBindingsVoidMethod(); 321 impl->doNotCheckSecurityPerWorldBindingsVoidMethod();
322 } 322 }
323 323
324 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback(const v8: :FunctionCallbackInfo<v8::Value>& info) 324 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback(const v8: :FunctionCallbackInfo<v8::Value>& info)
325 { 325 {
326 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 326 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
327 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid MethodMethod(info); 327 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid MethodMethod(info);
328 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 328 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
329 } 329 }
330 330
331 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetter(c onst v8::PropertyCallbackInfo<v8::Value>& info) 331 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetter(c onst v8::PropertyCallbackInfo<v8::Value>& info)
332 { 332 {
333 static int domTemplateKey; // This address is used for a key to look up the dom template. 333 static int domTemplateKey; // This address is used for a key to look up the dom template.
334 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); 334 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
335 v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(&domTem plateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindin gsVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate())), 0); 335 v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(&domTem plateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindin gsVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate())), 0);
336 336
337 v8::Handle<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceIn PrototypeChain(info.This(), info.GetIsolate()); 337 v8::Handle<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceIn PrototypeChain(info.This(), info.GetIsolate());
338 if (holder.IsEmpty()) { 338 if (holder.IsEmpty()) {
339 // This is only reachable via |object.__proto__.func|, in which case it 339 // This is only reachable via |object.__proto__.func|, in which case it
340 // has already passed the same origin security check 340 // has already passed the same origin security check
341 v8SetReturnValue(info, privateTemplate->GetFunction()); 341 v8SetReturnValue(info, privateTemplate->GetFunction());
342 return; 342 return;
343 } 343 }
344 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol der); 344 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(ho lder);
345 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame (), DoNotReportSecurityError)) { 345 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram e(), DoNotReportSecurityError)) {
346 static int sharedTemplateKey; // This address is used for a key to look up the dom template. 346 static int sharedTemplateKey; // This address is used for a key to look up the dom template.
347 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(&sha redTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorld BindingsVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsol ate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate())), 0); 347 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(&sha redTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorld BindingsVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsol ate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate())), 0);
348 v8SetReturnValue(info, sharedTemplate->GetFunction()); 348 v8SetReturnValue(info, sharedTemplate->GetFunction());
349 return; 349 return;
350 } 350 }
351 351
352 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin g(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod")); 352 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin g(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod"));
353 if (!hiddenValue.IsEmpty()) { 353 if (!hiddenValue.IsEmpty()) {
354 v8SetReturnValue(info, hiddenValue); 354 v8SetReturnValue(info, hiddenValue);
355 return; 355 return;
356 } 356 }
357 357
358 v8SetReturnValue(info, privateTemplate->GetFunction()); 358 v8SetReturnValue(info, privateTemplate->GetFunction());
359 } 359 }
360 360
361 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCa llback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 361 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCa llback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
362 { 362 {
363 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 363 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
364 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid MethodOriginSafeMethodGetter(info); 364 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid MethodOriginSafeMethodGetter(info);
365 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 365 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
366 } 366 }
367 367
368 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) 368 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
369 { 369 {
370 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(inf o.Holder()); 370 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(in fo.Holder());
371 imp->doNotCheckSecurityPerWorldBindingsVoidMethod(); 371 impl->doNotCheckSecurityPerWorldBindingsVoidMethod();
372 } 372 }
373 373
374 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWor ld(const v8::FunctionCallbackInfo<v8::Value>& info) 374 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWor ld(const v8::FunctionCallbackInfo<v8::Value>& info)
375 { 375 {
376 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 376 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
377 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid MethodMethodForMainWorld(info); 377 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid MethodMethodForMainWorld(info);
378 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 378 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
379 } 379 }
380 380
381 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterFo rMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) 381 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterFo rMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
382 { 382 {
383 static int domTemplateKey; // This address is used for a key to look up the dom template. 383 static int domTemplateKey; // This address is used for a key to look up the dom template.
384 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); 384 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
385 v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(&domTem plateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindin gsVoidMethodMethodCallbackForMainWorld, v8Undefined(), v8::Signature::New(info.G etIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate())), 0); 385 v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(&domTem plateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindin gsVoidMethodMethodCallbackForMainWorld, v8Undefined(), v8::Signature::New(info.G etIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate())), 0);
386 386
387 v8::Handle<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceIn PrototypeChain(info.This(), info.GetIsolate()); 387 v8::Handle<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceIn PrototypeChain(info.This(), info.GetIsolate());
388 if (holder.IsEmpty()) { 388 if (holder.IsEmpty()) {
389 // This is only reachable via |object.__proto__.func|, in which case it 389 // This is only reachable via |object.__proto__.func|, in which case it
390 // has already passed the same origin security check 390 // has already passed the same origin security check
391 v8SetReturnValue(info, privateTemplate->GetFunction()); 391 v8SetReturnValue(info, privateTemplate->GetFunction());
392 return; 392 return;
393 } 393 }
394 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol der); 394 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(ho lder);
395 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame (), DoNotReportSecurityError)) { 395 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram e(), DoNotReportSecurityError)) {
396 static int sharedTemplateKey; // This address is used for a key to look up the dom template. 396 static int sharedTemplateKey; // This address is used for a key to look up the dom template.
397 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(&sha redTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorld BindingsVoidMethodMethodCallbackForMainWorld, v8Undefined(), v8::Signature::New( info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate())) , 0); 397 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(&sha redTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorld BindingsVoidMethodMethodCallbackForMainWorld, v8Undefined(), v8::Signature::New( info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate())) , 0);
398 v8SetReturnValue(info, sharedTemplate->GetFunction()); 398 v8SetReturnValue(info, sharedTemplate->GetFunction());
399 return; 399 return;
400 } 400 }
401 401
402 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin g(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod")); 402 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin g(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod"));
403 if (!hiddenValue.IsEmpty()) { 403 if (!hiddenValue.IsEmpty()) {
404 v8SetReturnValue(info, hiddenValue); 404 v8SetReturnValue(info, hiddenValue);
405 return; 405 return;
406 } 406 }
407 407
408 v8SetReturnValue(info, privateTemplate->GetFunction()); 408 v8SetReturnValue(info, privateTemplate->GetFunction());
409 } 409 }
410 410
411 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCa llbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Val ue>& info) 411 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCa llbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Val ue>& info)
412 { 412 {
413 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 413 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
414 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid MethodOriginSafeMethodGetterForMainWorld(info); 414 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid MethodOriginSafeMethodGetterForMainWorld(info);
415 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 415 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
416 } 416 }
417 417
418 static void doNotCheckSecurityReadOnlyVoidMethodMethod(const v8::FunctionCallbac kInfo<v8::Value>& info) 418 static void doNotCheckSecurityReadOnlyVoidMethodMethod(const v8::FunctionCallbac kInfo<v8::Value>& info)
419 { 419 {
420 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(inf o.Holder()); 420 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(in fo.Holder());
421 imp->doNotCheckSecurityReadOnlyVoidMethod(); 421 impl->doNotCheckSecurityReadOnlyVoidMethod();
422 } 422 }
423 423
424 static void doNotCheckSecurityReadOnlyVoidMethodMethodCallback(const v8::Functio nCallbackInfo<v8::Value>& info) 424 static void doNotCheckSecurityReadOnlyVoidMethodMethodCallback(const v8::Functio nCallbackInfo<v8::Value>& info)
425 { 425 {
426 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 426 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
427 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodMe thod(info); 427 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodMe thod(info);
428 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 428 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
429 } 429 }
430 430
431 static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetter(const v8: :PropertyCallbackInfo<v8::Value>& info) 431 static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetter(const v8: :PropertyCallbackInfo<v8::Value>& info)
432 { 432 {
433 static int domTemplateKey; // This address is used for a key to look up the dom template. 433 static int domTemplateKey; // This address is used for a key to look up the dom template.
434 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); 434 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
435 v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(&domTem plateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMe thodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestI nterfaceCheckSecurity::domTemplate(info.GetIsolate())), 0); 435 v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(&domTem plateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMe thodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestI nterfaceCheckSecurity::domTemplate(info.GetIsolate())), 0);
436 436
437 v8::Handle<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceIn PrototypeChain(info.This(), info.GetIsolate()); 437 v8::Handle<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceIn PrototypeChain(info.This(), info.GetIsolate());
438 if (holder.IsEmpty()) { 438 if (holder.IsEmpty()) {
439 // This is only reachable via |object.__proto__.func|, in which case it 439 // This is only reachable via |object.__proto__.func|, in which case it
440 // has already passed the same origin security check 440 // has already passed the same origin security check
441 v8SetReturnValue(info, privateTemplate->GetFunction()); 441 v8SetReturnValue(info, privateTemplate->GetFunction());
442 return; 442 return;
443 } 443 }
444 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol der); 444 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(ho lder);
445 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame (), DoNotReportSecurityError)) { 445 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram e(), DoNotReportSecurityError)) {
446 static int sharedTemplateKey; // This address is used for a key to look up the dom template. 446 static int sharedTemplateKey; // This address is used for a key to look up the dom template.
447 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(&sha redTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnly VoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V 8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate())), 0); 447 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(&sha redTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnly VoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V 8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate())), 0);
448 v8SetReturnValue(info, sharedTemplate->GetFunction()); 448 v8SetReturnValue(info, sharedTemplate->GetFunction());
449 return; 449 return;
450 } 450 }
451 451
452 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin g(info.GetIsolate(), "doNotCheckSecurityReadOnlyVoidMethod")); 452 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin g(info.GetIsolate(), "doNotCheckSecurityReadOnlyVoidMethod"));
453 if (!hiddenValue.IsEmpty()) { 453 if (!hiddenValue.IsEmpty()) {
454 v8SetReturnValue(info, hiddenValue); 454 v8SetReturnValue(info, hiddenValue);
455 return; 455 return;
456 } 456 }
457 457
458 v8SetReturnValue(info, privateTemplate->GetFunction()); 458 v8SetReturnValue(info, privateTemplate->GetFunction());
459 } 459 }
460 460
461 static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetterCallback(v 8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 461 static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetterCallback(v 8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
462 { 462 {
463 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 463 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
464 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodOr iginSafeMethodGetter(info); 464 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodOr iginSafeMethodGetter(info);
465 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 465 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
466 } 466 }
467 467
468 static void doNotCheckSecurityUnforgeableVoidMethodMethod(const v8::FunctionCall backInfo<v8::Value>& info) 468 static void doNotCheckSecurityUnforgeableVoidMethodMethod(const v8::FunctionCall backInfo<v8::Value>& info)
469 { 469 {
470 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(inf o.Holder()); 470 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(in fo.Holder());
471 imp->doNotCheckSecurityUnforgeableVoidMethod(); 471 impl->doNotCheckSecurityUnforgeableVoidMethod();
472 } 472 }
473 473
474 static void doNotCheckSecurityUnforgeableVoidMethodMethodCallback(const v8::Func tionCallbackInfo<v8::Value>& info) 474 static void doNotCheckSecurityUnforgeableVoidMethodMethodCallback(const v8::Func tionCallbackInfo<v8::Value>& info)
475 { 475 {
476 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 476 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
477 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMetho dMethod(info); 477 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMetho dMethod(info);
478 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 478 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
479 } 479 }
480 480
481 static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info) 481 static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
482 { 482 {
483 static int domTemplateKey; // This address is used for a key to look up the dom template. 483 static int domTemplateKey; // This address is used for a key to look up the dom template.
484 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); 484 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
485 v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(&domTem plateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoi dMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8Te stInterfaceCheckSecurity::domTemplate(info.GetIsolate())), 0); 485 v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(&domTem plateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoi dMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8Te stInterfaceCheckSecurity::domTemplate(info.GetIsolate())), 0);
486 486
487 v8::Handle<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceIn PrototypeChain(info.This(), info.GetIsolate()); 487 v8::Handle<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceIn PrototypeChain(info.This(), info.GetIsolate());
488 if (holder.IsEmpty()) { 488 if (holder.IsEmpty()) {
489 // This is only reachable via |object.__proto__.func|, in which case it 489 // This is only reachable via |object.__proto__.func|, in which case it
490 // has already passed the same origin security check 490 // has already passed the same origin security check
491 v8SetReturnValue(info, privateTemplate->GetFunction()); 491 v8SetReturnValue(info, privateTemplate->GetFunction());
492 return; 492 return;
493 } 493 }
494 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol der); 494 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(ho lder);
495 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame (), DoNotReportSecurityError)) { 495 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram e(), DoNotReportSecurityError)) {
496 static int sharedTemplateKey; // This address is used for a key to look up the dom template. 496 static int sharedTemplateKey; // This address is used for a key to look up the dom template.
497 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(&sha redTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgea bleVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate() , V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate())), 0); 497 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(&sha redTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgea bleVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate() , V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate())), 0);
498 v8SetReturnValue(info, sharedTemplate->GetFunction()); 498 v8SetReturnValue(info, sharedTemplate->GetFunction());
499 return; 499 return;
500 } 500 }
501 501
502 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin g(info.GetIsolate(), "doNotCheckSecurityUnforgeableVoidMethod")); 502 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin g(info.GetIsolate(), "doNotCheckSecurityUnforgeableVoidMethod"));
503 if (!hiddenValue.IsEmpty()) { 503 if (!hiddenValue.IsEmpty()) {
504 v8SetReturnValue(info, hiddenValue); 504 v8SetReturnValue(info, hiddenValue);
505 return; 505 return;
506 } 506 }
507 507
508 v8SetReturnValue(info, privateTemplate->GetFunction()); 508 v8SetReturnValue(info, privateTemplate->GetFunction());
509 } 509 }
510 510
511 static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallbac k(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 511 static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallbac k(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
512 { 512 {
513 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 513 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
514 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMetho dOriginSafeMethodGetter(info); 514 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMetho dOriginSafeMethodGetter(info);
515 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 515 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
516 } 516 }
517 517
518 static void TestInterfaceCheckSecurityOriginSafeMethodSetter(v8::Local<v8::Strin g> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& inf o) 518 static void TestInterfaceCheckSecurityOriginSafeMethodSetter(v8::Local<v8::Strin g> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& inf o)
519 { 519 {
520 v8::Handle<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceIn PrototypeChain(info.This(), info.GetIsolate()); 520 v8::Handle<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceIn PrototypeChain(info.This(), info.GetIsolate());
521 if (holder.IsEmpty()) 521 if (holder.IsEmpty())
522 return; 522 return;
523 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol der); 523 TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toNative(ho lder);
524 v8::String::Utf8Value attributeName(name); 524 v8::String::Utf8Value attributeName(name);
525 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate()); 525 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate());
526 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame (), exceptionState)) { 526 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram e(), exceptionState)) {
527 exceptionState.throwIfNeeded(); 527 exceptionState.throwIfNeeded();
528 return; 528 return;
529 } 529 }
530 530
531 V8HiddenValue::setHiddenValue(info.GetIsolate(), info.This(), name, jsValue) ; 531 V8HiddenValue::setHiddenValue(info.GetIsolate(), info.This(), name, jsValue) ;
532 } 532 }
533 533
534 static void TestInterfaceCheckSecurityOriginSafeMethodSetterCallback(v8::Local<v 8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<vo id>& info) 534 static void TestInterfaceCheckSecurityOriginSafeMethodSetterCallback(v8::Local<v 8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<vo id>& info)
535 { 535 {
536 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 536 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 fromInternalPointer(object)->deref(); 633 fromInternalPointer(object)->deref();
634 } 634 }
635 635
636 template<> 636 template<>
637 v8::Handle<v8::Value> toV8NoInline(TestInterfaceCheckSecurity* impl, v8::Handle< v8::Object> creationContext, v8::Isolate* isolate) 637 v8::Handle<v8::Value> toV8NoInline(TestInterfaceCheckSecurity* impl, v8::Handle< v8::Object> creationContext, v8::Isolate* isolate)
638 { 638 {
639 return toV8(impl, creationContext, isolate); 639 return toV8(impl, creationContext, isolate);
640 } 640 }
641 641
642 } // namespace WebCore 642 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterface.cpp ('k') | Source/bindings/tests/results/V8TestInterfaceEventConstructor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698