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

Unified Diff: net/sdch/sdch_owner.cc

Issue 998803003: Checks to enforce relative lifetimes for SdchManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated comments and fixed else clause. Created 5 years, 9 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 | « net/sdch/sdch_owner.h ('k') | net/url_request/url_request_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/sdch/sdch_owner.cc
diff --git a/net/sdch/sdch_owner.cc b/net/sdch/sdch_owner.cc
index c92e2c774b84629edc6cd6c02d59bf7a89a5f4d1..efabdb6af151ff1df884b7c95ed6a4a839147aee 100644
--- a/net/sdch/sdch_owner.cc
+++ b/net/sdch/sdch_owner.cc
@@ -267,7 +267,7 @@ const size_t SdchOwner::kMaxTotalDictionarySize = 20 * 1000 * 1000;
const size_t SdchOwner::kMinSpaceForDictionaryFetch = 50 * 1000;
SdchOwner::SdchOwner(SdchManager* sdch_manager, URLRequestContext* context)
- : manager_(sdch_manager),
+ : manager_(sdch_manager->GetWeakPtr()),
fetcher_(new SdchDictionaryFetcher(context)),
total_dictionary_bytes_(0),
clock_(new base::DefaultClock),
@@ -296,6 +296,7 @@ SdchOwner::~SdchOwner() {
CHECK_EQ(0u, destroyed_);
CHECK(clock_.get());
clock_.reset();
+ CHECK(manager_.get());
#endif
for (DictionaryPreferenceIterator it(pref_store_); !it.IsAtEnd();
« no previous file with comments | « net/sdch/sdch_owner.h ('k') | net/url_request/url_request_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698