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

Unified Diff: net/disk_cache/blockfile/mapped_file.h

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 | « net/disk_cache/blockfile/index_table_v3_unittest.cc ('k') | net/disk_cache/blockfile/mapped_file.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/blockfile/mapped_file.h
diff --git a/net/disk_cache/blockfile/mapped_file.h b/net/disk_cache/blockfile/mapped_file.h
deleted file mode 100644
index 7634cb70f46dfe7aa0cc0c7c754f47ee3f15c93b..0000000000000000000000000000000000000000
--- a/net/disk_cache/blockfile/mapped_file.h
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// See net/disk_cache/disk_cache.h for the public interface of the cache.
-
-#ifndef NET_DISK_CACHE_BLOCKFILE_MAPPED_FILE_H_
-#define NET_DISK_CACHE_BLOCKFILE_MAPPED_FILE_H_
-
-#include "net/base/net_export.h"
-#include "net/disk_cache/blockfile/file.h"
-#include "net/disk_cache/blockfile/file_block.h"
-
-namespace base {
-class FilePath;
-}
-
-namespace disk_cache {
-
-// This class implements a memory mapped file used to access block-files. The
-// idea is that the header and bitmap will be memory mapped all the time, and
-// the actual data for the blocks will be access asynchronously (most of the
-// time).
-class NET_EXPORT_PRIVATE MappedFile : public File {
- public:
- MappedFile() : File(true), init_(false) {}
-
- // Performs object initialization. name is the file to use, and size is the
- // amount of data to memory map from the file. If size is 0, the whole file
- // will be mapped in memory.
- void* Init(const base::FilePath& name, size_t size);
-
- void* buffer() const {
- return buffer_;
- }
-
- // Loads or stores a given block from the backing file (synchronously).
- bool Load(const FileBlock* block);
- bool Store(const FileBlock* block);
-
- // Asynchronous versions of Load/Store, following the semantics of File::Read
- // and File::Write.
- bool Load(const FileBlock* block, FileIOCallback* callback, bool* completed);
- bool Store(const FileBlock* block, FileIOCallback* callback, bool* completed);
-
- // Flush the memory-mapped section to disk (synchronously).
- void Flush();
-
- // Heats up the file system cache and make sure the file is fully
- // readable (synchronously).
- bool Preload();
-
- private:
- ~MappedFile() override;
-
- bool init_;
-#if defined(OS_WIN)
- HANDLE section_;
-#endif
- void* buffer_; // Address of the memory mapped buffer.
- size_t view_size_; // Size of the memory pointed by buffer_.
-#if defined(POSIX_AVOID_MMAP)
- void* snapshot_; // Copy of the buffer taken when it was last flushed.
-#endif
-
- DISALLOW_COPY_AND_ASSIGN(MappedFile);
-};
-
-// Helper class for calling Flush() on exit from the current scope.
-class ScopedFlush {
- public:
- explicit ScopedFlush(MappedFile* file) : file_(file) {}
- ~ScopedFlush() {
- file_->Flush();
- }
- private:
- MappedFile* file_;
-};
-
-} // namespace disk_cache
-
-#endif // NET_DISK_CACHE_BLOCKFILE_MAPPED_FILE_H_
« no previous file with comments | « net/disk_cache/blockfile/index_table_v3_unittest.cc ('k') | net/disk_cache/blockfile/mapped_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698