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

Unified Diff: gin/public/isolate_holder.h

Issue 1019483002: Add support to extension_shell and ash_shell to use external V8 snapshot files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Mac and Win builds Created 5 years, 9 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/isolate_holder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/public/isolate_holder.h
diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h
index 7968b1df0ba3edd8a9978105b927a494ec4cb5ef..fb9aea8b5c5afb91df5e85cb3a3b4bc409d01a89 100644
--- a/gin/public/isolate_holder.h
+++ b/gin/public/isolate_holder.h
@@ -10,6 +10,16 @@
#include "gin/gin_export.h"
#include "v8/include/v8.h"
+namespace base {
+
+// Forward declaration of PlatformFile from base/file/file.h
+#if defined(OS_WIN)
+typedef HANDLE PlatformFile;
+#elif defined(OS_POSIX)
+typedef int PlatformFile;
+#endif
+}
+
namespace gin {
class PerIsolateData;
@@ -52,17 +62,26 @@ class GIN_EXPORT IsolateHolder {
void RemoveRunMicrotasksObserver();
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
- static const int kV8SnapshotBasePathKey;
- static const char kNativesFileName[];
- static const char kSnapshotFileName[];
-
+ // Load the V8 snapshot data from the given file descriptors. If offset and
+ // size are zero it will load the whole file, otherwise it will map and load
+ // the region of the file specified by offset and size. Returns true on
+ // success.
static bool LoadV8SnapshotFd(int natives_fd,
int64 natives_offset,
int64 natives_size,
int snapshot_fd,
int64 snapshot_offset,
int64 snapshot_size);
+
+ // Load the V8 snapshot data from the snapshot files. Returns true on success.
static bool LoadV8Snapshot();
+
+ // 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);
+
#endif // V8_USE_EXTERNAL_STARTUP_DATA
static void GetV8ExternalSnapshotData(const char** natives_data_out,
int* natives_size_out,
« no previous file with comments | « gin/isolate_holder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698