| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 return; | 209 return; |
| 210 } | 210 } |
| 211 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); | 211 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); |
| 212 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { | 212 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { |
| 213 static int sharedTemplateUniqueKey; | 213 static int sharedTemplateUniqueKey; |
| 214 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal
::doNotCheckSecurityVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(
info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(),
currentWorldType)), 0); | 214 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal
::doNotCheckSecurityVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(
info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(),
currentWorldType)), 0); |
| 215 v8SetReturnValue(info, sharedTemplate->GetFunction()); | 215 v8SetReturnValue(info, sharedTemplate->GetFunction()); |
| 216 return; | 216 return; |
| 217 } | 217 } |
| 218 | 218 |
| 219 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::N
ewFromUtf8(info.GetIsolate(), "doNotCheckSecurityVoidMethod", v8::String::kInter
nalizedString)); | 219 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin
g(info.GetIsolate(), "doNotCheckSecurityVoidMethod")); |
| 220 if (!hiddenValue.IsEmpty()) { | 220 if (!hiddenValue.IsEmpty()) { |
| 221 v8SetReturnValue(info, hiddenValue); | 221 v8SetReturnValue(info, hiddenValue); |
| 222 return; | 222 return; |
| 223 } | 223 } |
| 224 | 224 |
| 225 v8SetReturnValue(info, privateTemplate->GetFunction()); | 225 v8SetReturnValue(info, privateTemplate->GetFunction()); |
| 226 } | 226 } |
| 227 | 227 |
| 228 static void doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback(v8::Local
<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 228 static void doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback(v8::Local
<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 229 { | 229 { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 return; | 261 return; |
| 262 } | 262 } |
| 263 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); | 263 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); |
| 264 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { | 264 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { |
| 265 static int sharedTemplateUniqueKey; | 265 static int sharedTemplateUniqueKey; |
| 266 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal
::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback, v8Undefined(), v8:
:Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(inf
o.GetIsolate(), currentWorldType)), 0); | 266 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal
::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback, v8Undefined(), v8:
:Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(inf
o.GetIsolate(), currentWorldType)), 0); |
| 267 v8SetReturnValue(info, sharedTemplate->GetFunction()); | 267 v8SetReturnValue(info, sharedTemplate->GetFunction()); |
| 268 return; | 268 return; |
| 269 } | 269 } |
| 270 | 270 |
| 271 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::N
ewFromUtf8(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod", v8
::String::kInternalizedString)); | 271 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin
g(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod")); |
| 272 if (!hiddenValue.IsEmpty()) { | 272 if (!hiddenValue.IsEmpty()) { |
| 273 v8SetReturnValue(info, hiddenValue); | 273 v8SetReturnValue(info, hiddenValue); |
| 274 return; | 274 return; |
| 275 } | 275 } |
| 276 | 276 |
| 277 v8SetReturnValue(info, privateTemplate->GetFunction()); | 277 v8SetReturnValue(info, privateTemplate->GetFunction()); |
| 278 } | 278 } |
| 279 | 279 |
| 280 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCa
llback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 280 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCa
llback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 281 { | 281 { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 return; | 313 return; |
| 314 } | 314 } |
| 315 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); | 315 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); |
| 316 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { | 316 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { |
| 317 static int sharedTemplateUniqueKey; | 317 static int sharedTemplateUniqueKey; |
| 318 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal
::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld, v8Unde
fined(), v8::Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::dom
Template(info.GetIsolate(), currentWorldType)), 0); | 318 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal
::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld, v8Unde
fined(), v8::Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::dom
Template(info.GetIsolate(), currentWorldType)), 0); |
| 319 v8SetReturnValue(info, sharedTemplate->GetFunction()); | 319 v8SetReturnValue(info, sharedTemplate->GetFunction()); |
| 320 return; | 320 return; |
| 321 } | 321 } |
| 322 | 322 |
| 323 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::N
ewFromUtf8(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod", v8
::String::kInternalizedString)); | 323 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin
g(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod")); |
| 324 if (!hiddenValue.IsEmpty()) { | 324 if (!hiddenValue.IsEmpty()) { |
| 325 v8SetReturnValue(info, hiddenValue); | 325 v8SetReturnValue(info, hiddenValue); |
| 326 return; | 326 return; |
| 327 } | 327 } |
| 328 | 328 |
| 329 v8SetReturnValue(info, privateTemplate->GetFunction()); | 329 v8SetReturnValue(info, privateTemplate->GetFunction()); |
| 330 } | 330 } |
| 331 | 331 |
| 332 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCa
llbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Val
ue>& info) | 332 static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCa
llbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Val
ue>& info) |
| 333 { | 333 { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 return; | 365 return; |
| 366 } | 366 } |
| 367 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); | 367 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); |
| 368 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { | 368 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { |
| 369 static int sharedTemplateUniqueKey; | 369 static int sharedTemplateUniqueKey; |
| 370 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal
::doNotCheckSecurityReadOnlyVoidMethodMethodCallback, v8Undefined(), v8::Signatu
re::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIso
late(), currentWorldType)), 0); | 370 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal
::doNotCheckSecurityReadOnlyVoidMethodMethodCallback, v8Undefined(), v8::Signatu
re::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIso
late(), currentWorldType)), 0); |
| 371 v8SetReturnValue(info, sharedTemplate->GetFunction()); | 371 v8SetReturnValue(info, sharedTemplate->GetFunction()); |
| 372 return; | 372 return; |
| 373 } | 373 } |
| 374 | 374 |
| 375 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::N
ewFromUtf8(info.GetIsolate(), "doNotCheckSecurityReadOnlyVoidMethod", v8::String
::kInternalizedString)); | 375 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin
g(info.GetIsolate(), "doNotCheckSecurityReadOnlyVoidMethod")); |
| 376 if (!hiddenValue.IsEmpty()) { | 376 if (!hiddenValue.IsEmpty()) { |
| 377 v8SetReturnValue(info, hiddenValue); | 377 v8SetReturnValue(info, hiddenValue); |
| 378 return; | 378 return; |
| 379 } | 379 } |
| 380 | 380 |
| 381 v8SetReturnValue(info, privateTemplate->GetFunction()); | 381 v8SetReturnValue(info, privateTemplate->GetFunction()); |
| 382 } | 382 } |
| 383 | 383 |
| 384 static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetterCallback(v
8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 384 static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetterCallback(v
8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 385 { | 385 { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 return; | 417 return; |
| 418 } | 418 } |
| 419 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); | 419 TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(hol
der); |
| 420 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { | 420 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecu
rityError)) { |
| 421 static int sharedTemplateUniqueKey; | 421 static int sharedTemplateUniqueKey; |
| 422 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal
::doNotCheckSecurityUnforgeableVoidMethodMethodCallback, v8Undefined(), v8::Sign
ature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.Get
Isolate(), currentWorldType)), 0); | 422 v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(
currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal
::doNotCheckSecurityUnforgeableVoidMethodMethodCallback, v8Undefined(), v8::Sign
ature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.Get
Isolate(), currentWorldType)), 0); |
| 423 v8SetReturnValue(info, sharedTemplate->GetFunction()); | 423 v8SetReturnValue(info, sharedTemplate->GetFunction()); |
| 424 return; | 424 return; |
| 425 } | 425 } |
| 426 | 426 |
| 427 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::N
ewFromUtf8(info.GetIsolate(), "doNotCheckSecurityUnforgeableVoidMethod", v8::Str
ing::kInternalizedString)); | 427 v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8AtomicStrin
g(info.GetIsolate(), "doNotCheckSecurityUnforgeableVoidMethod")); |
| 428 if (!hiddenValue.IsEmpty()) { | 428 if (!hiddenValue.IsEmpty()) { |
| 429 v8SetReturnValue(info, hiddenValue); | 429 v8SetReturnValue(info, hiddenValue); |
| 430 return; | 430 return; |
| 431 } | 431 } |
| 432 | 432 |
| 433 v8SetReturnValue(info, privateTemplate->GetFunction()); | 433 v8SetReturnValue(info, privateTemplate->GetFunction()); |
| 434 } | 434 } |
| 435 | 435 |
| 436 static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallbac
k(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 436 static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallbac
k(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 437 { | 437 { |
| (...skipping 116 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 |