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

Side by Side Diff: src/d8.cc

Issue 1393713006: Don't compile functions in a context the caller doesn't have access to (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 | src/generator.js » ('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 5
6 // Defined when linking against shared lib on Windows. 6 // Defined when linking against shared lib on Windows.
7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED)
8 #define V8_SHARED 8 #define V8_SHARED
9 #endif 9 #endif
10 10
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 if (worker == NULL) { 133 if (worker == NULL) {
134 Throw(isolate, "Worker is defunct because main thread is terminating"); 134 Throw(isolate, "Worker is defunct because main thread is terminating");
135 return NULL; 135 return NULL;
136 } 136 }
137 137
138 return worker; 138 return worker;
139 } 139 }
140 #endif // !V8_SHARED 140 #endif // !V8_SHARED
141 141
142 142
143 bool NamedAccessCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key,
144 v8::AccessType type, v8::Local<v8::Value> data) {
145 return false;
146 }
147
148
149 bool IndexedAccessCheck(v8::Local<v8::Object> host, uint32_t index,
150 v8::AccessType type, v8::Local<v8::Value> data) {
151 return false;
152 }
153
143 } // namespace 154 } // namespace
144 155
145 156
146 class PerIsolateData { 157 class PerIsolateData {
147 public: 158 public:
148 explicit PerIsolateData(Isolate* isolate) : isolate_(isolate), realms_(NULL) { 159 explicit PerIsolateData(Isolate* isolate) : isolate_(isolate), realms_(NULL) {
149 HandleScope scope(isolate); 160 HandleScope scope(isolate);
150 isolate->SetData(0, this); 161 isolate->SetData(0, this);
151 } 162 }
152 163
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
1171 worker_fun_template); 1182 worker_fun_template);
1172 #endif // !V8_SHARED 1183 #endif // !V8_SHARED
1173 1184
1174 Local<ObjectTemplate> os_templ = ObjectTemplate::New(isolate); 1185 Local<ObjectTemplate> os_templ = ObjectTemplate::New(isolate);
1175 AddOSMethods(isolate, os_templ); 1186 AddOSMethods(isolate, os_templ);
1176 global_template->Set( 1187 global_template->Set(
1177 String::NewFromUtf8(isolate, "os", NewStringType::kNormal) 1188 String::NewFromUtf8(isolate, "os", NewStringType::kNormal)
1178 .ToLocalChecked(), 1189 .ToLocalChecked(),
1179 os_templ); 1190 os_templ);
1180 1191
1192 global_template->SetAccessCheckCallbacks(NamedAccessCheck,
1193 IndexedAccessCheck);
1194
1181 return global_template; 1195 return global_template;
1182 } 1196 }
1183 1197
1184 1198
1185 void Shell::Initialize(Isolate* isolate) { 1199 void Shell::Initialize(Isolate* isolate) {
1186 #ifndef V8_SHARED 1200 #ifndef V8_SHARED
1187 // Set up counters 1201 // Set up counters
1188 if (i::StrLength(i::FLAG_map_counters) != 0) 1202 if (i::StrLength(i::FLAG_map_counters) != 0)
1189 MapCounters(isolate, i::FLAG_map_counters); 1203 MapCounters(isolate, i::FLAG_map_counters);
1190 #endif // !V8_SHARED 1204 #endif // !V8_SHARED
(...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after
2476 } 2490 }
2477 2491
2478 } // namespace v8 2492 } // namespace v8
2479 2493
2480 2494
2481 #ifndef GOOGLE3 2495 #ifndef GOOGLE3
2482 int main(int argc, char* argv[]) { 2496 int main(int argc, char* argv[]) {
2483 return v8::Shell::Main(argc, argv); 2497 return v8::Shell::Main(argc, argv);
2484 } 2498 }
2485 #endif 2499 #endif
OLDNEW
« no previous file with comments | « no previous file | src/generator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698