| 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 #ifndef NET_SDCH_SDCH_OWNER_H_ | 5 #ifndef NET_SDCH_SDCH_OWNER_H_ |
| 6 #define NET_SDCH_SDCH_OWNER_H_ | 6 #define NET_SDCH_SDCH_OWNER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/memory_pressure_listener.h" | 11 #include "base/memory/memory_pressure_listener.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/weak_ptr.h" |
| 13 #include "base/prefs/pref_store.h" | 14 #include "base/prefs/pref_store.h" |
| 14 #include "net/base/sdch_observer.h" | 15 #include "net/base/sdch_observer.h" |
| 15 #include "net/url_request/sdch_dictionary_fetcher.h" | 16 #include "net/url_request/sdch_dictionary_fetcher.h" |
| 16 | 17 |
| 17 class GURL; | 18 class GURL; |
| 18 class PersistentPrefStore; | 19 class PersistentPrefStore; |
| 19 class ValueMapPrefStore; | 20 class ValueMapPrefStore; |
| 20 class WriteablePrefStore; | 21 class WriteablePrefStore; |
| 21 | 22 |
| 22 namespace base { | 23 namespace base { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 109 |
| 109 // Schedule loading of all dictionaries described in |persisted_info|. | 110 // Schedule loading of all dictionaries described in |persisted_info|. |
| 110 // Returns false and does not schedule a load if |persisted_info| has an | 111 // Returns false and does not schedule a load if |persisted_info| has an |
| 111 // unsupported version or no dictionaries key. Skips any dictionaries that are | 112 // unsupported version or no dictionaries key. Skips any dictionaries that are |
| 112 // malformed in |persisted_info|. | 113 // malformed in |persisted_info|. |
| 113 bool SchedulePersistedDictionaryLoads( | 114 bool SchedulePersistedDictionaryLoads( |
| 114 const base::DictionaryValue& persisted_info); | 115 const base::DictionaryValue& persisted_info); |
| 115 | 116 |
| 116 bool IsPersistingDictionaries() const; | 117 bool IsPersistingDictionaries() const; |
| 117 | 118 |
| 118 net::SdchManager* manager_; | 119 // For investigation of http://crbug.com/454198; remove when resolved. |
| 120 base::WeakPtr<net::SdchManager> manager_; |
| 119 scoped_ptr<net::SdchDictionaryFetcher> fetcher_; | 121 scoped_ptr<net::SdchDictionaryFetcher> fetcher_; |
| 120 | 122 |
| 121 size_t total_dictionary_bytes_; | 123 size_t total_dictionary_bytes_; |
| 122 | 124 |
| 123 scoped_ptr<base::Clock> clock_; | 125 scoped_ptr<base::Clock> clock_; |
| 124 | 126 |
| 125 size_t max_total_dictionary_size_; | 127 size_t max_total_dictionary_size_; |
| 126 size_t min_space_for_dictionary_fetch_; | 128 size_t min_space_for_dictionary_fetch_; |
| 127 | 129 |
| 128 #if defined(OS_CHROMEOS) | 130 #if defined(OS_CHROMEOS) |
| (...skipping 27 matching lines...) Expand all Loading... |
| 156 // since the UMA histogram for use counts is only supposed to be since last | 158 // since the UMA histogram for use counts is only supposed to be since last |
| 157 // load. | 159 // load. |
| 158 std::map<std::string, int> use_counts_at_load_; | 160 std::map<std::string, int> use_counts_at_load_; |
| 159 | 161 |
| 160 DISALLOW_COPY_AND_ASSIGN(SdchOwner); | 162 DISALLOW_COPY_AND_ASSIGN(SdchOwner); |
| 161 }; | 163 }; |
| 162 | 164 |
| 163 } // namespace net | 165 } // namespace net |
| 164 | 166 |
| 165 #endif // NET_SDCH_SDCH_OWNER_H_ | 167 #endif // NET_SDCH_SDCH_OWNER_H_ |
| OLD | NEW |