| 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/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 RecordDictionaryFate(fate); | 56 RecordDictionaryFate(fate); |
| 57 } | 57 } |
| 58 | 58 |
| 59 } // namespace | 59 } // namespace |
| 60 | 60 |
| 61 namespace net { | 61 namespace net { |
| 62 | 62 |
| 63 // Adjust SDCH limits downwards for mobile. | 63 // Adjust SDCH limits downwards for mobile. |
| 64 #if defined(OS_ANDROID) || defined(OS_IOS) | 64 #if defined(OS_ANDROID) || defined(OS_IOS) |
| 65 // static | 65 // static |
| 66 const size_t SdchOwner::kMaxTotalDictionarySize = 1000 * 1000; | 66 const size_t SdchOwner::kMaxTotalDictionarySize = 500 * 1000; |
| 67 #else | 67 #else |
| 68 // static | 68 // static |
| 69 const size_t SdchOwner::kMaxTotalDictionarySize = 20 * 1000 * 1000; | 69 const size_t SdchOwner::kMaxTotalDictionarySize = 20 * 1000 * 1000; |
| 70 #endif | 70 #endif |
| 71 | 71 |
| 72 // Somewhat arbitrary, but we assume a dictionary smaller than | 72 // Somewhat arbitrary, but we assume a dictionary smaller than |
| 73 // 50K isn't going to do anyone any good. Note that this still doesn't | 73 // 50K isn't going to do anyone any good. Note that this still doesn't |
| 74 // prevent download and addition unless there is less than this | 74 // prevent download and addition unless there is less than this |
| 75 // amount of space available in storage. | 75 // amount of space available in storage. |
| 76 const size_t SdchOwner::kMinSpaceForDictionaryFetch = 50 * 1000; | 76 const size_t SdchOwner::kMinSpaceForDictionaryFetch = 50 * 1000; |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 RecordDictionaryEviction(it->second.use_count, | 309 RecordDictionaryEviction(it->second.use_count, |
| 310 DICTIONARY_FATE_EVICT_FOR_MEMORY); | 310 DICTIONARY_FATE_EVICT_FOR_MEMORY); |
| 311 } | 311 } |
| 312 | 312 |
| 313 // TODO(rdsmith): Make a distinction between moderate and critical | 313 // TODO(rdsmith): Make a distinction between moderate and critical |
| 314 // memory pressure. | 314 // memory pressure. |
| 315 manager_->ClearData(); | 315 manager_->ClearData(); |
| 316 } | 316 } |
| 317 | 317 |
| 318 } // namespace net | 318 } // namespace net |
| OLD | NEW |