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 "content/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 #endif | 316 #endif |
317 | 317 |
318 MSVC_POP_WARNING() | 318 MSVC_POP_WARNING() |
319 MSVC_ENABLE_OPTIMIZE(); | 319 MSVC_ENABLE_OPTIMIZE(); |
320 | 320 |
321 #if defined(OS_WIN) | 321 #if defined(OS_WIN) |
322 // Creates a memory pressure monitor using automatic thresholds, or those | 322 // Creates a memory pressure monitor using automatic thresholds, or those |
323 // specified on the command-line. Ownership is passed to the caller. | 323 // specified on the command-line. Ownership is passed to the caller. |
324 base::win::MemoryPressureMonitor* CreateWinMemoryPressureMonitor( | 324 base::win::MemoryPressureMonitor* CreateWinMemoryPressureMonitor( |
325 const base::CommandLine& parsed_command_line) { | 325 const base::CommandLine& parsed_command_line) { |
326 std::vector<std::string> thresholds = base::SplitString( | 326 std::vector<std::string> thresholds; |
| 327 base::SplitString( |
327 parsed_command_line.GetSwitchValueASCII( | 328 parsed_command_line.GetSwitchValueASCII( |
328 switches::kMemoryPressureThresholdsMb), | 329 switches::kMemoryPressureThresholdsMb), |
329 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 330 ',', |
| 331 &thresholds); |
330 | 332 |
331 int moderate_threshold_mb = 0; | 333 int moderate_threshold_mb = 0; |
332 int critical_threshold_mb = 0; | 334 int critical_threshold_mb = 0; |
333 if (thresholds.size() == 2 && | 335 if (thresholds.size() == 2 && |
334 base::StringToInt(thresholds[0], &moderate_threshold_mb) && | 336 base::StringToInt(thresholds[0], &moderate_threshold_mb) && |
335 base::StringToInt(thresholds[1], &critical_threshold_mb) && | 337 base::StringToInt(thresholds[1], &critical_threshold_mb) && |
336 moderate_threshold_mb >= critical_threshold_mb && | 338 moderate_threshold_mb >= critical_threshold_mb && |
337 critical_threshold_mb >= 0) { | 339 critical_threshold_mb >= 0) { |
338 return new base::win::MemoryPressureMonitor(moderate_threshold_mb, | 340 return new base::win::MemoryPressureMonitor(moderate_threshold_mb, |
339 critical_threshold_mb); | 341 critical_threshold_mb); |
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1356 DCHECK(is_tracing_startup_); | 1358 DCHECK(is_tracing_startup_); |
1357 | 1359 |
1358 is_tracing_startup_ = false; | 1360 is_tracing_startup_ = false; |
1359 TracingController::GetInstance()->DisableRecording( | 1361 TracingController::GetInstance()->DisableRecording( |
1360 TracingController::CreateFileSink( | 1362 TracingController::CreateFileSink( |
1361 startup_trace_file_, | 1363 startup_trace_file_, |
1362 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1364 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
1363 } | 1365 } |
1364 | 1366 |
1365 } // namespace content | 1367 } // namespace content |
OLD | NEW |