Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/browser/memory/memory_condition_observer.h" | 5 #include "content/browser/memory/memory_condition_observer.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "components/variations/variations_associated_data.h" | 9 #include "components/variations/variations_associated_data.h" |
| 10 #include "content/browser/memory/memory_monitor.h" | 10 #include "content/browser/memory/memory_monitor.h" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 const int kDefaultExpectedRendererSizeMB = 70; | 21 const int kDefaultExpectedRendererSizeMB = 70; |
| 22 #else // Mac, Linux, and ChromeOS | 22 #else // Mac, Linux, and ChromeOS |
| 23 const int kDefaultExpectedRendererSizeMB = 120; | 23 const int kDefaultExpectedRendererSizeMB = 120; |
| 24 #endif | 24 #endif |
| 25 | 25 |
| 26 // Default values for parameters to determine the global state. | 26 // Default values for parameters to determine the global state. |
| 27 const int kDefaultNewRenderersUntilWarning = 4; | 27 const int kDefaultNewRenderersUntilWarning = 4; |
| 28 const int kDefaultNewRenderersUntilCritical = 2; | 28 const int kDefaultNewRenderersUntilCritical = 2; |
| 29 const int kDefaultNewRenderersBackToNormal = 5; | 29 const int kDefaultNewRenderersBackToNormal = 5; |
| 30 const int kDefaultNewRenderersBackToWarning = 3; | 30 const int kDefaultNewRenderersBackToWarning = 3; |
| 31 const int kDefaultMonitoringIntervalSeconds = 5; | 31 const int kDefaultMonitoringIntervalSeconds = 1; |
|
bashi
2017/03/28 05:48:36
It seems that base::chromeos::MemoryPressureMonito
| |
| 32 const int kMonitoringIntervalBackgroundedSeconds = 120; | 32 const int kMonitoringIntervalBackgroundedSeconds = 120; |
| 33 | 33 |
| 34 void SetIntVariationParameter(const std::map<std::string, std::string> params, | 34 void SetIntVariationParameter(const std::map<std::string, std::string> params, |
| 35 const char* name, | 35 const char* name, |
| 36 int* target) { | 36 int* target) { |
| 37 const auto& iter = params.find(name); | 37 const auto& iter = params.find(name); |
| 38 if (iter == params.end()) | 38 if (iter == params.end()) |
| 39 return; | 39 return; |
| 40 int value; | 40 int value; |
| 41 if (!iter->second.empty() && base::StringToInt(iter->second, &value)) { | 41 if (!iter->second.empty() && base::StringToInt(iter->second, &value)) { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 175 } | 175 } |
| 176 | 176 |
| 177 bool MemoryConditionObserver::ValidateParameters() { | 177 bool MemoryConditionObserver::ValidateParameters() { |
| 178 return (new_renderers_until_warning_ > new_renderers_until_critical_) && | 178 return (new_renderers_until_warning_ > new_renderers_until_critical_) && |
| 179 (new_renderers_back_to_normal_ > new_renderers_back_to_warning_) && | 179 (new_renderers_back_to_normal_ > new_renderers_back_to_warning_) && |
| 180 (new_renderers_back_to_normal_ > new_renderers_until_warning_) && | 180 (new_renderers_back_to_normal_ > new_renderers_until_warning_) && |
| 181 (new_renderers_back_to_warning_ > new_renderers_until_critical_); | 181 (new_renderers_back_to_warning_ > new_renderers_until_critical_); |
| 182 } | 182 } |
| 183 | 183 |
| 184 } // namespace content | 184 } // namespace content |
| OLD | NEW |