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

Side by Side Diff: src/isolate.cc

Issue 1677483002: Always load data for access check callbacks (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/isolate.h" 5 #include "src/isolate.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include <fstream> // NOLINT(readability/streams) 9 #include <fstream> // NOLINT(readability/streams)
10 #include <sstream> 10 #include <sstream>
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 821
822 HandleScope scope(this); 822 HandleScope scope(this);
823 Handle<Object> data; 823 Handle<Object> data;
824 v8::AccessCheckCallback callback = nullptr; 824 v8::AccessCheckCallback callback = nullptr;
825 v8::NamedSecurityCallback named_callback = nullptr; 825 v8::NamedSecurityCallback named_callback = nullptr;
826 { DisallowHeapAllocation no_gc; 826 { DisallowHeapAllocation no_gc;
827 AccessCheckInfo* access_check_info = GetAccessCheckInfo(this, receiver); 827 AccessCheckInfo* access_check_info = GetAccessCheckInfo(this, receiver);
828 if (!access_check_info) return false; 828 if (!access_check_info) return false;
829 Object* fun_obj = access_check_info->callback(); 829 Object* fun_obj = access_check_info->callback();
830 callback = v8::ToCData<v8::AccessCheckCallback>(fun_obj); 830 callback = v8::ToCData<v8::AccessCheckCallback>(fun_obj);
831 data = handle(access_check_info->data(), this);
831 if (!callback) { 832 if (!callback) {
832 fun_obj = access_check_info->named_callback(); 833 fun_obj = access_check_info->named_callback();
833 named_callback = v8::ToCData<v8::NamedSecurityCallback>(fun_obj); 834 named_callback = v8::ToCData<v8::NamedSecurityCallback>(fun_obj);
834 if (!named_callback) return false; 835 if (!named_callback) return false;
835 data = handle(access_check_info->data(), this);
836 } 836 }
837 } 837 }
838 838
839 LOG(this, ApiSecurityCheck()); 839 LOG(this, ApiSecurityCheck());
840 840
841 { 841 {
842 // Leaving JavaScript. 842 // Leaving JavaScript.
843 VMState<EXTERNAL> state(this); 843 VMState<EXTERNAL> state(this);
844 if (callback) { 844 if (callback) {
845 return callback(v8::Utils::ToLocal(accessing_context), 845 return callback(v8::Utils::ToLocal(accessing_context),
(...skipping 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after
2861 // Then check whether this scope intercepts. 2861 // Then check whether this scope intercepts.
2862 if ((flag & intercept_mask_)) { 2862 if ((flag & intercept_mask_)) {
2863 intercepted_flags_ |= flag; 2863 intercepted_flags_ |= flag;
2864 return true; 2864 return true;
2865 } 2865 }
2866 return false; 2866 return false;
2867 } 2867 }
2868 2868
2869 } // namespace internal 2869 } // namespace internal
2870 } // namespace v8 2870 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698