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

Unified Diff: net/disk_cache/simple/simple_entry_impl.h

Issue 2807433002: SimpleCache: synchronously reply on reads from idle if data is in memory.
Patch Set: Use the proper limit for the barrier. Created 3 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/entry_unittest.cc ('k') | net/disk_cache/simple/simple_entry_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_entry_impl.h
diff --git a/net/disk_cache/simple/simple_entry_impl.h b/net/disk_cache/simple/simple_entry_impl.h
index e3ebe51a6d0bcfe2aa6ef3a04416ac54475c08f8..d79bc1ebc35d6bcbbdef1c7ffa57f8ef5e5e10ff 100644
--- a/net/disk_cache/simple/simple_entry_impl.h
+++ b/net/disk_cache/simple/simple_entry_impl.h
@@ -195,11 +195,12 @@ class NET_EXPORT_PRIVATE SimpleEntryImpl : public Entry,
void CloseInternal();
- void ReadDataInternal(int index,
- int offset,
- net::IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback);
+ int ReadDataInternal(bool sync_possible,
+ int index,
+ int offset,
+ net::IOBuffer* buf,
+ int buf_len,
+ const CompletionCallback& callback);
void WriteDataInternal(int index,
int offset,
@@ -305,13 +306,13 @@ class NET_EXPORT_PRIVATE SimpleEntryImpl : public Entry,
void RecordWriteDependencyType(const SimpleEntryOperation& operation) const;
// Completes a read from the stream data kept in memory, logging metrics
- // and updating metadata. If |callback| is non-null, it will be posted to the
- // current task runner with the return code.
- void ReadFromBufferAndPostReply(net::GrowableIOBuffer* in_buf,
- int offset,
- int buf_len,
- net::IOBuffer* out_buf,
- const CompletionCallback& callback);
+ // and updating metadata. Returns the # of bytes read successfully.
+ // This asumes the caller has already range-checked offset and buf_len
+ // appropriately.
+ int ReadFromBuffer(net::GrowableIOBuffer* in_buf,
+ int offset,
+ int buf_len,
+ net::IOBuffer* out_buf);
// Copies data from |buf| to the internal in-memory buffer for stream 0. If
// |truncate| is set to true, the target buffer will be truncated at |offset|
« no previous file with comments | « net/disk_cache/entry_unittest.cc ('k') | net/disk_cache/simple/simple_entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698