OLD | NEW |
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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 WrapperWorldType currentWorldType = worldType(info.GetIsolate()); | |
235 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); | 234 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); |
236 v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(current
WorldType, &domTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecu
rityVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(
), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType
)), 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); |
237 | 236 |
238 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()); |
239 if (holder.IsEmpty()) { | 238 if (holder.IsEmpty()) { |
240 // 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 |
241 // has already passed the same origin security check | 240 // has already passed the same origin security check |
242 v8SetReturnValue(info, privateTemplate->GetFunction()); | 241 v8SetReturnValue(info, privateTemplate->GetFunction()); |
243 return; | 242 return; |
244 } | 243 } |
245 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); | 244 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); |
246 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame
(), DoNotReportSecurityError)) { | 245 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame
(), DoNotReportSecurityError)) { |
247 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. |
248 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(curr
entWorldType, &sharedTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotChe
ckSecurityVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIs
olate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWor
ldType)), 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); |
249 v8SetReturnValue(info, sharedTemplate->GetFunction()); | 248 v8SetReturnValue(info, sharedTemplate->GetFunction()); |
250 return; | 249 return; |
251 } | 250 } |
252 | 251 |
253 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")); |
254 if (!hiddenValue.IsEmpty()) { | 253 if (!hiddenValue.IsEmpty()) { |
255 v8SetReturnValue(info, hiddenValue); | 254 v8SetReturnValue(info, hiddenValue); |
256 return; | 255 return; |
257 } | 256 } |
258 | 257 |
(...skipping 16 matching lines...) Expand all Loading... |
275 static void doNotCheckSecurityDoNotCheckSignatureVoidMethodMethodCallback(const
v8::FunctionCallbackInfo<v8::Value>& info) | 274 static void doNotCheckSecurityDoNotCheckSignatureVoidMethodMethodCallback(const
v8::FunctionCallbackInfo<v8::Value>& info) |
276 { | 275 { |
277 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 276 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
278 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSignatureV
oidMethodMethod(info); | 277 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSignatureV
oidMethodMethod(info); |
279 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 278 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
280 } | 279 } |
281 | 280 |
282 static void doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeMethodGette
r(const v8::PropertyCallbackInfo<v8::Value>& info) | 281 static void doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeMethodGette
r(const v8::PropertyCallbackInfo<v8::Value>& info) |
283 { | 282 { |
284 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. |
285 WrapperWorldType currentWorldType = worldType(info.GetIsolate()); | |
286 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); | 284 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); |
287 v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(current
WorldType, &domTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecu
rityDoNotCheckSignatureVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Si
gnature>(), 0); | 285 v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(&domTem
plateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSign
atureVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0); |
288 | 286 |
289 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()); |
290 if (holder.IsEmpty()) { | 288 if (holder.IsEmpty()) { |
291 // 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 |
292 // has already passed the same origin security check | 290 // has already passed the same origin security check |
293 v8SetReturnValue(info, privateTemplate->GetFunction()); | 291 v8SetReturnValue(info, privateTemplate->GetFunction()); |
294 return; | 292 return; |
295 } | 293 } |
296 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); | 294 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); |
297 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame
(), DoNotReportSecurityError)) { | 295 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame
(), DoNotReportSecurityError)) { |
298 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. |
299 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(curr
entWorldType, &sharedTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotChe
ckSecurityDoNotCheckSignatureVoidMethodMethodCallback, 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); |
300 v8SetReturnValue(info, sharedTemplate->GetFunction()); | 298 v8SetReturnValue(info, sharedTemplate->GetFunction()); |
301 return; | 299 return; |
302 } | 300 } |
303 | 301 |
304 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")); |
305 if (!hiddenValue.IsEmpty()) { | 303 if (!hiddenValue.IsEmpty()) { |
306 v8SetReturnValue(info, hiddenValue); | 304 v8SetReturnValue(info, hiddenValue); |
307 return; | 305 return; |
308 } | 306 } |
309 | 307 |
(...skipping 16 matching lines...) Expand all Loading... |
326 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback(const v8:
:FunctionCallbackInfo<v8::Value>& info) | 324 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback(const v8:
:FunctionCallbackInfo<v8::Value>& info) |
327 { | 325 { |
328 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 326 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
329 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid
MethodMethod(info); | 327 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid
MethodMethod(info); |
330 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 328 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
331 } | 329 } |
332 | 330 |
333 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetter(c
onst v8::PropertyCallbackInfo<v8::Value>& info) | 331 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetter(c
onst v8::PropertyCallbackInfo<v8::Value>& info) |
334 { | 332 { |
335 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. |
336 WrapperWorldType currentWorldType = worldType(info.GetIsolate()); | |
337 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); | 334 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); |
338 v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(current
WorldType, &domTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecu
rityPerWorldBindingsVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(
info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(),
currentWorldType)), 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); |
339 | 336 |
340 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()); |
341 if (holder.IsEmpty()) { | 338 if (holder.IsEmpty()) { |
342 // 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 |
343 // has already passed the same origin security check | 340 // has already passed the same origin security check |
344 v8SetReturnValue(info, privateTemplate->GetFunction()); | 341 v8SetReturnValue(info, privateTemplate->GetFunction()); |
345 return; | 342 return; |
346 } | 343 } |
347 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); | 344 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); |
348 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame
(), DoNotReportSecurityError)) { | 345 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame
(), DoNotReportSecurityError)) { |
349 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. |
350 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(curr
entWorldType, &sharedTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotChe
ckSecurityPerWorldBindingsVoidMethodMethodCallback, v8Undefined(), v8::Signature
::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsola
te(), currentWorldType)), 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); |
351 v8SetReturnValue(info, sharedTemplate->GetFunction()); | 348 v8SetReturnValue(info, sharedTemplate->GetFunction()); |
352 return; | 349 return; |
353 } | 350 } |
354 | 351 |
355 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")); |
356 if (!hiddenValue.IsEmpty()) { | 353 if (!hiddenValue.IsEmpty()) { |
357 v8SetReturnValue(info, hiddenValue); | 354 v8SetReturnValue(info, hiddenValue); |
358 return; | 355 return; |
359 } | 356 } |
360 | 357 |
(...skipping 16 matching lines...) Expand all Loading... |
377 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWor
ld(const v8::FunctionCallbackInfo<v8::Value>& info) | 374 static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWor
ld(const v8::FunctionCallbackInfo<v8::Value>& info) |
378 { | 375 { |
379 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 376 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
380 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid
MethodMethodForMainWorld(info); | 377 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoid
MethodMethodForMainWorld(info); |
381 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 378 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
382 } | 379 } |
383 | 380 |
384 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterFo
rMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) | 381 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterFo
rMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) |
385 { | 382 { |
386 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. |
387 WrapperWorldType currentWorldType = worldType(info.GetIsolate()); | |
388 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); | 384 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); |
389 v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(current
WorldType, &domTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecu
rityPerWorldBindingsVoidMethodMethodCallbackForMainWorld, v8Undefined(), v8::Sig
nature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.Ge
tIsolate(), currentWorldType)), 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); |
390 | 386 |
391 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()); |
392 if (holder.IsEmpty()) { | 388 if (holder.IsEmpty()) { |
393 // 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 |
394 // has already passed the same origin security check | 390 // has already passed the same origin security check |
395 v8SetReturnValue(info, privateTemplate->GetFunction()); | 391 v8SetReturnValue(info, privateTemplate->GetFunction()); |
396 return; | 392 return; |
397 } | 393 } |
398 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); | 394 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); |
399 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame
(), DoNotReportSecurityError)) { | 395 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame
(), DoNotReportSecurityError)) { |
400 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. |
401 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(curr
entWorldType, &sharedTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotChe
ckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld, v8Undefined(), v
8::Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(i
nfo.GetIsolate(), currentWorldType)), 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); |
402 v8SetReturnValue(info, sharedTemplate->GetFunction()); | 398 v8SetReturnValue(info, sharedTemplate->GetFunction()); |
403 return; | 399 return; |
404 } | 400 } |
405 | 401 |
406 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")); |
407 if (!hiddenValue.IsEmpty()) { | 403 if (!hiddenValue.IsEmpty()) { |
408 v8SetReturnValue(info, hiddenValue); | 404 v8SetReturnValue(info, hiddenValue); |
409 return; | 405 return; |
410 } | 406 } |
411 | 407 |
(...skipping 16 matching lines...) Expand all Loading... |
428 static void doNotCheckSecurityReadOnlyVoidMethodMethodCallback(const v8::Functio
nCallbackInfo<v8::Value>& info) | 424 static void doNotCheckSecurityReadOnlyVoidMethodMethodCallback(const v8::Functio
nCallbackInfo<v8::Value>& info) |
429 { | 425 { |
430 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 426 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
431 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodMe
thod(info); | 427 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodMe
thod(info); |
432 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 428 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
433 } | 429 } |
434 | 430 |
435 static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetter(const v8:
:PropertyCallbackInfo<v8::Value>& info) | 431 static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetter(const v8:
:PropertyCallbackInfo<v8::Value>& info) |
436 { | 432 { |
437 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. |
438 WrapperWorldType currentWorldType = worldType(info.GetIsolate()); | |
439 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); | 434 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); |
440 v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(current
WorldType, &domTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecu
rityReadOnlyVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.Get
Isolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentW
orldType)), 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); |
441 | 436 |
442 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()); |
443 if (holder.IsEmpty()) { | 438 if (holder.IsEmpty()) { |
444 // 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 |
445 // has already passed the same origin security check | 440 // has already passed the same origin security check |
446 v8SetReturnValue(info, privateTemplate->GetFunction()); | 441 v8SetReturnValue(info, privateTemplate->GetFunction()); |
447 return; | 442 return; |
448 } | 443 } |
449 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); | 444 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); |
450 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame
(), DoNotReportSecurityError)) { | 445 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame
(), DoNotReportSecurityError)) { |
451 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. |
452 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(curr
entWorldType, &sharedTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotChe
ckSecurityReadOnlyVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(in
fo.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), cu
rrentWorldType)), 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); |
453 v8SetReturnValue(info, sharedTemplate->GetFunction()); | 448 v8SetReturnValue(info, sharedTemplate->GetFunction()); |
454 return; | 449 return; |
455 } | 450 } |
456 | 451 |
457 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")); |
458 if (!hiddenValue.IsEmpty()) { | 453 if (!hiddenValue.IsEmpty()) { |
459 v8SetReturnValue(info, hiddenValue); | 454 v8SetReturnValue(info, hiddenValue); |
460 return; | 455 return; |
461 } | 456 } |
462 | 457 |
(...skipping 16 matching lines...) Expand all Loading... |
479 static void doNotCheckSecurityUnforgeableVoidMethodMethodCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) | 474 static void doNotCheckSecurityUnforgeableVoidMethodMethodCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) |
480 { | 475 { |
481 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 476 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
482 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMetho
dMethod(info); | 477 TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMetho
dMethod(info); |
483 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 478 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
484 } | 479 } |
485 | 480 |
486 static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetter(const
v8::PropertyCallbackInfo<v8::Value>& info) | 481 static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetter(const
v8::PropertyCallbackInfo<v8::Value>& info) |
487 { | 482 { |
488 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. |
489 WrapperWorldType currentWorldType = worldType(info.GetIsolate()); | |
490 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); | 484 V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); |
491 v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(current
WorldType, &domTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecu
rityUnforgeableVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.
GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), curre
ntWorldType)), 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); |
492 | 486 |
493 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()); |
494 if (holder.IsEmpty()) { | 488 if (holder.IsEmpty()) { |
495 // 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 |
496 // has already passed the same origin security check | 490 // has already passed the same origin security check |
497 v8SetReturnValue(info, privateTemplate->GetFunction()); | 491 v8SetReturnValue(info, privateTemplate->GetFunction()); |
498 return; | 492 return; |
499 } | 493 } |
500 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); | 494 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); |
501 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame
(), DoNotReportSecurityError)) { | 495 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), imp->frame
(), DoNotReportSecurityError)) { |
502 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. |
503 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(curr
entWorldType, &sharedTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotChe
ckSecurityUnforgeableVoidMethodMethodCallback, v8Undefined(), v8::Signature::New
(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(),
currentWorldType)), 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); |
504 v8SetReturnValue(info, sharedTemplate->GetFunction()); | 498 v8SetReturnValue(info, sharedTemplate->GetFunction()); |
505 return; | 499 return; |
506 } | 500 } |
507 | 501 |
508 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")); |
509 if (!hiddenValue.IsEmpty()) { | 503 if (!hiddenValue.IsEmpty()) { |
510 v8SetReturnValue(info, hiddenValue); | 504 v8SetReturnValue(info, hiddenValue); |
511 return; | 505 return; |
512 } | 506 } |
513 | 507 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 {"doNotCheckSecurityLongAttribute", TestInterfaceCheckSecurityV8Internal::do
NotCheckSecurityLongAttributeAttributeGetterCallback, TestInterfaceCheckSecurity
V8Internal::doNotCheckSecurityLongAttributeAttributeSetterCallback, 0, 0, 0, sta
tic_cast<v8::AccessControl>(v8::ALL_CAN_READ | v8::ALL_CAN_WRITE), static_cast<v
8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 545 {"doNotCheckSecurityLongAttribute", TestInterfaceCheckSecurityV8Internal::do
NotCheckSecurityLongAttributeAttributeGetterCallback, TestInterfaceCheckSecurity
V8Internal::doNotCheckSecurityLongAttributeAttributeSetterCallback, 0, 0, 0, sta
tic_cast<v8::AccessControl>(v8::ALL_CAN_READ | v8::ALL_CAN_WRITE), static_cast<v
8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
552 {"doNotCheckSecurityReadonlyLongAttribute", TestInterfaceCheckSecurityV8Inte
rnal::doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0
, static_cast<v8::AccessControl>(v8::ALL_CAN_READ), static_cast<v8::PropertyAttr
ibute>(v8::None), 0 /* on instance */}, | 546 {"doNotCheckSecurityReadonlyLongAttribute", TestInterfaceCheckSecurityV8Inte
rnal::doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0
, static_cast<v8::AccessControl>(v8::ALL_CAN_READ), static_cast<v8::PropertyAttr
ibute>(v8::None), 0 /* on instance */}, |
553 {"doNotCheckSecurityOnSetterLongAttribute", TestInterfaceCheckSecurityV8Inte
rnal::doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback, TestInterf
aceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeSett
erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_CAN_WRITE), static_c
ast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 547 {"doNotCheckSecurityOnSetterLongAttribute", TestInterfaceCheckSecurityV8Inte
rnal::doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback, TestInterf
aceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeSett
erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_CAN_WRITE), static_c
ast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
554 {"doNotCheckSecurityReplaceableReadonlyLongAttribute", TestInterfaceCheckSec
urityV8Internal::doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGett
erCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityRepl
aceableAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_
CAN_READ | v8::ALL_CAN_WRITE), static_cast<v8::PropertyAttribute>(v8::None), 0 /
* on instance */}, | 548 {"doNotCheckSecurityReplaceableReadonlyLongAttribute", TestInterfaceCheckSec
urityV8Internal::doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGett
erCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityRepl
aceableAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_
CAN_READ | v8::ALL_CAN_WRITE), static_cast<v8::PropertyAttribute>(v8::None), 0 /
* on instance */}, |
555 }; | 549 }; |
556 | 550 |
557 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceCheckSecurit
yMethods[] = { | 551 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceCheckSecurit
yMethods[] = { |
558 {"voidMethod", TestInterfaceCheckSecurityV8Internal::voidMethodMethodCallbac
k, 0, 0}, | 552 {"voidMethod", TestInterfaceCheckSecurityV8Internal::voidMethodMethodCallbac
k, 0, 0}, |
559 }; | 553 }; |
560 | 554 |
561 static void configureV8TestInterfaceCheckSecurityTemplate(v8::Handle<v8::Functio
nTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorld
Type) | 555 static void configureV8TestInterfaceCheckSecurityTemplate(v8::Handle<v8::Functio
nTemplate> functionTemplate, v8::Isolate* isolate) |
562 { | 556 { |
563 functionTemplate->ReadOnlyPrototype(); | 557 functionTemplate->ReadOnlyPrototype(); |
564 | 558 |
565 v8::Local<v8::Signature> defaultSignature; | 559 v8::Local<v8::Signature> defaultSignature; |
566 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceCheckSecurity", v8::Local<v8::FunctionTemplate>(), V8TestInte
rfaceCheckSecurity::internalFieldCount, | 560 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceCheckSecurity", v8::Local<v8::FunctionTemplate>(), V8TestInte
rfaceCheckSecurity::internalFieldCount, |
567 V8TestInterfaceCheckSecurityAttributes, WTF_ARRAY_LENGTH(V8TestInterface
CheckSecurityAttributes), | 561 V8TestInterfaceCheckSecurityAttributes, WTF_ARRAY_LENGTH(V8TestInterface
CheckSecurityAttributes), |
568 0, 0, | 562 0, 0, |
569 V8TestInterfaceCheckSecurityMethods, WTF_ARRAY_LENGTH(V8TestInterfaceChe
ckSecurityMethods), | 563 V8TestInterfaceCheckSecurityMethods, WTF_ARRAY_LENGTH(V8TestInterfaceChe
ckSecurityMethods), |
570 isolate, currentWorldType); | 564 isolate); |
571 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); | 565 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
572 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); | 566 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
573 instanceTemplate->SetAccessCheckCallbacks(TestInterfaceCheckSecurityV8Intern
al::namedSecurityCheck, TestInterfaceCheckSecurityV8Internal::indexedSecurityChe
ck, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8TestInterfaceChec
kSecurity::wrapperTypeInfo))); | 567 instanceTemplate->SetAccessCheckCallbacks(TestInterfaceCheckSecurityV8Intern
al::namedSecurityCheck, TestInterfaceCheckSecurityV8Internal::indexedSecurityChe
ck, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8TestInterfaceChec
kSecurity::wrapperTypeInfo))); |
574 prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityVo
idMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodOr
iginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfac
eCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, s
tatic_cast<v8::PropertyAttribute>(v8::DontDelete)); | 568 prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityVo
idMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodOr
iginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfac
eCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, s
tatic_cast<v8::PropertyAttribute>(v8::DontDelete)); |
575 prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityDo
NotCheckSignatureVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckS
ecurityDoNotCheckSignatureVoidMethodOriginSafeMethodGetterCallback, TestInterfac
eCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallba
ck, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::Dont
Delete)); | 569 prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityDo
NotCheckSignatureVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckS
ecurityDoNotCheckSignatureVoidMethodOriginSafeMethodGetterCallback, TestInterfac
eCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallba
ck, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::Dont
Delete)); |
576 if (currentWorldType == MainWorld) { | 570 if (DOMWrapperWorld::current(isolate)->isMainWorld()) { |
577 prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecuri
tyPerWorldBindingsVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheck
SecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallbackForMainWorld, Te
stInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSe
tterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute
>(v8::DontDelete)); | 571 prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecuri
tyPerWorldBindingsVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheck
SecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallbackForMainWorld, Te
stInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSe
tterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute
>(v8::DontDelete)); |
578 } else { | 572 } else { |
579 prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecuri
tyPerWorldBindingsVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheck
SecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallback, TestInterfaceC
heckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback
, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDe
lete)); | 573 prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecuri
tyPerWorldBindingsVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheck
SecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallback, TestInterfaceC
heckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback
, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDe
lete)); |
580 } | 574 } |
581 prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityRe
adOnlyVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityRead
OnlyVoidMethodOriginSafeMethodGetterCallback, 0, v8Undefined(), v8::ALL_CAN_READ
, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly)); | 575 prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityRe
adOnlyVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityRead
OnlyVoidMethodOriginSafeMethodGetterCallback, 0, v8Undefined(), v8::ALL_CAN_READ
, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly)); |
582 instanceTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityUnf
orgeableVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUn
forgeableVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8I
nternal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined()
, v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete)); | 576 instanceTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityUnf
orgeableVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUn
forgeableVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8I
nternal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined()
, v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete)); |
583 | 577 |
584 // Custom toString template | 578 // Custom toString template |
585 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); | 579 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); |
586 } | 580 } |
587 | 581 |
588 v8::Handle<v8::FunctionTemplate> V8TestInterfaceCheckSecurity::domTemplate(v8::I
solate* isolate, WrapperWorldType currentWorldType) | 582 v8::Handle<v8::FunctionTemplate> V8TestInterfaceCheckSecurity::domTemplate(v8::I
solate* isolate) |
589 { | 583 { |
590 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 584 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
591 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); | 585 V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&w
rapperTypeInfo); |
592 if (result != data->templateMap(currentWorldType).end()) | 586 if (result != data->templateMap().end()) |
593 return result->value.newLocal(isolate); | 587 return result->value.newLocal(isolate); |
594 | 588 |
595 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 589 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
596 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); | 590 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); |
597 configureV8TestInterfaceCheckSecurityTemplate(templ, isolate, currentWorldTy
pe); | 591 configureV8TestInterfaceCheckSecurityTemplate(templ, isolate); |
598 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); | 592 data->templateMap().add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTempl
ate>(isolate, templ)); |
599 return templ; | 593 return templ; |
600 } | 594 } |
601 | 595 |
602 bool V8TestInterfaceCheckSecurity::hasInstance(v8::Handle<v8::Value> jsValue, v8
::Isolate* isolate) | 596 bool V8TestInterfaceCheckSecurity::hasInstance(v8::Handle<v8::Value> jsValue, v8
::Isolate* isolate) |
603 { | 597 { |
604 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e); | 598 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e); |
605 } | 599 } |
606 | 600 |
607 v8::Handle<v8::Object> V8TestInterfaceCheckSecurity::findInstanceInPrototypeChai
n(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate) | 601 v8::Handle<v8::Object> V8TestInterfaceCheckSecurity::findInstanceInPrototypeChai
n(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate) |
608 { | 602 { |
(...skipping 30 matching lines...) Expand all Loading... |
639 fromInternalPointer(object)->deref(); | 633 fromInternalPointer(object)->deref(); |
640 } | 634 } |
641 | 635 |
642 template<> | 636 template<> |
643 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) |
644 { | 638 { |
645 return toV8(impl, creationContext, isolate); | 639 return toV8(impl, creationContext, isolate); |
646 } | 640 } |
647 | 641 |
648 } // namespace WebCore | 642 } // namespace WebCore |
OLD | NEW |