OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/base/sdch_manager.h" | 5 #include "net/base/sdch_manager.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 SdchManager::SdchManager() { | 252 SdchManager::SdchManager() { |
253 DCHECK(thread_checker_.CalledOnValidThread()); | 253 DCHECK(thread_checker_.CalledOnValidThread()); |
254 } | 254 } |
255 | 255 |
256 SdchManager::~SdchManager() { | 256 SdchManager::~SdchManager() { |
257 DCHECK(thread_checker_.CalledOnValidThread()); | 257 DCHECK(thread_checker_.CalledOnValidThread()); |
258 while (!dictionaries_.empty()) { | 258 while (!dictionaries_.empty()) { |
259 auto it = dictionaries_.begin(); | 259 auto it = dictionaries_.begin(); |
260 dictionaries_.erase(it->first); | 260 dictionaries_.erase(it->first); |
261 } | 261 } |
| 262 #if defined(OS_CHROMEOS) |
| 263 // For debugging http://crbug.com/454198; remove when resolved. |
| 264 |
| 265 // Explicitly confirm that we can't notify any observers anymore. |
| 266 CHECK(!observers_.might_have_observers()); |
| 267 #endif |
262 } | 268 } |
263 | 269 |
264 void SdchManager::ClearData() { | 270 void SdchManager::ClearData() { |
265 blacklisted_domains_.clear(); | 271 blacklisted_domains_.clear(); |
266 allow_latency_experiment_.clear(); | 272 allow_latency_experiment_.clear(); |
267 dictionaries_.clear(); | 273 dictionaries_.clear(); |
268 FOR_EACH_OBSERVER(SdchObserver, observers_, OnClearDictionaries(this)); | 274 FOR_EACH_OBSERVER(SdchObserver, observers_, OnClearDictionaries(this)); |
269 } | 275 } |
270 | 276 |
271 // static | 277 // static |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 entry_dict->SetInteger("tries", it->second.count); | 672 entry_dict->SetInteger("tries", it->second.count); |
667 entry_dict->SetInteger("reason", it->second.reason); | 673 entry_dict->SetInteger("reason", it->second.reason); |
668 entry_list->Append(entry_dict); | 674 entry_list->Append(entry_dict); |
669 } | 675 } |
670 value->Set("blacklisted", entry_list); | 676 value->Set("blacklisted", entry_list); |
671 | 677 |
672 return value; | 678 return value; |
673 } | 679 } |
674 | 680 |
675 } // namespace net | 681 } // namespace net |
OLD | NEW |