summaryrefslogtreecommitdiff
path: root/chromium/gin/v8_initializer.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-08-14 11:38:45 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-08-14 17:16:47 +0000
commit3a97ca8dd9b96b599ae2d33e40df0dd2f7ea5859 (patch)
tree43cc572ba067417c7341db81f71ae7cc6e0fcc3e /chromium/gin/v8_initializer.h
parentf61ab1ac7f855cd281809255c0aedbb1895e1823 (diff)
downloadqtwebengine-chromium-3a97ca8dd9b96b599ae2d33e40df0dd2f7ea5859.tar.gz
BASELINE: Update chromium to 45.0.2454.40
Change-Id: Id2121d9f11a8fc633677236c65a3e41feef589e4 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'chromium/gin/v8_initializer.h')
-rw-r--r--chromium/gin/v8_initializer.h44
1 files changed, 26 insertions, 18 deletions
diff --git a/chromium/gin/v8_initializer.h b/chromium/gin/v8_initializer.h
index 68068c4848b..e1814369225 100644
--- a/chromium/gin/v8_initializer.h
+++ b/chromium/gin/v8_initializer.h
@@ -6,6 +6,7 @@
#define GIN_V8_INITIALIZER_H_
#include "base/files/file.h"
+#include "base/files/memory_mapped_file.h"
#include "gin/array_buffer.h"
#include "gin/gin_export.h"
#include "gin/public/isolate_holder.h"
@@ -16,10 +17,6 @@ namespace gin {
class GIN_EXPORT V8Initializer {
public:
- static const int kV8SnapshotBasePathKey;
- static const char kNativesFileName[];
- static const char kSnapshotFileName[];
-
// This should be called by IsolateHolder::Initialize().
static void Initialize(gin::IsolateHolder::ScriptMode mode);
@@ -35,25 +32,36 @@ 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, if they are available.
+ static void LoadV8Snapshot();
- // Load V8 snapshot from default resources. Returns true on success or
- // snapshot is already loaded, false otherwise.
- static bool 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);
+ // Opens (unless already cached) and returns the V8 natives file.
+ // Use with LoadV8NativesFromFD().
+ // Asserts if the file does not exist.
+ static base::PlatformFile GetOpenNativesFileForChildProcesses(
+ base::MemoryMappedFile::Region* region_out);
+ // Opens (unless already cached) and returns the V8 snapshot file.
+ // Use with LoadV8SnapshotFromFD().
+ // Will return -1 if the file does not exist.
+ static base::PlatformFile GetOpenSnapshotFileForChildProcesses(
+ base::MemoryMappedFile::Region* region_out);
#endif // V8_USE_EXTERNAL_STARTUP_DATA
};