Chromium Code Reviews| 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_); |
| } |