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

Unified Diff: gin/v8_initializer.h

Issue 1164483003: Allow startup with missing V8 snapshot file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix misplaced ifdef for Windows Created 5 years, 6 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 | « gin/test/v8_test.cc ('k') | gin/v8_initializer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/v8_initializer.h
diff --git a/gin/v8_initializer.h b/gin/v8_initializer.h
index 0189f594f939322a7b5ec65d2f2612afa5660d4e..1e05fd038c8a4696358bfd0eb4a094a3ab95d7c9 100644
--- a/gin/v8_initializer.h
+++ b/gin/v8_initializer.h
@@ -31,25 +31,31 @@ class GIN_EXPORT V8Initializer {
// Load V8 snapshot from user provided platform file descriptors.
// The offset and size arguments, if non-zero, specify the portions
- // of the files to be loaded. This methods returns true on success
- // (or if snapshot is already loaded), false otherwise.
- static bool LoadV8SnapshotFromFD(base::PlatformFile natives_fd,
- int64 natives_offset,
- int64 natives_size,
- base::PlatformFile snapshot_fd,
+ // of the files to be loaded. Since the VM can boot with or without
+ // the snapshot, this function does not return a status.
+ static void LoadV8SnapshotFromFD(base::PlatformFile snapshot_fd,
int64 snapshot_offset,
int64 snapshot_size);
+ // Similar to LoadV8SnapshotFromFD, but for the source of the natives.
+ // Without the natives we cannot continue, so this function contains
+ // release mode asserts and won't return if it fails.
+ static void LoadV8NativesFromFD(base::PlatformFile natives_fd,
+ int64 natives_offset,
+ int64 natives_size);
- // Load V8 snapshot from default resources. Returns true on success or
- // snapshot is already loaded, false otherwise.
- static bool LoadV8Snapshot();
+ // Load V8 snapshot from default resources, if they are available.
+ static void LoadV8Snapshot();
+
+ // Load V8 natives source from default resources. Contains asserts
+ // so that it will not return if natives cannot be loaded.
+ static void LoadV8Natives();
// Opens the V8 snapshot data files and returns open file descriptors to these
// files in |natives_fd_out| and |snapshot_fd_out|, which can be passed to
// child processes.
static bool OpenV8FilesForChildProcesses(base::PlatformFile* natives_fd_out,
- base::PlatformFile* snapshot_fd_out);
-
+ base::PlatformFile* snapshot_fd_out)
+ WARN_UNUSED_RESULT;
#endif // V8_USE_EXTERNAL_STARTUP_DATA
};
« no previous file with comments | « gin/test/v8_test.cc ('k') | gin/v8_initializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698