Chromium Code Reviews| 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 "media/audio/mac/audio_manager_mac.h" | 5 #include "media/audio/mac/audio_manager_mac.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 335 } | 335 } |
| 336 | 336 |
| 337 bool IsOnBatteryPower() const { | 337 bool IsOnBatteryPower() const { |
| 338 DCHECK(thread_checker_.CalledOnValidThread()); | 338 DCHECK(thread_checker_.CalledOnValidThread()); |
| 339 return base::PowerMonitor::Get()->IsOnBatteryPower(); | 339 return base::PowerMonitor::Get()->IsOnBatteryPower(); |
| 340 } | 340 } |
| 341 | 341 |
| 342 private: | 342 private: |
| 343 void OnSuspend() override { | 343 void OnSuspend() override { |
| 344 DCHECK(thread_checker_.CalledOnValidThread()); | 344 DCHECK(thread_checker_.CalledOnValidThread()); |
| 345 DVLOG(1) << "OnSuspend"; | 345 DVLOG(1) << "---------------------- OnSuspend"; |
|
tommi (sloooow) - chröme
2016/03/18 10:08:18
intended for checkin?
henrika (OOO until Aug 14)
2016/03/18 10:16:03
Used it to make logging more easy to read. Now rem
| |
| 346 is_suspending_ = true; | 346 is_suspending_ = true; |
| 347 } | 347 } |
| 348 | 348 |
| 349 void OnResume() override { | 349 void OnResume() override { |
| 350 DCHECK(thread_checker_.CalledOnValidThread()); | 350 DCHECK(thread_checker_.CalledOnValidThread()); |
| 351 DVLOG(1) << "OnResume"; | 351 DVLOG(1) << "++++++++++++++++++++++ OnResume"; |
|
tommi (sloooow) - chröme
2016/03/18 10:08:18
ditto
henrika (OOO until Aug 14)
2016/03/18 10:16:03
Done.
| |
| 352 ++num_resume_notifications_; | 352 ++num_resume_notifications_; |
| 353 is_suspending_ = false; | 353 is_suspending_ = false; |
| 354 earliest_start_time_ = base::TimeTicks::Now() + | 354 earliest_start_time_ = base::TimeTicks::Now() + |
| 355 base::TimeDelta::FromSeconds(kStartDelayInSecsForPowerEvents); | 355 base::TimeDelta::FromSeconds(kStartDelayInSecsForPowerEvents); |
| 356 } | 356 } |
| 357 | 357 |
| 358 bool is_suspending_; | 358 bool is_suspending_; |
| 359 const bool is_monitoring_; | 359 const bool is_monitoring_; |
| 360 base::TimeTicks earliest_start_time_; | 360 base::TimeTicks earliest_start_time_; |
| 361 base::ThreadChecker thread_checker_; | 361 base::ThreadChecker thread_checker_; |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 978 basic_input_streams_.erase(stream_it); | 978 basic_input_streams_.erase(stream_it); |
| 979 | 979 |
| 980 AudioManagerBase::ReleaseInputStream(stream); | 980 AudioManagerBase::ReleaseInputStream(stream); |
| 981 } | 981 } |
| 982 | 982 |
| 983 AudioManager* CreateAudioManager(AudioLogFactory* audio_log_factory) { | 983 AudioManager* CreateAudioManager(AudioLogFactory* audio_log_factory) { |
| 984 return new AudioManagerMac(audio_log_factory); | 984 return new AudioManagerMac(audio_log_factory); |
| 985 } | 985 } |
| 986 | 986 |
| 987 } // namespace media | 987 } // namespace media |
| OLD | NEW |