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

Unified Diff: net/http/disk_cache_based_quic_server_info.cc

Issue 427313002: Persist the server config that is received via kSCUP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Keep disk cache entry open for multiple writes Created 6 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 | « no previous file | net/quic/quic_crypto_client_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/disk_cache_based_quic_server_info.cc
diff --git a/net/http/disk_cache_based_quic_server_info.cc b/net/http/disk_cache_based_quic_server_info.cc
index 51fba2164b7862c576101902fb5be4304cc29926..13c53b7f2679bad8478ae2ccf4aebe0f38740244 100644
--- a/net/http/disk_cache_based_quic_server_info.cc
+++ b/net/http/disk_cache_based_quic_server_info.cc
@@ -213,7 +213,9 @@ int DiskCacheBasedQuicServerInfo::DoReadComplete(int rv) {
}
int DiskCacheBasedQuicServerInfo::DoWriteComplete(int rv) {
- state_ = SET_DONE;
+ // Keep the entry open for future writes.
+ new_data_.clear();
+ state_ = NONE;
return OK;
}
@@ -221,7 +223,8 @@ int DiskCacheBasedQuicServerInfo::DoCreateOrOpenComplete(int rv) {
if (rv != OK) {
state_ = SET_DONE;
} else {
- entry_ = data_shim_->entry;
+ if (!entry_)
+ entry_ = data_shim_->entry;
rjshade 2014/09/18 19:42:51 Chromium style guide doesn't require {} around sin
Ryan Hamilton 2014/09/18 19:52:52 Nope; Chrome's unofficial net/ style guide prohibi
state_ = WRITE;
}
return OK;
@@ -264,8 +267,10 @@ int DiskCacheBasedQuicServerInfo::DoWrite() {
}
int DiskCacheBasedQuicServerInfo::DoCreateOrOpen() {
- DCHECK(entry_ == NULL);
state_ = CREATE_OR_OPEN_COMPLETE;
+ if (entry_)
+ return OK;
+
if (found_entry_) {
return backend_->OpenEntry(key(), &data_shim_->entry, io_callback_);
}
« no previous file with comments | « no previous file | net/quic/quic_crypto_client_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698