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

Unified Diff: net/http/disk_cache_based_quic_server_info.cc

Issue 154933003: Persist server's crypto config data to disk cache for 0-RTT (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update with TOT and handle multiple tabs loading same URL Created 6 years, 10 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
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 aa322ab3f08079a351377e9fe4c948a6a0c025bd..6a6b41c5dcf9f636004eed75478340345e002af1 100644
--- a/net/http/disk_cache_based_quic_server_info.cc
+++ b/net/http/disk_cache_based_quic_server_info.cc
@@ -76,7 +76,8 @@ int DiskCacheBasedQuicServerInfo::WaitForDataReady(
return OK;
if (!callback.is_null()) {
- DCHECK(user_callback_.is_null());
+ if (!user_callback_.is_null())
+ return ERR_INVALID_ARGUMENT;
wtc 2014/02/07 00:54:11 Nit: we may want to use a different error code. C
ramant (doing other things) 2014/02/07 20:30:51 If user_callback_ not null, then there is a pendin
user_callback_ = callback;
}
@@ -85,7 +86,7 @@ int DiskCacheBasedQuicServerInfo::WaitForDataReady(
void DiskCacheBasedQuicServerInfo::Persist() {
DCHECK(CalledOnValidThread());
- DCHECK(state_ != GET_BACKEND);
+ DCHECK_NE(state_, GET_BACKEND);
DCHECK(new_data_.empty());
CHECK(ready_);
@@ -111,6 +112,7 @@ std::string DiskCacheBasedQuicServerInfo::key() const {
void DiskCacheBasedQuicServerInfo::OnIOComplete(CacheOperationDataShim* unused,
int rv) {
+ DCHECK_NE(state_, NONE);
rv = DoLoop(rv);
if (rv != ERR_IO_PENDING && !user_callback_.is_null()) {
CompletionCallback callback = user_callback_;
@@ -199,6 +201,7 @@ int DiskCacheBasedQuicServerInfo::DoReadComplete(int rv) {
int DiskCacheBasedQuicServerInfo::DoWriteComplete(int rv) {
state_ = SET_DONE;
+ new_data_.clear();
wtc 2014/02/07 00:54:11 Another good place to do new_data_.clear() is in D
ramant (doing other things) 2014/02/07 20:30:51 Done.
return OK;
}

Powered by Google App Engine
This is Rietveld 408576698