Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 436 Object* data_obj = | 436 Object* data_obj = |
| 437 constructor->shared()->get_api_func_data()->access_check_info(); | 437 constructor->shared()->get_api_func_data()->access_check_info(); |
| 438 if (data_obj == heap_.undefined_value()) return false; | 438 if (data_obj == heap_.undefined_value()) return false; |
| 439 | 439 |
| 440 Object* fun_obj = AccessCheckInfo::cast(data_obj)->named_callback(); | 440 Object* fun_obj = AccessCheckInfo::cast(data_obj)->named_callback(); |
| 441 v8::NamedSecurityCallback callback = | 441 v8::NamedSecurityCallback callback = |
| 442 v8::ToCData<v8::NamedSecurityCallback>(fun_obj); | 442 v8::ToCData<v8::NamedSecurityCallback>(fun_obj); |
| 443 | 443 |
| 444 if (!callback) return false; | 444 if (!callback) return false; |
| 445 | 445 |
| 446 HandleScope scope; | 446 HandleScope scope(this); |
| 447 Handle<JSObject> receiver_handle(receiver); | 447 Handle<JSObject> receiver_handle(receiver, this); |
|
Dmitry Titov
2010/11/12 17:26:44
Should this just use the HeapObject version?
| |
| 448 Handle<Object> key_handle(key); | 448 Handle<Object> key_handle(key, this); |
| 449 Handle<Object> data(AccessCheckInfo::cast(data_obj)->data()); | 449 Handle<Object> data(AccessCheckInfo::cast(data_obj)->data(), this); |
| 450 LOG(ApiNamedSecurityCheck(key)); | 450 LOG(ApiNamedSecurityCheck(key)); |
| 451 bool result = false; | 451 bool result = false; |
| 452 { | 452 { |
| 453 // Leaving JavaScript. | 453 // Leaving JavaScript. |
| 454 VMState state(EXTERNAL); | 454 VMState state(this, EXTERNAL); |
| 455 result = callback(v8::Utils::ToLocal(receiver_handle), | 455 result = callback(v8::Utils::ToLocal(receiver_handle), |
| 456 v8::Utils::ToLocal(key_handle), | 456 v8::Utils::ToLocal(key_handle), |
| 457 type, | 457 type, |
| 458 v8::Utils::ToLocal(data)); | 458 v8::Utils::ToLocal(data)); |
| 459 } | 459 } |
| 460 return result; | 460 return result; |
| 461 } | 461 } |
| 462 | 462 |
| 463 | 463 |
| 464 bool Isolate::MayIndexedAccess(JSObject* receiver, | 464 bool Isolate::MayIndexedAccess(JSObject* receiver, |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 479 Object* data_obj = | 479 Object* data_obj = |
| 480 constructor->shared()->get_api_func_data()->access_check_info(); | 480 constructor->shared()->get_api_func_data()->access_check_info(); |
| 481 if (data_obj == heap_.undefined_value()) return false; | 481 if (data_obj == heap_.undefined_value()) return false; |
| 482 | 482 |
| 483 Object* fun_obj = AccessCheckInfo::cast(data_obj)->indexed_callback(); | 483 Object* fun_obj = AccessCheckInfo::cast(data_obj)->indexed_callback(); |
| 484 v8::IndexedSecurityCallback callback = | 484 v8::IndexedSecurityCallback callback = |
| 485 v8::ToCData<v8::IndexedSecurityCallback>(fun_obj); | 485 v8::ToCData<v8::IndexedSecurityCallback>(fun_obj); |
| 486 | 486 |
| 487 if (!callback) return false; | 487 if (!callback) return false; |
| 488 | 488 |
| 489 HandleScope scope; | 489 HandleScope scope(this); |
| 490 Handle<JSObject> receiver_handle(receiver); | 490 Handle<JSObject> receiver_handle(receiver, this); |
|
Dmitry Titov
2010/11/12 17:26:44
same here.
| |
| 491 Handle<Object> data(AccessCheckInfo::cast(data_obj)->data()); | 491 Handle<Object> data(AccessCheckInfo::cast(data_obj)->data(), this); |
| 492 LOG(ApiIndexedSecurityCheck(index)); | 492 LOG(ApiIndexedSecurityCheck(index)); |
| 493 bool result = false; | 493 bool result = false; |
| 494 { | 494 { |
| 495 // Leaving JavaScript. | 495 // Leaving JavaScript. |
| 496 VMState state(EXTERNAL); | 496 VMState state(this, EXTERNAL); |
| 497 result = callback(v8::Utils::ToLocal(receiver_handle), | 497 result = callback(v8::Utils::ToLocal(receiver_handle), |
| 498 index, | 498 index, |
| 499 type, | 499 type, |
| 500 v8::Utils::ToLocal(data)); | 500 v8::Utils::ToLocal(data)); |
| 501 } | 501 } |
| 502 return result; | 502 return result; |
| 503 } | 503 } |
| 504 | 504 |
| 505 | 505 |
| 506 const char* const Isolate::kStackOverflowMessage = | 506 const char* const Isolate::kStackOverflowMessage = |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 917 Isolate::Current()->break_access()->Lock(); | 917 Isolate::Current()->break_access()->Lock(); |
| 918 } | 918 } |
| 919 | 919 |
| 920 | 920 |
| 921 ExecutionAccess::~ExecutionAccess() { | 921 ExecutionAccess::~ExecutionAccess() { |
| 922 Isolate::Current()->break_access()->Unlock(); | 922 Isolate::Current()->break_access()->Unlock(); |
| 923 } | 923 } |
| 924 | 924 |
| 925 | 925 |
| 926 } } // namespace v8::internal | 926 } } // namespace v8::internal |
| OLD | NEW |