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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 return; | 208 return; |
209 } | 209 } |
210 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); | 210 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); |
211 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { | 211 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { |
212 static int sharedTemplateUniqueKey; | 212 static int sharedTemplateUniqueKey; |
213 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal
::doNotCheckSecurityVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(
info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8
TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0); | 213 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal
::doNotCheckSecurityVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(
info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8
TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0); |
214 v8SetReturnValue(info, sharedTemplate->GetFunction()); | 214 v8SetReturnValue(info, sharedTemplate->GetFunction()); |
215 return; | 215 return; |
216 } | 216 } |
217 | 217 |
218 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::N
ewFromUtf8(info.GetIsolate(), "doNotCheckSecurityVoidMethod", v8::String::kInter
nalizedString)); | 218 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin
g(info.GetIsolate(), "doNotCheckSecurityVoidMethod")); |
219 if (!hiddenValue.IsEmpty()) { | 219 if (!hiddenValue.IsEmpty()) { |
220 v8SetReturnValue(info, hiddenValue); | 220 v8SetReturnValue(info, hiddenValue); |
221 return; | 221 return; |
222 } | 222 } |
223 | 223 |
224 v8SetReturnValue(info, privateTemplate->GetFunction()); | 224 v8SetReturnValue(info, privateTemplate->GetFunction()); |
225 } | 225 } |
226 | 226 |
227 static void doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback(v8::Local
<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 227 static void doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback(v8::Local
<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
228 { | 228 { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 return; | 260 return; |
261 } | 261 } |
262 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); | 262 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); |
263 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { | 263 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { |
264 static int sharedTemplateUniqueKey; | 264 static int sharedTemplateUniqueKey; |
265 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal
::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback, v8Undefined(), v8:
:Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->ra
wDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)),
0); | 265 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal
::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback, v8Undefined(), v8:
:Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->ra
wDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)),
0); |
266 v8SetReturnValue(info, sharedTemplate->GetFunction()); | 266 v8SetReturnValue(info, sharedTemplate->GetFunction()); |
267 return; | 267 return; |
268 } | 268 } |
269 | 269 |
270 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::N
ewFromUtf8(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod", v8
::String::kInternalizedString)); | 270 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin
g(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod")); |
271 if (!hiddenValue.IsEmpty()) { | 271 if (!hiddenValue.IsEmpty()) { |
272 v8SetReturnValue(info, hiddenValue); | 272 v8SetReturnValue(info, hiddenValue); |
273 return; | 273 return; |
274 } | 274 } |
275 | 275 |
276 v8SetReturnValue(info, privateTemplate->GetFunction()); | 276 v8SetReturnValue(info, privateTemplate->GetFunction()); |
277 } | 277 } |
278 | 278 |
279 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCa
llback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 279 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCa
llback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
280 { | 280 { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 return; | 312 return; |
313 } | 313 } |
314 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); | 314 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); |
315 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { | 315 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { |
316 static int sharedTemplateUniqueKey; | 316 static int sharedTemplateUniqueKey; |
317 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal
::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld, v8Unde
fined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIs
olate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, current
WorldType)), 0); | 317 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal
::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld, v8Unde
fined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIs
olate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, current
WorldType)), 0); |
318 v8SetReturnValue(info, sharedTemplate->GetFunction()); | 318 v8SetReturnValue(info, sharedTemplate->GetFunction()); |
319 return; | 319 return; |
320 } | 320 } |
321 | 321 |
322 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::N
ewFromUtf8(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod", v8
::String::kInternalizedString)); | 322 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin
g(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod")); |
323 if (!hiddenValue.IsEmpty()) { | 323 if (!hiddenValue.IsEmpty()) { |
324 v8SetReturnValue(info, hiddenValue); | 324 v8SetReturnValue(info, hiddenValue); |
325 return; | 325 return; |
326 } | 326 } |
327 | 327 |
328 v8SetReturnValue(info, privateTemplate->GetFunction()); | 328 v8SetReturnValue(info, privateTemplate->GetFunction()); |
329 } | 329 } |
330 | 330 |
331 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCa
llbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Val
ue>& info) | 331 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCa
llbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Val
ue>& info) |
332 { | 332 { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 return; | 364 return; |
365 } | 365 } |
366 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); | 366 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); |
367 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { | 367 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { |
368 static int sharedTemplateUniqueKey; | 368 static int sharedTemplateUniqueKey; |
369 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal
::doNotCheckSecurityReadOnlyVoidMethodMethodCallback, v8Undefined(), v8::Signatu
re::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemp
late(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0); | 369 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal
::doNotCheckSecurityReadOnlyVoidMethodMethodCallback, v8Undefined(), v8::Signatu
re::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemp
late(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0); |
370 v8SetReturnValue(info, sharedTemplate->GetFunction()); | 370 v8SetReturnValue(info, sharedTemplate->GetFunction()); |
371 return; | 371 return; |
372 } | 372 } |
373 | 373 |
374 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::N
ewFromUtf8(info.GetIsolate(), "doNotCheckSecurityReadOnlyVoidMethod", v8::String
::kInternalizedString)); | 374 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin
g(info.GetIsolate(), "doNotCheckSecurityReadOnlyVoidMethod")); |
375 if (!hiddenValue.IsEmpty()) { | 375 if (!hiddenValue.IsEmpty()) { |
376 v8SetReturnValue(info, hiddenValue); | 376 v8SetReturnValue(info, hiddenValue); |
377 return; | 377 return; |
378 } | 378 } |
379 | 379 |
380 v8SetReturnValue(info, privateTemplate->GetFunction()); | 380 v8SetReturnValue(info, privateTemplate->GetFunction()); |
381 } | 381 } |
382 | 382 |
383 static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetterCallback(v
8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 383 static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetterCallback(v
8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
384 { | 384 { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 return; | 416 return; |
417 } | 417 } |
418 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); | 418 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); |
419 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { | 419 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { |
420 static int sharedTemplateUniqueKey; | 420 static int sharedTemplateUniqueKey; |
421 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal
::doNotCheckSecurityUnforgeableVoidMethodMethodCallback, v8Undefined(), v8::Sign
ature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMT
emplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0); | 421 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal
::doNotCheckSecurityUnforgeableVoidMethodMethodCallback, v8Undefined(), v8::Sign
ature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMT
emplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0); |
422 v8SetReturnValue(info, sharedTemplate->GetFunction()); | 422 v8SetReturnValue(info, sharedTemplate->GetFunction()); |
423 return; | 423 return; |
424 } | 424 } |
425 | 425 |
426 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::N
ewFromUtf8(info.GetIsolate(), "doNotCheckSecurityUnforgeableVoidMethod", v8::Str
ing::kInternalizedString)); | 426 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin
g(info.GetIsolate(), "doNotCheckSecurityUnforgeableVoidMethod")); |
427 if (!hiddenValue.IsEmpty()) { | 427 if (!hiddenValue.IsEmpty()) { |
428 v8SetReturnValue(info, hiddenValue); | 428 v8SetReturnValue(info, hiddenValue); |
429 return; | 429 return; |
430 } | 430 } |
431 | 431 |
432 v8SetReturnValue(info, privateTemplate->GetFunction()); | 432 v8SetReturnValue(info, privateTemplate->GetFunction()); |
433 } | 433 } |
434 | 434 |
435 static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallbac
k(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 435 static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallbac
k(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
436 { | 436 { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 fromInternalPointer(object)->deref(); | 554 fromInternalPointer(object)->deref(); |
555 } | 555 } |
556 | 556 |
557 template<> | 557 template<> |
558 v8::Handle<v8::Value> toV8NoInline(TestInterfaceCheckSecurity* impl, v8::Handle<
v8::Object> creationContext, v8::Isolate* isolate) | 558 v8::Handle<v8::Value> toV8NoInline(TestInterfaceCheckSecurity* impl, v8::Handle<
v8::Object> creationContext, v8::Isolate* isolate) |
559 { | 559 { |
560 return toV8(impl, creationContext, isolate); | 560 return toV8(impl, creationContext, isolate); |
561 } | 561 } |
562 | 562 |
563 } // namespace WebCore | 563 } // namespace WebCore |
OLD | NEW |