Chromium Code Reviews| Index: src/api.cc |
| diff --git a/src/api.cc b/src/api.cc |
| index e5e674ac0e444c99ca45ed283076a5f499f4a58f..df6804df3e37c8e4f3f15b4ea2df3ccf20e8568c 100644 |
| --- a/src/api.cc |
| +++ b/src/api.cc |
| @@ -207,7 +207,7 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) { |
| } |
| -bool RunExtraCode(Isolate* isolate, char* utf8_source) { |
| +bool RunExtraCode(Isolate* isolate, const char* utf8_source) { |
| // Run custom script if provided. |
| TryCatch try_catch; |
| Local<String> source_string = String::NewFromUtf8(isolate, utf8_source); |
| @@ -221,7 +221,7 @@ bool RunExtraCode(Isolate* isolate, char* utf8_source) { |
| } |
| -StartupData V8::CreateSnapshotDataBlob(char* custom_source) { |
| +StartupData V8::CreateSnapshotDataBlob(const char* custom_source) { |
| Isolate::CreateParams params; |
| params.enable_serializer = true; |
| Isolate* isolate = v8::Isolate::New(params); |
| @@ -6526,6 +6526,13 @@ Isolate* Isolate::GetCurrent() { |
| Isolate* Isolate::New(const Isolate::CreateParams& params) { |
| i::Isolate* isolate = new i::Isolate(params.enable_serializer); |
| Isolate* v8_isolate = reinterpret_cast<Isolate*>(isolate); |
| + if (!params.enable_serializer) { |
|
vogelheim
2015/02/24 15:16:31
Why the check for !enable_serializer?
The comment
Yang
2015/02/25 08:19:20
You are right. In fact, there is no point in havin
|
| + if (params.snapshot_blob != NULL) { |
| + isolate->set_snapshot_blob(params.snapshot_blob); |
| + } else { |
| + isolate->set_snapshot_blob(i::Snapshot::DefaultSnapshotBlob()); |
| + } |
| + } |
| if (params.entry_hook) { |
| isolate->set_function_entry_hook(params.entry_hook); |
| } |