summaryrefslogtreecommitdiffstats
path: root/net/http/http_vary_data.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/http/http_vary_data.cc')
-rw-r--r--net/http/http_vary_data.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/http/http_vary_data.cc b/net/http/http_vary_data.cc
index 765ff11..fa7a325 100644
--- a/net/http/http_vary_data.cc
+++ b/net/http/http_vary_data.cc
@@ -15,7 +15,6 @@
namespace net {
HttpVaryData::HttpVaryData() : is_valid_(false) {
- memset(&request_digest_, 0, sizeof(request_digest_));
}
bool HttpVaryData::Init(const HttpRequestInfo& request_info,
@@ -23,6 +22,7 @@ bool HttpVaryData::Init(const HttpRequestInfo& request_info,
MD5Context ctx;
MD5Init(&ctx);
+ is_valid_ = false;
bool processed_header = false;
// Feed the MD5 context in the order of the Vary header enumeration. If the
@@ -64,6 +64,7 @@ bool HttpVaryData::Init(const HttpRequestInfo& request_info,
}
bool HttpVaryData::InitFromPickle(const Pickle& pickle, void** iter) {
+ is_valid_ = false;
const char* data;
if (pickle.ReadBytes(iter, &data, sizeof(request_digest_))) {
memcpy(&request_digest_, data, sizeof(request_digest_));
@@ -73,6 +74,7 @@ bool HttpVaryData::InitFromPickle(const Pickle& pickle, void** iter) {
}
void HttpVaryData::Persist(Pickle* pickle) const {
+ DCHECK(is_valid());
pickle->WriteBytes(&request_digest_, sizeof(request_digest_));
}