| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/sdch/sdch_owner.h" | 5 #include "net/sdch/sdch_owner.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/alias.h" | 8 #include "base/debug/alias.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 dictionary_description->SetString(kDictionaryUrlKey, dictionary_url.spec()); | 477 dictionary_description->SetString(kDictionaryUrlKey, dictionary_url.spec()); |
| 478 dictionary_description->SetDouble(kDictionaryLastUsedKey, | 478 dictionary_description->SetDouble(kDictionaryLastUsedKey, |
| 479 last_used.ToDoubleT()); | 479 last_used.ToDoubleT()); |
| 480 dictionary_description->SetInteger(kDictionaryUseCountKey, use_count); | 480 dictionary_description->SetInteger(kDictionaryUseCountKey, use_count); |
| 481 dictionary_description->SetInteger(kDictionarySizeKey, | 481 dictionary_description->SetInteger(kDictionarySizeKey, |
| 482 dictionary_text.size()); | 482 dictionary_text.size()); |
| 483 pref_dictionary_map->Set(server_hash, dictionary_description.Pass()); | 483 pref_dictionary_map->Set(server_hash, dictionary_description.Pass()); |
| 484 load_times_[server_hash] = clock_->Now(); | 484 load_times_[server_hash] = clock_->Now(); |
| 485 } | 485 } |
| 486 | 486 |
| 487 void SdchOwner::OnDictionaryAdded(SdchManager* manager, |
| 488 const GURL& dictionary_url, |
| 489 const std::string& server_hash) { |
| 490 } |
| 491 |
| 492 void SdchOwner::OnDictionaryRemoved(SdchManager* manager, |
| 493 const std::string& server_hash) { |
| 494 } |
| 495 |
| 487 void SdchOwner::OnDictionaryUsed(SdchManager* manager, | 496 void SdchOwner::OnDictionaryUsed(SdchManager* manager, |
| 488 const std::string& server_hash) { | 497 const std::string& server_hash) { |
| 489 base::Time now(clock_->Now()); | 498 base::Time now(clock_->Now()); |
| 490 base::DictionaryValue* pref_dictionary_map = | 499 base::DictionaryValue* pref_dictionary_map = |
| 491 GetPersistentStoreDictionaryMap(pref_store_); | 500 GetPersistentStoreDictionaryMap(pref_store_); |
| 492 ScopedPrefNotifier scoped_pref_notifier(pref_store_); | 501 ScopedPrefNotifier scoped_pref_notifier(pref_store_); |
| 493 | 502 |
| 494 base::Value* value = nullptr; | 503 base::Value* value = nullptr; |
| 495 bool success = pref_dictionary_map->Get(server_hash, &value); | 504 bool success = pref_dictionary_map->Get(server_hash, &value); |
| 496 if (!success) { | 505 if (!success) { |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 } | 781 } |
| 773 | 782 |
| 774 return true; | 783 return true; |
| 775 } | 784 } |
| 776 | 785 |
| 777 bool SdchOwner::IsPersistingDictionaries() const { | 786 bool SdchOwner::IsPersistingDictionaries() const { |
| 778 return in_memory_pref_store_.get() != nullptr; | 787 return in_memory_pref_store_.get() != nullptr; |
| 779 } | 788 } |
| 780 | 789 |
| 781 } // namespace net | 790 } // namespace net |
| OLD | NEW |