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

Unified Diff: gin/isolate_holder.cc

Issue 819203003: Enable Windows to load V8's initial snapshot from external files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sha_snapshot
Patch Set: Rebase Created 5 years, 11 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 | « chrome/installer/mini_installer.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/isolate_holder.cc
diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc
index ab18ce45bc89bce403903f18bed96ae3545293be..c666e29950a0a652a4085880fb716b86a07e4f75 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
« no previous file with comments | « chrome/installer/mini_installer.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698