| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ | 5 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ |
| 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ | 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 int32 entry_size_; // Storage size in bytes. | 70 int32 entry_size_; // Storage size in bytes. |
| 71 }; | 71 }; |
| 72 COMPILE_ASSERT(sizeof(EntryMetadata) == 8, metadata_size); | 72 COMPILE_ASSERT(sizeof(EntryMetadata) == 8, metadata_size); |
| 73 | 73 |
| 74 // This class is not Thread-safe. | 74 // This class is not Thread-safe. |
| 75 class NET_EXPORT_PRIVATE SimpleIndex | 75 class NET_EXPORT_PRIVATE SimpleIndex |
| 76 : public base::SupportsWeakPtr<SimpleIndex> { | 76 : public base::SupportsWeakPtr<SimpleIndex> { |
| 77 public: | 77 public: |
| 78 typedef std::vector<uint64> HashList; | 78 typedef std::vector<uint64> HashList; |
| 79 | 79 |
| 80 SimpleIndex(base::SingleThreadTaskRunner* io_thread, | 80 SimpleIndex(const scoped_refptr<base::SingleThreadTaskRunner>& io_thread, |
| 81 SimpleIndexDelegate* delegate, | 81 SimpleIndexDelegate* delegate, |
| 82 net::CacheType cache_type, | 82 net::CacheType cache_type, |
| 83 scoped_ptr<SimpleIndexFile> simple_index_file); | 83 scoped_ptr<SimpleIndexFile> simple_index_file); |
| 84 | 84 |
| 85 virtual ~SimpleIndex(); | 85 virtual ~SimpleIndex(); |
| 86 | 86 |
| 87 void Initialize(base::Time cache_mtime); | 87 void Initialize(base::Time cache_mtime); |
| 88 | 88 |
| 89 bool SetMaxSize(int max_bytes); | 89 bool SetMaxSize(int max_bytes); |
| 90 int max_size() const { return max_size_; } | 90 int max_size() const { return max_size_; } |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 193 |
| 194 // Set to true when the app is on the background. When the app is in the | 194 // Set to true when the app is on the background. When the app is in the |
| 195 // background we can write the index much more frequently, to insure fresh | 195 // background we can write the index much more frequently, to insure fresh |
| 196 // index on next startup. | 196 // index on next startup. |
| 197 bool app_on_background_; | 197 bool app_on_background_; |
| 198 }; | 198 }; |
| 199 | 199 |
| 200 } // namespace disk_cache | 200 } // namespace disk_cache |
| 201 | 201 |
| 202 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ | 202 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ |
| OLD | NEW |