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

Unified Diff: src/api.cc

Issue 20646006: Pipe a script's CORS status through V8 during compilation. (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@master
Patch Set: rebaseline. Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 3f5a0793b21a5e53d68070494f18e28d79c57cf2..f371c2ae6bd7356139d6b2272c2d9fa0296215a2 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -1917,6 +1917,7 @@ Local<Script> Script::New(v8::Handle<String> source,
i::Handle<i::Object> name_obj;
int line_offset = 0;
int column_offset = 0;
+ bool passed_access_check = false;
if (origin != NULL) {
if (!origin->ResourceName().IsEmpty()) {
name_obj = Utils::OpenHandle(*origin->ResourceName());
@@ -1928,6 +1929,9 @@ Local<Script> Script::New(v8::Handle<String> source,
column_offset =
static_cast<int>(origin->ResourceColumnOffset()->Value());
}
+ if (!origin->ResourcePassedAccessCheck().IsEmpty()) {
+ passed_access_check = origin->ResourcePassedAccessCheck() == v8::True();
+ }
}
EXCEPTION_PREAMBLE(isolate);
i::ScriptDataImpl* pre_data_impl =
@@ -1944,6 +1948,7 @@ Local<Script> Script::New(v8::Handle<String> source,
name_obj,
line_offset,
column_offset,
+ passed_access_check,
isolate->global_context(),
NULL,
pre_data_impl,
@@ -2410,6 +2415,19 @@ int Message::GetEndColumn() const {
return static_cast<int>(start_col_obj->Number()) + (end - start);
}
Michael Starzinger 2013/07/30 09:52:55 nit: Two empty newlines between methods.
+bool Message::DidPassAccessCheck() const {
+ i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
+ if (IsDeadCheck(isolate, "v8::Message::DidPassAccessChecks()")) return 0;
+ ENTER_V8(isolate);
+ i::HandleScope scope(isolate);
+ i::Handle<i::JSMessageObject> message =
+ i::Handle<i::JSMessageObject>::cast(Utils::OpenHandle(this));
+ i::Handle<i::JSValue> script =
+ i::Handle<i::JSValue>::cast(i::Handle<i::Object>(message->script(),
+ isolate));
+ return i::Script::cast(script->value())->passed_access_check();
+}
+
Local<String> Message::GetSourceLine() const {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();

Powered by Google App Engine
This is Rietveld 408576698