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

Side by Side Diff: net/disk_cache/mapped_file.h

Issue 18834003: Revert "Updating the mapped_file_avoid_mmap_posix implementation." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | « net/disk_cache/disk_cache_test_util.cc ('k') | net/disk_cache/mapped_file_avoid_mmap_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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // See net/disk_cache/disk_cache.h for the public interface of the cache. 5 // See net/disk_cache/disk_cache.h for the public interface of the cache.
6 6
7 #ifndef NET_DISK_CACHE_MAPPED_FILE_H_ 7 #ifndef NET_DISK_CACHE_MAPPED_FILE_H_
8 #define NET_DISK_CACHE_MAPPED_FILE_H_ 8 #define NET_DISK_CACHE_MAPPED_FILE_H_
9 9
10 #include "net/base/net_export.h" 10 #include "net/base/net_export.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 private: 44 private:
45 virtual ~MappedFile(); 45 virtual ~MappedFile();
46 46
47 bool init_; 47 bool init_;
48 #if defined(OS_WIN) 48 #if defined(OS_WIN)
49 HANDLE section_; 49 HANDLE section_;
50 #endif 50 #endif
51 void* buffer_; // Address of the memory mapped buffer. 51 void* buffer_; // Address of the memory mapped buffer.
52 size_t view_size_; // Size of the memory pointed by buffer_. 52 size_t view_size_; // Size of the memory pointed by buffer_.
53 #if defined(POSIX_AVOID_MMAP)
54 void* snapshot_; // Copy of the buffer taken when it was last flushed.
55 #endif
53 56
54 DISALLOW_COPY_AND_ASSIGN(MappedFile); 57 DISALLOW_COPY_AND_ASSIGN(MappedFile);
55 }; 58 };
56 59
57 // Helper class for calling Flush() on exit from the current scope. 60 // Helper class for calling Flush() on exit from the current scope.
58 class ScopedFlush { 61 class ScopedFlush {
59 public: 62 public:
60 explicit ScopedFlush(MappedFile* file) : file_(file) {} 63 explicit ScopedFlush(MappedFile* file) : file_(file) {}
61 ~ScopedFlush() { 64 ~ScopedFlush() {
62 file_->Flush(); 65 file_->Flush();
63 } 66 }
64 private: 67 private:
65 MappedFile* file_; 68 MappedFile* file_;
66 }; 69 };
67 70
68 } // namespace disk_cache 71 } // namespace disk_cache
69 72
70 #endif // NET_DISK_CACHE_MAPPED_FILE_H_ 73 #endif // NET_DISK_CACHE_MAPPED_FILE_H_
OLDNEW
« no previous file with comments | « net/disk_cache/disk_cache_test_util.cc ('k') | net/disk_cache/mapped_file_avoid_mmap_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698