| OLD | NEW |
| 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 #ifndef NET_DISK_CACHE_MEMORY_MEM_ENTRY_IMPL_H_ | 5 #ifndef NET_DISK_CACHE_MEMORY_MEM_ENTRY_IMPL_H_ |
| 6 #define NET_DISK_CACHE_MEMORY_MEM_ENTRY_IMPL_H_ | 6 #define NET_DISK_CACHE_MEMORY_MEM_ENTRY_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
| 9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 EntryType type() const { | 81 EntryType type() const { |
| 82 return parent_ ? kChildEntry : kParentEntry; | 82 return parent_ ? kChildEntry : kParentEntry; |
| 83 } | 83 } |
| 84 | 84 |
| 85 const net::BoundNetLog& net_log() { | 85 const net::BoundNetLog& net_log() { |
| 86 return net_log_; | 86 return net_log_; |
| 87 } | 87 } |
| 88 | 88 |
| 89 // Entry interface. | 89 // Entry interface. |
| 90 virtual void Doom() OVERRIDE; | 90 virtual void Doom() override; |
| 91 virtual void Close() OVERRIDE; | 91 virtual void Close() override; |
| 92 virtual std::string GetKey() const OVERRIDE; | 92 virtual std::string GetKey() const override; |
| 93 virtual base::Time GetLastUsed() const OVERRIDE; | 93 virtual base::Time GetLastUsed() const override; |
| 94 virtual base::Time GetLastModified() const OVERRIDE; | 94 virtual base::Time GetLastModified() const override; |
| 95 virtual int32 GetDataSize(int index) const OVERRIDE; | 95 virtual int32 GetDataSize(int index) const override; |
| 96 virtual int ReadData(int index, int offset, IOBuffer* buf, int buf_len, | 96 virtual int ReadData(int index, int offset, IOBuffer* buf, int buf_len, |
| 97 const CompletionCallback& callback) OVERRIDE; | 97 const CompletionCallback& callback) override; |
| 98 virtual int WriteData(int index, int offset, IOBuffer* buf, int buf_len, | 98 virtual int WriteData(int index, int offset, IOBuffer* buf, int buf_len, |
| 99 const CompletionCallback& callback, | 99 const CompletionCallback& callback, |
| 100 bool truncate) OVERRIDE; | 100 bool truncate) override; |
| 101 virtual int ReadSparseData(int64 offset, IOBuffer* buf, int buf_len, | 101 virtual int ReadSparseData(int64 offset, IOBuffer* buf, int buf_len, |
| 102 const CompletionCallback& callback) OVERRIDE; | 102 const CompletionCallback& callback) override; |
| 103 virtual int WriteSparseData(int64 offset, IOBuffer* buf, int buf_len, | 103 virtual int WriteSparseData(int64 offset, IOBuffer* buf, int buf_len, |
| 104 const CompletionCallback& callback) OVERRIDE; | 104 const CompletionCallback& callback) override; |
| 105 virtual int GetAvailableRange(int64 offset, int len, int64* start, | 105 virtual int GetAvailableRange(int64 offset, int len, int64* start, |
| 106 const CompletionCallback& callback) OVERRIDE; | 106 const CompletionCallback& callback) override; |
| 107 virtual bool CouldBeSparse() const OVERRIDE; | 107 virtual bool CouldBeSparse() const override; |
| 108 virtual void CancelSparseIO() OVERRIDE {} | 108 virtual void CancelSparseIO() override {} |
| 109 virtual int ReadyForSparseIO(const CompletionCallback& callback) OVERRIDE; | 109 virtual int ReadyForSparseIO(const CompletionCallback& callback) override; |
| 110 | 110 |
| 111 private: | 111 private: |
| 112 typedef base::hash_map<int, MemEntryImpl*> EntryMap; | 112 typedef base::hash_map<int, MemEntryImpl*> EntryMap; |
| 113 | 113 |
| 114 enum { | 114 enum { |
| 115 NUM_STREAMS = 3 | 115 NUM_STREAMS = 3 |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 virtual ~MemEntryImpl(); | 118 virtual ~MemEntryImpl(); |
| 119 | 119 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 bool doomed_; // True if this entry was removed from the cache. | 176 bool doomed_; // True if this entry was removed from the cache. |
| 177 | 177 |
| 178 net::BoundNetLog net_log_; | 178 net::BoundNetLog net_log_; |
| 179 | 179 |
| 180 DISALLOW_COPY_AND_ASSIGN(MemEntryImpl); | 180 DISALLOW_COPY_AND_ASSIGN(MemEntryImpl); |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 } // namespace disk_cache | 183 } // namespace disk_cache |
| 184 | 184 |
| 185 #endif // NET_DISK_CACHE_MEMORY_MEM_ENTRY_IMPL_H_ | 185 #endif // NET_DISK_CACHE_MEMORY_MEM_ENTRY_IMPL_H_ |
| OLD | NEW |