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 3 // found in the LICENSE file. 4 5 #ifndef NET_DISK_CACHE_FLASH_STORAGE_H_ 6 #define NET_DISK_CACHE_FLASH_STORAGE_H_ 7 8 #include "base/basictypes.h" 9 #include "base/platform_file.h" 10 #include "net/base/net_export.h" 11 12 namespace disk_cache { 13 14 class NET_EXPORT_PRIVATE Storage { 15 public: 16 Storage(const base::FilePath& path, int32 size); 17 bool Init(); 18 ~Storage(); 19 20 int32 size() const { return size_; } 21 22 bool Read(void* buffer, int32 size, int32 offset); 23 bool Write(const void* buffer, int32 size, int32 offset); 24 25 private: 26 base::FilePath path_; 27 int32 size_; 28 base::PlatformFile file_; 29 30 DISALLOW_COPY_AND_ASSIGN(Storage); 31 }; 32 33 } // namespace disk_cache 34 35 #endif // NET_DISK_CACHE_FLASH_STORAGE_H_ 36