summaryrefslogtreecommitdiffstats
path: root/gin
diff options
context:
space:
mode:
authorrmcilroy <rmcilroy@chromium.org>2015-01-09 09:54:16 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-09 17:55:13 +0000
commitceeb241d83ba97554dca023fca8bec6aff30a300 (patch)
tree59fdfe036224e5b9089ecfc98eb16818012e7d50 /gin
parente19d4ef3a1fd8d287ea198b1bf37241d2046a1cc (diff)
downloadchromium_src-ceeb241d83ba97554dca023fca8bec6aff30a300.zip
chromium_src-ceeb241d83ba97554dca023fca8bec6aff30a300.tar.gz
chromium_src-ceeb241d83ba97554dca023fca8bec6aff30a300.tar.bz2
Enable Windows to load V8's initial snapshot from external files.
Not yet enabled by default. BUG=421063,439661 Review URL: https://codereview.chromium.org/819203003 Cr-Commit-Position: refs/heads/master@{#310792}
Diffstat (limited to 'gin')
-rw-r--r--gin/isolate_holder.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc
index ab18ce4..c666e29 100644
--- a/gin/isolate_holder.cc
+++ b/gin/isolate_holder.cc
@@ -55,11 +55,16 @@ bool MapV8Files(base::FilePath* natives_path,
g_mapped_natives = new base::MemoryMappedFile;
if (!g_mapped_natives->IsValid()) {
+#if !defined(OS_WIN)
if (natives_fd == -1
? !g_mapped_natives->Initialize(base::File(*natives_path, flags),
natives_region)
: !g_mapped_natives->Initialize(base::File(natives_fd),
natives_region)) {
+#else
+ if (!g_mapped_natives->Initialize(base::File(*natives_path, flags),
+ natives_region)) {
+#endif // !OS_WIN
delete g_mapped_natives;
g_mapped_natives = NULL;
LOG(FATAL) << "Couldn't mmap v8 natives data file";
@@ -69,11 +74,16 @@ bool MapV8Files(base::FilePath* natives_path,
g_mapped_snapshot = new base::MemoryMappedFile;
if (!g_mapped_snapshot->IsValid()) {
+#if !defined(OS_WIN)
if (snapshot_fd == -1
? !g_mapped_snapshot->Initialize(base::File(*snapshot_path, flags),
snapshot_region)
: !g_mapped_snapshot->Initialize(base::File(snapshot_fd),
snapshot_region)) {
+#else
+ if (!g_mapped_snapshot->Initialize(base::File(*snapshot_path, flags),
+ snapshot_region)) {
+#endif // !OS_WIN
delete g_mapped_snapshot;
g_mapped_snapshot = NULL;
LOG(ERROR) << "Couldn't mmap v8 snapshot data file";
@@ -102,6 +112,8 @@ const int v8_snapshot_dir =
base::DIR_ANDROID_APP_DATA;
#elif defined(OS_POSIX)
base::DIR_EXE;
+#elif defined(OS_WIN)
+ base::DIR_MODULE;
#endif // OS_ANDROID
#endif // !OS_MACOSX