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

Side by Side Diff: net/disk_cache/memory/mem_entry_impl.h

Issue 667923003: Standardize usage of virtual/override/final in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « net/disk_cache/memory/mem_backend_impl.cc ('k') | net/disk_cache/simple/simple_backend_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 void Doom() override;
91 virtual void Close() override; 91 void Close() override;
92 virtual std::string GetKey() const override; 92 std::string GetKey() const override;
93 virtual base::Time GetLastUsed() const override; 93 base::Time GetLastUsed() const override;
94 virtual base::Time GetLastModified() const override; 94 base::Time GetLastModified() const override;
95 virtual int32 GetDataSize(int index) const override; 95 int32 GetDataSize(int index) const override;
96 virtual int ReadData(int index, int offset, IOBuffer* buf, int buf_len, 96 int ReadData(int index,
97 const CompletionCallback& callback) override; 97 int offset,
98 virtual int WriteData(int index, int offset, IOBuffer* buf, int buf_len, 98 IOBuffer* buf,
99 const CompletionCallback& callback, 99 int buf_len,
100 bool truncate) override; 100 const CompletionCallback& callback) override;
101 virtual int ReadSparseData(int64 offset, IOBuffer* buf, int buf_len, 101 int WriteData(int index,
102 const CompletionCallback& callback) override; 102 int offset,
103 virtual int WriteSparseData(int64 offset, IOBuffer* buf, int buf_len, 103 IOBuffer* buf,
104 const CompletionCallback& callback) override; 104 int buf_len,
105 virtual int GetAvailableRange(int64 offset, int len, int64* start, 105 const CompletionCallback& callback,
106 const CompletionCallback& callback) override; 106 bool truncate) override;
107 virtual bool CouldBeSparse() const override; 107 int ReadSparseData(int64 offset,
108 virtual void CancelSparseIO() override {} 108 IOBuffer* buf,
109 virtual int ReadyForSparseIO(const CompletionCallback& callback) override; 109 int buf_len,
110 const CompletionCallback& callback) override;
111 int WriteSparseData(int64 offset,
112 IOBuffer* buf,
113 int buf_len,
114 const CompletionCallback& callback) override;
115 int GetAvailableRange(int64 offset,
116 int len,
117 int64* start,
118 const CompletionCallback& callback) override;
119 bool CouldBeSparse() const override;
120 void CancelSparseIO() override {}
121 int ReadyForSparseIO(const CompletionCallback& callback) override;
110 122
111 private: 123 private:
112 typedef base::hash_map<int, MemEntryImpl*> EntryMap; 124 typedef base::hash_map<int, MemEntryImpl*> EntryMap;
113 125
114 enum { 126 enum {
115 NUM_STREAMS = 3 127 NUM_STREAMS = 3
116 }; 128 };
117 129
118 virtual ~MemEntryImpl(); 130 ~MemEntryImpl() override;
119 131
120 // Do all the work for corresponding public functions. Implemented as 132 // Do all the work for corresponding public functions. Implemented as
121 // separate functions to make logging of results simpler. 133 // separate functions to make logging of results simpler.
122 int InternalReadData(int index, int offset, IOBuffer* buf, int buf_len); 134 int InternalReadData(int index, int offset, IOBuffer* buf, int buf_len);
123 int InternalWriteData(int index, int offset, IOBuffer* buf, int buf_len, 135 int InternalWriteData(int index, int offset, IOBuffer* buf, int buf_len,
124 bool truncate); 136 bool truncate);
125 int InternalReadSparseData(int64 offset, IOBuffer* buf, int buf_len); 137 int InternalReadSparseData(int64 offset, IOBuffer* buf, int buf_len);
126 int InternalWriteSparseData(int64 offset, IOBuffer* buf, int buf_len); 138 int InternalWriteSparseData(int64 offset, IOBuffer* buf, int buf_len);
127 139
128 // Old Entry interface. 140 // Old Entry interface.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 bool doomed_; // True if this entry was removed from the cache. 188 bool doomed_; // True if this entry was removed from the cache.
177 189
178 net::BoundNetLog net_log_; 190 net::BoundNetLog net_log_;
179 191
180 DISALLOW_COPY_AND_ASSIGN(MemEntryImpl); 192 DISALLOW_COPY_AND_ASSIGN(MemEntryImpl);
181 }; 193 };
182 194
183 } // namespace disk_cache 195 } // namespace disk_cache
184 196
185 #endif // NET_DISK_CACHE_MEMORY_MEM_ENTRY_IMPL_H_ 197 #endif // NET_DISK_CACHE_MEMORY_MEM_ENTRY_IMPL_H_
OLDNEW
« no previous file with comments | « net/disk_cache/memory/mem_backend_impl.cc ('k') | net/disk_cache/simple/simple_backend_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698