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

Side by Side Diff: net/disk_cache/simple/simple_entry_impl.h

Issue 1977863003: SimpleCache: open with fewer seeks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@open-speeder-macbetter
Patch Set: actually fix test Created 4 years, 7 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/simple/simple_entry_format.h ('k') | net/disk_cache/simple/simple_entry_impl.cc » ('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) 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_ENTRY_IMPL_H_ 5 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_
6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_ 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 int OpenEntry(Entry** entry, const CompletionCallback& callback); 72 int OpenEntry(Entry** entry, const CompletionCallback& callback);
73 73
74 // Creates this entry, if possible. Returns |this| to |entry|. 74 // Creates this entry, if possible. Returns |this| to |entry|.
75 int CreateEntry(Entry** entry, const CompletionCallback& callback); 75 int CreateEntry(Entry** entry, const CompletionCallback& callback);
76 76
77 // Identical to Backend::Doom() except that it accepts a CompletionCallback. 77 // Identical to Backend::Doom() except that it accepts a CompletionCallback.
78 int DoomEntry(const CompletionCallback& callback); 78 int DoomEntry(const CompletionCallback& callback);
79 79
80 const std::string& key() const { return key_; } 80 const std::string& key() const { return key_; }
81 uint64_t entry_hash() const { return entry_hash_; } 81 uint64_t entry_hash() const { return entry_hash_; }
82
83 // The key is not a constructor parameter to the SimpleEntryImpl, because
84 // during cache iteration, it's necessary to open entries by their hash
85 // alone. In that case, the SimpleSynchronousEntry will read the key from disk
86 // and it will be set.
82 void SetKey(const std::string& key); 87 void SetKey(const std::string& key);
83 88
84 // From Entry: 89 // From Entry:
85 void Doom() override; 90 void Doom() override;
86 void Close() override; 91 void Close() override;
87 std::string GetKey() const override; 92 std::string GetKey() const override;
88 base::Time GetLastUsed() const override; 93 base::Time GetLastUsed() const override;
89 base::Time GetLastModified() const override; 94 base::Time GetLastModified() const override;
90 int32_t GetDataSize(int index) const override; 95 int32_t GetDataSize(int index) const override;
91 int ReadData(int stream_index, 96 int ReadData(int stream_index,
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 // 1 on disk, to reduce the number of file descriptors and save disk space. 380 // 1 on disk, to reduce the number of file descriptors and save disk space.
376 // This strategy allows stream 1 to change size easily. Since stream 0 is only 381 // This strategy allows stream 1 to change size easily. Since stream 0 is only
377 // used to write HTTP headers, the memory consumption of keeping it in memory 382 // used to write HTTP headers, the memory consumption of keeping it in memory
378 // is acceptable. 383 // is acceptable.
379 scoped_refptr<net::GrowableIOBuffer> stream_0_data_; 384 scoped_refptr<net::GrowableIOBuffer> stream_0_data_;
380 }; 385 };
381 386
382 } // namespace disk_cache 387 } // namespace disk_cache
383 388
384 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_ 389 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_
OLDNEW
« no previous file with comments | « net/disk_cache/simple/simple_entry_format.h ('k') | net/disk_cache/simple/simple_entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698