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

Side by Side Diff: base/files/memory_mapped_file.cc

Issue 1549853002: Switch to standard integer types in base/files/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years 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 unified diff | Download patch
« no previous file with comments | « base/files/memory_mapped_file.h ('k') | base/files/memory_mapped_file_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/files/memory_mapped_file.h" 5 #include "base/files/memory_mapped_file.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/sys_info.h" 11 #include "base/sys_info.h"
12 #include "build/build_config.h"
12 13
13 namespace base { 14 namespace base {
14 15
15 const MemoryMappedFile::Region MemoryMappedFile::Region::kWholeFile = {0, 0}; 16 const MemoryMappedFile::Region MemoryMappedFile::Region::kWholeFile = {0, 0};
16 17
17 bool MemoryMappedFile::Region::operator==( 18 bool MemoryMappedFile::Region::operator==(
18 const MemoryMappedFile::Region& other) const { 19 const MemoryMappedFile::Region& other) const {
19 return other.offset == offset && other.size == size; 20 return other.offset == offset && other.size == size;
20 } 21 }
21 22
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 const int64_t mask = 86 const int64_t mask =
86 static_cast<int64_t>(SysInfo::VMAllocationGranularity()) - 1; 87 static_cast<int64_t>(SysInfo::VMAllocationGranularity()) - 1;
87 DCHECK_LT(mask, std::numeric_limits<int32_t>::max()); 88 DCHECK_LT(mask, std::numeric_limits<int32_t>::max());
88 *offset = start & mask; 89 *offset = start & mask;
89 *aligned_start = start & ~mask; 90 *aligned_start = start & ~mask;
90 *aligned_size = (size + *offset + mask) & ~mask; 91 *aligned_size = (size + *offset + mask) & ~mask;
91 } 92 }
92 #endif 93 #endif
93 94
94 } // namespace base 95 } // namespace base
OLDNEW
« no previous file with comments | « base/files/memory_mapped_file.h ('k') | base/files/memory_mapped_file_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698