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

Unified Diff: src/api.cc

Issue 879553002: [V8] Added Script::is_debugger_script flag for embedders (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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
« include/v8.h ('K') | « src/accessors.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 3ad5a64f594b0b90aae0fd0e257216970d63fafe..0f1cb31a47f7ac776210cd313807ea233657bccb 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -1550,6 +1550,7 @@ Local<UnboundScript> ScriptCompiler::CompileUnbound(
i::Handle<i::Object> name_obj;
int line_offset = 0;
int column_offset = 0;
+ bool is_internal_script = false;
bool is_shared_cross_origin = false;
if (!source->resource_name.IsEmpty()) {
name_obj = Utils::OpenHandle(*(source->resource_name));
@@ -1566,11 +1567,16 @@ Local<UnboundScript> ScriptCompiler::CompileUnbound(
is_shared_cross_origin =
source->resource_is_shared_cross_origin == v8::True(v8_isolate);
}
+ if (!source->resource_is_internal_script.IsEmpty()) {
+ v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate);
+ is_internal_script =
+ source->resource_is_internal_script == v8::True(v8_isolate);
yurys 2015/01/26 15:41:06 source->resource_is_internal_script->IsTrue()
kozy 2015/01/26 16:42:13 Done.
+ }
EXCEPTION_PREAMBLE(isolate);
i::Handle<i::SharedFunctionInfo> result = i::Compiler::CompileScript(
- str, name_obj, line_offset, column_offset, is_shared_cross_origin,
- isolate->native_context(), NULL, &script_data, options,
- i::NOT_NATIVES_CODE);
+ str, name_obj, line_offset, column_offset, is_internal_script,
+ is_shared_cross_origin, isolate->native_context(), NULL, &script_data,
+ options, i::NOT_NATIVES_CODE);
has_pending_exception = result.is_null();
if (has_pending_exception && script_data != NULL) {
// This case won't happen during normal operation; we have compiled
@@ -1651,6 +1657,10 @@ Local<Script> ScriptCompiler::Compile(Isolate* v8_isolate,
script->set_is_shared_cross_origin(origin.ResourceIsSharedCrossOrigin() ==
v8::True(v8_isolate));
}
+ if (!origin.ResourceIsInternalScript().IsEmpty()) {
+ script->set_is_internal_script(origin.ResourceIsInternalScript() ==
yurys 2015/01/26 15:41:06 ditto
+ v8::True(v8_isolate));
+ }
source->info->set_script(script);
source->info->SetContext(isolate->native_context());
@@ -1914,8 +1924,9 @@ ScriptOrigin Message::GetScriptOrigin() const {
Utils::ToLocal(scriptName),
v8::Integer::New(v8_isolate, script->line_offset()->value()),
v8::Integer::New(v8_isolate, script->column_offset()->value()),
- Handle<Boolean>(),
- v8::Integer::New(v8_isolate, script->id()->value()));
+ v8::Boolean::New(v8_isolate, script->is_shared_cross_origin()),
+ v8::Integer::New(v8_isolate, script->id()->value()),
+ v8::Boolean::New(v8_isolate, script->is_internal_script()));
return origin;
}
« include/v8.h ('K') | « src/accessors.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698