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

Side by Side Diff: base/memory/discardable_memory_ashmem_allocator.cc

Issue 468253002: Move file_util to base/files/ directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Forgot to add forwarding header to patch Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/mac/mac_util_unittest.mm ('k') | base/memory/shared_memory.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/memory/discardable_memory_ashmem_allocator.h" 5 #include "base/memory/discardable_memory_ashmem_allocator.h"
6 6
7 #include <sys/mman.h> 7 #include <sys/mman.h>
8 #include <unistd.h> 8 #include <unistd.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
11 #include <cmath> 11 #include <cmath>
12 #include <limits> 12 #include <limits>
13 #include <set> 13 #include <set>
14 #include <utility> 14 #include <utility>
15 15
16 #include "base/basictypes.h" 16 #include "base/basictypes.h"
17 #include "base/containers/hash_tables.h" 17 #include "base/containers/hash_tables.h"
18 #include "base/file_util.h" 18 #include "base/files/file_util.h"
19 #include "base/files/scoped_file.h" 19 #include "base/files/scoped_file.h"
20 #include "base/logging.h" 20 #include "base/logging.h"
21 #include "base/memory/scoped_vector.h" 21 #include "base/memory/scoped_vector.h"
22 #include "third_party/ashmem/ashmem.h" 22 #include "third_party/ashmem/ashmem.h"
23 23
24 // The allocator consists of three parts (classes): 24 // The allocator consists of three parts (classes):
25 // - DiscardableMemoryAshmemAllocator: entry point of all allocations (through 25 // - DiscardableMemoryAshmemAllocator: entry point of all allocations (through
26 // its Allocate() method) that are dispatched to the AshmemRegion instances 26 // its Allocate() method) that are dispatched to the AshmemRegion instances
27 // (which it owns). 27 // (which it owns).
28 // - AshmemRegion: manages allocations and destructions inside a single large 28 // - AshmemRegion: manages allocations and destructions inside a single large
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 DCHECK_LE(ashmem_regions_.size(), 5U); 519 DCHECK_LE(ashmem_regions_.size(), 5U);
520 const ScopedVector<AshmemRegion>::iterator it = std::find( 520 const ScopedVector<AshmemRegion>::iterator it = std::find(
521 ashmem_regions_.begin(), ashmem_regions_.end(), region); 521 ashmem_regions_.begin(), ashmem_regions_.end(), region);
522 DCHECK(ashmem_regions_.end() != it); 522 DCHECK(ashmem_regions_.end() != it);
523 std::swap(*it, ashmem_regions_.back()); 523 std::swap(*it, ashmem_regions_.back());
524 ashmem_regions_.pop_back(); 524 ashmem_regions_.pop_back();
525 } 525 }
526 526
527 } // namespace internal 527 } // namespace internal
528 } // namespace base 528 } // namespace base
OLDNEW
« no previous file with comments | « base/mac/mac_util_unittest.mm ('k') | base/memory/shared_memory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698