| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/debug/alias.h" | 10 #include "base/debug/alias.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
| 14 #include "base/metrics/histogram_macros.h" | 14 #include "base/metrics/histogram_macros.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "base/time/default_clock.h" | 16 #include "base/time/default_clock.h" |
| 17 #include "base/values.h" | 17 #include "base/values.h" |
| 18 #include "net/base/sdch_manager.h" | 18 #include "net/base/sdch_manager.h" |
| 19 #include "net/base/sdch_net_log_params.h" | 19 #include "net/base/sdch_net_log_params.h" |
| 20 #include "net/log/net_log_event_type.h" | 20 #include "net/log/net_log_event_type.h" |
| 21 #include "net/log/net_log_with_source.h" |
| 21 | 22 |
| 22 namespace net { | 23 namespace net { |
| 23 | 24 |
| 24 namespace { | 25 namespace { |
| 25 | 26 |
| 26 // Dictionaries that haven't been touched in 24 hours may be evicted | 27 // Dictionaries that haven't been touched in 24 hours may be evicted |
| 27 // to make room for new dictionaries. | 28 // to make room for new dictionaries. |
| 28 const int kFreshnessLifetimeHours = 24; | 29 const int kFreshnessLifetimeHours = 24; |
| 29 | 30 |
| 30 // Dictionaries that have never been used only stay fresh for one hour. | 31 // Dictionaries that have never been used only stay fresh for one hour. |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 } | 740 } |
| 740 | 741 |
| 741 return true; | 742 return true; |
| 742 } | 743 } |
| 743 | 744 |
| 744 bool SdchOwner::IsPersistingDictionaries() const { | 745 bool SdchOwner::IsPersistingDictionaries() const { |
| 745 return in_memory_pref_store_.get() != nullptr; | 746 return in_memory_pref_store_.get() != nullptr; |
| 746 } | 747 } |
| 747 | 748 |
| 748 } // namespace net | 749 } // namespace net |
| OLD | NEW |