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

Unified Diff: gin/v8_initializer.cc

Issue 2006703005: Define kInvalidPlatformFile in base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no ppapi Created 4 years, 7 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 | « base/i18n/icu_util.cc ('k') | mojo/public/cpp/system/platform_handle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/v8_initializer.cc
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
index ad29d10effa846bd78a0c82ec04b37c7922f0ed9..a3dad4f007d11e04edfaa5d21d02bdedf487fc33 100644
--- a/gin/v8_initializer.cc
+++ b/gin/v8_initializer.cc
@@ -44,13 +44,6 @@ base::MemoryMappedFile* g_mapped_snapshot = nullptr;
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
-const base::PlatformFile kInvalidPlatformFile =
-#if defined(OS_WIN)
- INVALID_HANDLE_VALUE;
-#else
- -1;
-#endif
-
// File handles intentionally never closed. Not using File here because its
// Windows implementation guards against two instances owning the same
// PlatformFile (which we allow since we know it is never freed).
@@ -63,8 +56,8 @@ static base::LazyInstance<OpenedFileMap>::Leaky g_opened_files =
OpenedFileMap::mapped_type& GetOpenedFile(const char* file) {
OpenedFileMap& opened_files(g_opened_files.Get());
if (opened_files.find(file) == opened_files.end()) {
- opened_files[file] =
- std::make_pair(kInvalidPlatformFile, base::MemoryMappedFile::Region());
+ opened_files[file] = std::make_pair(base::kInvalidPlatformFile,
+ base::MemoryMappedFile::Region());
}
return opened_files[file];
}
@@ -193,7 +186,7 @@ base::PlatformFile OpenV8File(const char* file_name,
static const OpenedFileMap::mapped_type OpenFileIfNecessary(
const char* file_name) {
OpenedFileMap::mapped_type& opened = GetOpenedFile(file_name);
- if (opened.first == kInvalidPlatformFile) {
+ if (opened.first == base::kInvalidPlatformFile) {
opened.first = OpenV8File(file_name, &opened.second);
}
return opened;
@@ -258,7 +251,7 @@ static LoadV8FileResult MapVerify(const OpenedFileMap::mapped_type& file_region,
const unsigned char* fingerprint,
#endif
base::MemoryMappedFile** mmapped_file_out) {
- if (file_region.first == kInvalidPlatformFile)
+ if (file_region.first == base::kInvalidPlatformFile)
return V8_LOAD_FAILED_OPEN;
if (!MapV8File(file_region.first, file_region.second, mmapped_file_out))
return V8_LOAD_FAILED_MAP;
@@ -309,7 +302,7 @@ void V8Initializer::LoadV8SnapshotFromFD(base::PlatformFile snapshot_pf,
if (g_mapped_snapshot)
return;
- if (snapshot_pf == kInvalidPlatformFile)
+ if (snapshot_pf == base::kInvalidPlatformFile)
return;
base::MemoryMappedFile::Region snapshot_region =
@@ -341,7 +334,7 @@ void V8Initializer::LoadV8NativesFromFD(base::PlatformFile natives_pf,
if (g_mapped_natives)
return;
- CHECK_NE(natives_pf, kInvalidPlatformFile);
+ CHECK_NE(natives_pf, base::kInvalidPlatformFile);
base::MemoryMappedFile::Region natives_region =
base::MemoryMappedFile::Region::kWholeFile;
« no previous file with comments | « base/i18n/icu_util.cc ('k') | mojo/public/cpp/system/platform_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698