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

Unified Diff: gin/v8_initializer.h

Issue 1156873002: Load v8 snapshots directly from APK (and store them uncompressed) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v8initializer
Patch Set: Keep extracting for components/ 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
Index: gin/v8_initializer.h
diff --git a/gin/v8_initializer.h b/gin/v8_initializer.h
index 1e05fd038c8a4696358bfd0eb4a094a3ab95d7c9..ef2f0d99d425662af0ddb4e9103b53470e1ec1ea 100644
--- a/gin/v8_initializer.h
+++ b/gin/v8_initializer.h
@@ -6,6 +6,8 @@
#define GIN_V8_INITIALIZER_H_
#include "base/files/file.h"
+#include "base/files/memory_mapped_file.h"
+#include "base/macros.h"
#include "gin/array_buffer.h"
#include "gin/gin_export.h"
#include "gin/public/isolate_holder.h"
@@ -28,7 +30,6 @@ class GIN_EXPORT V8Initializer {
int* snapshot_size_out);
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
-
// 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. Since the VM can boot with or without
@@ -50,12 +51,22 @@ class GIN_EXPORT V8Initializer {
// 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)
- WARN_UNUSED_RESULT;
+#if defined(OS_POSIX)
+ struct V8Files {
rmcilroy 2015/06/09 11:52:55 nit - V8StartupData
rmcilroy 2015/06/09 11:52:55 Make struct "final" (or destructor should be virtu
+ V8Files();
+ ~V8Files();
+ base::ScopedFD natives_fd;
rmcilroy 2015/06/09 11:52:55 nit - newline between fields and constructor / des
+ base::ScopedFD snapshot_fd;
+ base::MemoryMappedFile::Region natives_region;
+ base::MemoryMappedFile::Region snapshot_region;
+ private:
rmcilroy 2015/06/09 11:52:55 nit - newline before "private"
+ DISALLOW_COPY_AND_ASSIGN(V8Files);
+ };
+
+ // Opens the V8 snapshot data files and returns open file descriptors and
+ // file regions to these files that can be passed to child processes.
+ static void OpenV8FilesForChildProcesses(V8Files* files_out);
+#endif // OS_POSIX
#endif // V8_USE_EXTERNAL_STARTUP_DATA
};

Powered by Google App Engine
This is Rietveld 408576698