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 "chrome/browser/memory/tab_manager.h" | 5 #include "chrome/browser/memory/tab_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <set> | 10 #include <set> |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 #endif | 223 #endif |
224 // purge-and-suspend param is used for Purge+Suspend finch experiment | 224 // purge-and-suspend param is used for Purge+Suspend finch experiment |
225 // in the following way: | 225 // in the following way: |
226 // https://docs.google.com/document/d/1hPHkKtXXBTlsZx9s-9U17XC-ofEIzPo9FYbBEc7
PPbk/edit?usp=sharing | 226 // https://docs.google.com/document/d/1hPHkKtXXBTlsZx9s-9U17XC-ofEIzPo9FYbBEc7
PPbk/edit?usp=sharing |
227 std::string purge_and_suspend_time = variations::GetVariationParamValue( | 227 std::string purge_and_suspend_time = variations::GetVariationParamValue( |
228 "PurgeAndSuspend", "purge-and-suspend-time"); | 228 "PurgeAndSuspend", "purge-and-suspend-time"); |
229 unsigned time_to_first_suspension_sec; | 229 unsigned time_to_first_suspension_sec; |
230 if (purge_and_suspend_time.empty() || | 230 if (purge_and_suspend_time.empty() || |
231 !base::StringToUint(purge_and_suspend_time, | 231 !base::StringToUint(purge_and_suspend_time, |
232 &time_to_first_suspension_sec)) | 232 &time_to_first_suspension_sec)) |
233 time_to_first_suspension_sec = 108000; | 233 time_to_first_suspension_sec = kDefaultTimeToFirstPurgeInSeconds; |
234 time_to_first_suspension_ = | 234 time_to_first_suspension_ = |
235 base::TimeDelta::FromSeconds(time_to_first_suspension_sec); | 235 base::TimeDelta::FromSeconds(time_to_first_suspension_sec); |
236 } | 236 } |
237 | 237 |
238 void TabManager::Stop() { | 238 void TabManager::Stop() { |
239 update_timer_.Stop(); | 239 update_timer_.Stop(); |
240 recent_tab_discard_timer_.Stop(); | 240 recent_tab_discard_timer_.Stop(); |
241 memory_pressure_listener_.reset(); | 241 memory_pressure_listener_.reset(); |
242 } | 242 } |
243 | 243 |
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 // platform. | 1030 // platform. |
1031 std::string allow_multiple_discards = variations::GetVariationParamValue( | 1031 std::string allow_multiple_discards = variations::GetVariationParamValue( |
1032 features::kAutomaticTabDiscarding.name, "AllowMultipleDiscards"); | 1032 features::kAutomaticTabDiscarding.name, "AllowMultipleDiscards"); |
1033 return (allow_multiple_discards != "true"); | 1033 return (allow_multiple_discards != "true"); |
1034 #else | 1034 #else |
1035 return false; | 1035 return false; |
1036 #endif | 1036 #endif |
1037 } | 1037 } |
1038 | 1038 |
1039 } // namespace memory | 1039 } // namespace memory |
OLD | NEW |