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

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
« no previous file with comments | « 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 9b6be9ac556bee65c45f635b9dcba90028d5c9e3..fd84341b1e335bb25389617a5543305f1d76599f 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -1602,6 +1602,7 @@ Local<UnboundScript> ScriptCompiler::CompileUnbound(
i::Handle<i::Object> name_obj;
int line_offset = 0;
int column_offset = 0;
+ bool is_embedder_debug_script = false;
bool is_shared_cross_origin = false;
if (!source->resource_name.IsEmpty()) {
name_obj = Utils::OpenHandle(*(source->resource_name));
@@ -1614,15 +1615,18 @@ Local<UnboundScript> ScriptCompiler::CompileUnbound(
static_cast<int>(source->resource_column_offset->Value());
}
if (!source->resource_is_shared_cross_origin.IsEmpty()) {
- v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate);
is_shared_cross_origin =
- source->resource_is_shared_cross_origin == v8::True(v8_isolate);
+ source->resource_is_shared_cross_origin->IsTrue();
+ }
+ if (!source->resource_is_embedder_debug_script.IsEmpty()) {
+ is_embedder_debug_script =
+ source->resource_is_embedder_debug_script->IsTrue();
}
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_embedder_debug_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
@@ -1700,8 +1704,12 @@ Local<Script> ScriptCompiler::Compile(Isolate* v8_isolate,
static_cast<int>(origin.ResourceColumnOffset()->Value())));
}
if (!origin.ResourceIsSharedCrossOrigin().IsEmpty()) {
- script->set_is_shared_cross_origin(origin.ResourceIsSharedCrossOrigin() ==
- v8::True(v8_isolate));
+ script->set_is_shared_cross_origin(
+ origin.ResourceIsSharedCrossOrigin()->IsTrue());
+ }
+ if (!origin.ResourceIsEmbedderDebugScript().IsEmpty()) {
+ script->set_is_embedder_debug_script(
+ origin.ResourceIsEmbedderDebugScript()->IsTrue());
}
source->info->set_script(script);
source->info->SetContext(isolate->native_context());
@@ -1966,8 +1974,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_embedder_debug_script()));
return origin;
}
@@ -4137,7 +4146,10 @@ ScriptOrigin Function::GetScriptOrigin() const {
v8::ScriptOrigin origin(
Utils::ToLocal(scriptName),
v8::Integer::New(isolate, script->line_offset()->value()),
- v8::Integer::New(isolate, script->column_offset()->value()));
+ v8::Integer::New(isolate, script->column_offset()->value()),
+ v8::Boolean::New(isolate, script->is_shared_cross_origin()),
+ v8::Integer::New(isolate, script->id()->value()),
+ v8::Boolean::New(isolate, script->is_embedder_debug_script()));
return origin;
}
return v8::ScriptOrigin(Handle<Value>());
« no previous file with comments | « src/accessors.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698