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

Unified Diff: src/api.cc

Issue 848023002: Store embed-script flag as metadata into snapshot blob. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comment 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 | « no previous file | 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 99b0bb8be3de7154f196027c23318782080d7cab..5a18446cd7b1d8b53ed525ba0f363ff8d60f7bcb 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -229,11 +229,13 @@ StartupData V8::CreateSnapshotDataBlob(char* custom_source) {
Isolate::Scope isolate_scope(isolate);
i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
Persistent<Context> context;
+ i::Snapshot::Metadata metadata;
{
HandleScope handle_scope(isolate);
Handle<Context> new_context = Context::New(isolate);
context.Reset(isolate, new_context);
if (custom_source != NULL) {
+ metadata.set_embeds_script(true);
Context::Scope context_scope(new_context);
if (!RunExtraCode(isolate, custom_source)) context.Reset();
}
@@ -264,7 +266,8 @@ StartupData V8::CreateSnapshotDataBlob(char* custom_source) {
i::SnapshotData sd(snapshot_sink, ser);
i::SnapshotData csd(context_sink, context_ser);
- result = i::Snapshot::CreateSnapshotBlob(sd.RawData(), csd.RawData());
+ result = i::Snapshot::CreateSnapshotBlob(sd.RawData(), csd.RawData(),
+ metadata);
}
}
isolate->Dispose();
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698