| 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 10 matching lines...) Expand all Loading... |
| 21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 22 #include "base/timer/timer.h" | 22 #include "base/timer/timer.h" |
| 23 #include "net/base/cache_type.h" | 23 #include "net/base/cache_type.h" |
| 24 #include "net/base/completion_callback.h" | 24 #include "net/base/completion_callback.h" |
| 25 #include "net/base/net_export.h" | 25 #include "net/base/net_export.h" |
| 26 | 26 |
| 27 #if defined(OS_ANDROID) | 27 #if defined(OS_ANDROID) |
| 28 #include "base/android/application_status_listener.h" | 28 #include "base/android/application_status_listener.h" |
| 29 #endif | 29 #endif |
| 30 | 30 |
| 31 namespace base { |
| 31 class Pickle; | 32 class Pickle; |
| 32 class PickleIterator; | 33 class PickleIterator; |
| 34 } // namespace base |
| 33 | 35 |
| 34 namespace disk_cache { | 36 namespace disk_cache { |
| 35 | 37 |
| 36 class SimpleIndexDelegate; | 38 class SimpleIndexDelegate; |
| 37 class SimpleIndexFile; | 39 class SimpleIndexFile; |
| 38 struct SimpleIndexLoadResult; | 40 struct SimpleIndexLoadResult; |
| 39 | 41 |
| 40 class NET_EXPORT_PRIVATE EntryMetadata { | 42 class NET_EXPORT_PRIVATE EntryMetadata { |
| 41 public: | 43 public: |
| 42 EntryMetadata(); | 44 EntryMetadata(); |
| 43 EntryMetadata(base::Time last_used_time, uint64 entry_size); | 45 EntryMetadata(base::Time last_used_time, uint64 entry_size); |
| 44 | 46 |
| 45 base::Time GetLastUsedTime() const; | 47 base::Time GetLastUsedTime() const; |
| 46 void SetLastUsedTime(const base::Time& last_used_time); | 48 void SetLastUsedTime(const base::Time& last_used_time); |
| 47 | 49 |
| 48 uint64 GetEntrySize() const; | 50 uint64 GetEntrySize() const; |
| 49 void SetEntrySize(uint64 entry_size); | 51 void SetEntrySize(uint64 entry_size); |
| 50 | 52 |
| 51 // Serialize the data into the provided pickle. | 53 // Serialize the data into the provided pickle. |
| 52 void Serialize(Pickle* pickle) const; | 54 void Serialize(base::Pickle* pickle) const; |
| 53 bool Deserialize(PickleIterator* it); | 55 bool Deserialize(base::PickleIterator* it); |
| 54 | 56 |
| 55 static base::TimeDelta GetLowerEpsilonForTimeComparisons() { | 57 static base::TimeDelta GetLowerEpsilonForTimeComparisons() { |
| 56 return base::TimeDelta::FromSeconds(1); | 58 return base::TimeDelta::FromSeconds(1); |
| 57 } | 59 } |
| 58 static base::TimeDelta GetUpperEpsilonForTimeComparisons() { | 60 static base::TimeDelta GetUpperEpsilonForTimeComparisons() { |
| 59 return base::TimeDelta(); | 61 return base::TimeDelta(); |
| 60 } | 62 } |
| 61 | 63 |
| 62 private: | 64 private: |
| 63 friend class SimpleIndexFileTest; | 65 friend class SimpleIndexFileTest; |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 195 |
| 194 // Set to true when the app is on the background. When the app is in the | 196 // 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 | 197 // background we can write the index much more frequently, to insure fresh |
| 196 // index on next startup. | 198 // index on next startup. |
| 197 bool app_on_background_; | 199 bool app_on_background_; |
| 198 }; | 200 }; |
| 199 | 201 |
| 200 } // namespace disk_cache | 202 } // namespace disk_cache |
| 201 | 203 |
| 202 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ | 204 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ |
| OLD | NEW |