| 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 "chrome/browser/chromeos/power/cpu_data_collector.h" | 5 #include "chrome/browser/chromeos/power/cpu_data_collector.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 std::vector<std::string>* cpu_idle_state_names = | 372 std::vector<std::string>* cpu_idle_state_names = |
| 373 new std::vector<std::string>(cpu_idle_state_names_); | 373 new std::vector<std::string>(cpu_idle_state_names_); |
| 374 std::vector<StateOccupancySample>* idle_samples = | 374 std::vector<StateOccupancySample>* idle_samples = |
| 375 new std::vector<StateOccupancySample>; | 375 new std::vector<StateOccupancySample>; |
| 376 std::vector<std::string>* cpu_freq_state_names = | 376 std::vector<std::string>* cpu_freq_state_names = |
| 377 new std::vector<std::string>(cpu_freq_state_names_); | 377 new std::vector<std::string>(cpu_freq_state_names_); |
| 378 std::vector<StateOccupancySample>* freq_samples = | 378 std::vector<StateOccupancySample>* freq_samples = |
| 379 new std::vector<StateOccupancySample>; | 379 new std::vector<StateOccupancySample>; |
| 380 | 380 |
| 381 base::PostTaskWithTraitsAndReply( | 381 base::PostTaskWithTraitsAndReply( |
| 382 FROM_HERE, base::TaskTraits().MayBlock().WithPriority( | 382 FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, |
| 383 base::TaskPriority::BACKGROUND), | |
| 384 base::Bind(&SampleCpuStateAsync, base::Unretained(cpu_count), | 383 base::Bind(&SampleCpuStateAsync, base::Unretained(cpu_count), |
| 385 base::Unretained(cpu_idle_state_names), | 384 base::Unretained(cpu_idle_state_names), |
| 386 base::Unretained(idle_samples), | 385 base::Unretained(idle_samples), |
| 387 base::Unretained(cpu_freq_state_names), | 386 base::Unretained(cpu_freq_state_names), |
| 388 base::Unretained(freq_samples)), | 387 base::Unretained(freq_samples)), |
| 389 base::Bind(&CpuDataCollector::SaveCpuStateSamplesOnUIThread, | 388 base::Bind(&CpuDataCollector::SaveCpuStateSamplesOnUIThread, |
| 390 weak_ptr_factory_.GetWeakPtr(), base::Owned(cpu_count), | 389 weak_ptr_factory_.GetWeakPtr(), base::Owned(cpu_count), |
| 391 base::Owned(cpu_idle_state_names), base::Owned(idle_samples), | 390 base::Owned(cpu_idle_state_names), base::Owned(idle_samples), |
| 392 base::Owned(cpu_freq_state_names), base::Owned(freq_samples))); | 391 base::Owned(cpu_freq_state_names), base::Owned(freq_samples))); |
| 393 } | 392 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 : cpu_online(false) { | 439 : cpu_online(false) { |
| 441 } | 440 } |
| 442 | 441 |
| 443 CpuDataCollector::StateOccupancySample::StateOccupancySample( | 442 CpuDataCollector::StateOccupancySample::StateOccupancySample( |
| 444 const StateOccupancySample& other) = default; | 443 const StateOccupancySample& other) = default; |
| 445 | 444 |
| 446 CpuDataCollector::StateOccupancySample::~StateOccupancySample() { | 445 CpuDataCollector::StateOccupancySample::~StateOccupancySample() { |
| 447 } | 446 } |
| 448 | 447 |
| 449 } // namespace chromeos | 448 } // namespace chromeos |
| OLD | NEW |