diff options
author | rdsmith <rdsmith@chromium.org> | 2015-05-29 08:01:30 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-29 15:01:50 +0000 |
commit | d6ee164bd88916df1c65eeee3a9ecc508246e625 (patch) | |
tree | 983671e185fd478df51b69e87d82386b3a7a834c /net/sdch | |
parent | 8593e1698184b2ec3146b90212bad54e38b03217 (diff) | |
download | chromium_src-d6ee164bd88916df1c65eeee3a9ecc508246e625.zip chromium_src-d6ee164bd88916df1c65eeee3a9ecc508246e625.tar.gz chromium_src-d6ee164bd88916df1c65eeee3a9ecc508246e625.tar.bz2 |
Revert debugging put in place for issue 454198.
BUG=454198
R=ellyjones@chromium.org
Review URL: https://codereview.chromium.org/1150143004
Cr-Commit-Position: refs/heads/master@{#331969}
Diffstat (limited to 'net/sdch')
-rw-r--r-- | net/sdch/sdch_owner.cc | 68 | ||||
-rw-r--r-- | net/sdch/sdch_owner.h | 11 |
2 files changed, 6 insertions, 73 deletions
diff --git a/net/sdch/sdch_owner.cc b/net/sdch/sdch_owner.cc index a3ef30e..b073af8 100644 --- a/net/sdch/sdch_owner.cc +++ b/net/sdch/sdch_owner.cc @@ -243,16 +243,12 @@ void SdchOwner::RecordDictionaryEvictionOrUnload(const std::string& server_hash, } SdchOwner::SdchOwner(SdchManager* sdch_manager, URLRequestContext* context) - : manager_(sdch_manager->GetWeakPtr()), + : manager_(sdch_manager), fetcher_(new SdchDictionaryFetcher(context)), total_dictionary_bytes_(0), clock_(new base::DefaultClock), max_total_dictionary_size_(kMaxTotalDictionarySize), min_space_for_dictionary_fetch_(kMinSpaceForDictionaryFetch), -#if defined(OS_CHROMEOS) - // For debugging http://crbug.com/454198; remove when resolved. - destroyed_(0), -#endif memory_pressure_listener_( base::Bind(&SdchOwner::OnMemoryPressure, // Because |memory_pressure_listener_| is owned by @@ -263,22 +259,11 @@ SdchOwner::SdchOwner(SdchManager* sdch_manager, URLRequestContext* context) external_pref_store_(nullptr), pref_store_(in_memory_pref_store_.get()), creation_time_(clock_->Now()) { -#if defined(OS_CHROMEOS) - // For debugging http://crbug.com/454198; remove when resolved. - CHECK(clock_.get()); -#endif manager_->AddObserver(this); InitializePrefStore(pref_store_); } SdchOwner::~SdchOwner() { -#if defined(OS_CHROMEOS) - // For debugging http://crbug.com/454198; remove when resolved. - CHECK_EQ(0u, destroyed_); - CHECK(clock_.get()); - CHECK(manager_.get()); -#endif - for (DictionaryPreferenceIterator it(pref_store_); !it.IsAtEnd(); it.Advance()) { int new_uses = it.use_count() - use_counts_at_load_[it.server_hash()]; @@ -306,9 +291,6 @@ SdchOwner::~SdchOwner() { } } -#if defined(OS_CHROMEOS) - destroyed_ = 0xdeadbeef; -#endif } void SdchOwner::EnablePersistentStorage(PersistentPrefStore* pref_store) { @@ -357,12 +339,6 @@ void SdchOwner::OnDictionaryFetched(base::Time last_used, } }; -#if defined(OS_CHROMEOS) - // For debugging http://crbug.com/454198; remove when resolved. - CHECK_EQ(0u, destroyed_); - CHECK(clock_.get()); -#endif - if (!was_from_cache) UMA_HISTOGRAM_COUNTS("Sdch3.NetworkBytesSpent", dictionary_text.size()); @@ -390,12 +366,6 @@ void SdchOwner::OnDictionaryFetched(base::Time last_used, } } -#if defined(OS_CHROMEOS) - // For debugging http://crbug.com/454198; remove when resolved. - CHECK_EQ(0u, destroyed_); - CHECK(clock_.get()); -#endif - if (total_dictionary_bytes_ + dictionary_text.size() - recoverable_bytes > max_total_dictionary_size_) { RecordDictionaryFate(DICTIONARY_FATE_FETCH_IGNORED_NO_SPACE); @@ -465,12 +435,6 @@ void SdchOwner::OnDictionaryFetched(base::Time last_used, total_dictionary_bytes_ += dictionary_text.size(); -#if defined(OS_CHROMEOS) - // For debugging http://crbug.com/454198; remove when resolved. - CHECK_EQ(0u, destroyed_); - CHECK(clock_.get()); -#endif - // Record the addition in the pref store. scoped_ptr<base::DictionaryValue> dictionary_description( new base::DictionaryValue()); @@ -507,22 +471,16 @@ void SdchOwner::OnDictionaryUsed(const std::string& server_hash) { } base::DictionaryValue* specific_dictionary_map = nullptr; success = value->GetAsDictionary(&specific_dictionary_map); - // TODO(rdsmith); Switch back to DCHECK() after http://crbug.com/454198 is - // resolved. - CHECK(success); + DCHECK(success); double last_used_seconds_since_epoch = 0.0; success = specific_dictionary_map->GetDouble(kDictionaryLastUsedKey, &last_used_seconds_since_epoch); - // TODO(rdsmith); Switch back to DCHECK() after http://crbug.com/454198 is - // resolved. - CHECK(success); + DCHECK(success); int use_count = 0; success = specific_dictionary_map->GetInteger(kDictionaryUseCountKey, &use_count); - // TODO(rdsmith); Switch back to DCHECK() after http://crbug.com/454198 is - // resolved. - CHECK(success); + DCHECK(success); if (use_counts_at_load_.count(server_hash) == 0) { use_counts_at_load_[server_hash] = use_count; @@ -544,18 +502,6 @@ void SdchOwner::OnDictionaryUsed(const std::string& server_hash) { void SdchOwner::OnGetDictionary(const GURL& request_url, const GURL& dictionary_url) { -#if defined(OS_CHROMEOS) - // For debugging http://crbug.com/454198; remove when resolved. - char url_buf[128]; - if (0u != destroyed_ || !clock_.get()) { - base::strlcpy(url_buf, request_url.spec().c_str(), arraysize(url_buf)); - } - base::debug::Alias(url_buf); - - CHECK_EQ(0u, destroyed_); - CHECK(clock_.get()); -#endif - base::Time stale_boundary(clock_->Now() - base::TimeDelta::FromDays(1)); size_t avail_bytes = 0; for (DictionaryPreferenceIterator it(pref_store_); !it.IsAtEnd(); @@ -679,12 +625,6 @@ void SdchOwner::OnInitializationCompleted(bool succeeded) { void SdchOwner::SetClockForTesting(scoped_ptr<base::Clock> clock) { clock_ = clock.Pass(); - -#if defined(OS_CHROMEOS) - // For debugging http://crbug.com/454198; remove when resolved. - CHECK_EQ(0u, destroyed_); - CHECK(clock_.get()); -#endif } int SdchOwner::GetDictionaryCountForTesting() const { diff --git a/net/sdch/sdch_owner.h b/net/sdch/sdch_owner.h index ec5d82d..3d6b59b 100644 --- a/net/sdch/sdch_owner.h +++ b/net/sdch/sdch_owner.h @@ -10,7 +10,6 @@ #include "base/memory/memory_pressure_listener.h" #include "base/memory/ref_counted.h" -#include "base/memory/weak_ptr.h" #include "base/prefs/pref_store.h" #include "net/base/sdch_observer.h" #include "net/url_request/sdch_dictionary_fetcher.h" @@ -162,9 +161,8 @@ class NET_EXPORT SdchOwner : public SdchObserver, public PrefStore::Observer { size_t size, int use_count, DictionaryFate fate); - // For investigation of http://crbug.com/454198; remove when resolved. - base::WeakPtr<SdchManager> manager_; - scoped_ptr<SdchDictionaryFetcher> fetcher_; + net::SdchManager* manager_; + scoped_ptr<net::SdchDictionaryFetcher> fetcher_; size_t total_dictionary_bytes_; @@ -173,11 +171,6 @@ class NET_EXPORT SdchOwner : public SdchObserver, public PrefStore::Observer { size_t max_total_dictionary_size_; size_t min_space_for_dictionary_fetch_; -#if defined(OS_CHROMEOS) - // For debugging http://crbug.com/454198; remove when resolved. - unsigned int destroyed_; -#endif - base::MemoryPressureListener memory_pressure_listener_; // Dictionary persistence machinery. |