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; |
} |