| 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 "components/copresence/handlers/audio/audio_directive_handler_impl.h" | 5 #include "components/copresence/handlers/audio/audio_directive_handler_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 } // namespace | 49 } // namespace |
| 50 | 50 |
| 51 | 51 |
| 52 // Public functions. | 52 // Public functions. |
| 53 | 53 |
| 54 AudioDirectiveHandlerImpl::AudioDirectiveHandlerImpl( | 54 AudioDirectiveHandlerImpl::AudioDirectiveHandlerImpl( |
| 55 const DirectivesCallback& update_directives_callback) | 55 const DirectivesCallback& update_directives_callback) |
| 56 : update_directives_callback_(update_directives_callback), | 56 : update_directives_callback_(update_directives_callback), |
| 57 audio_modem_(audio_modem::Modem::Create()), | 57 audio_modem_(audio_modem::Modem::Create()), |
| 58 audio_event_timer_(new base::OneShotTimer<AudioDirectiveHandler>), | 58 audio_event_timer_(new base::OneShotTimer), |
| 59 clock_(new TickClockRefCounted(new base::DefaultTickClock)) {} | 59 clock_(new TickClockRefCounted(new base::DefaultTickClock)) {} |
| 60 | 60 |
| 61 AudioDirectiveHandlerImpl::AudioDirectiveHandlerImpl( | 61 AudioDirectiveHandlerImpl::AudioDirectiveHandlerImpl( |
| 62 const DirectivesCallback& update_directives_callback, | 62 const DirectivesCallback& update_directives_callback, |
| 63 scoped_ptr<audio_modem::Modem> audio_modem, | 63 scoped_ptr<audio_modem::Modem> audio_modem, |
| 64 scoped_ptr<base::Timer> timer, | 64 scoped_ptr<base::Timer> timer, |
| 65 const scoped_refptr<TickClockRefCounted>& clock) | 65 const scoped_refptr<TickClockRefCounted>& clock) |
| 66 : update_directives_callback_(update_directives_callback), | 66 : update_directives_callback_(update_directives_callback), |
| 67 audio_modem_(audio_modem.Pass()), | 67 audio_modem_(audio_modem.Pass()), |
| 68 audio_event_timer_(timer.Pass()), | 68 audio_event_timer_(timer.Pass()), |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 229 |
| 230 *expiry = GetEarliestEventTime(transmits_lists_[AUDIBLE], base::TimeTicks()); | 230 *expiry = GetEarliestEventTime(transmits_lists_[AUDIBLE], base::TimeTicks()); |
| 231 *expiry = GetEarliestEventTime(transmits_lists_[INAUDIBLE], *expiry); | 231 *expiry = GetEarliestEventTime(transmits_lists_[INAUDIBLE], *expiry); |
| 232 *expiry = GetEarliestEventTime(receives_lists_[AUDIBLE], *expiry); | 232 *expiry = GetEarliestEventTime(receives_lists_[AUDIBLE], *expiry); |
| 233 *expiry = GetEarliestEventTime(receives_lists_[INAUDIBLE], *expiry); | 233 *expiry = GetEarliestEventTime(receives_lists_[INAUDIBLE], *expiry); |
| 234 | 234 |
| 235 return !expiry->is_null(); | 235 return !expiry->is_null(); |
| 236 } | 236 } |
| 237 | 237 |
| 238 } // namespace copresence | 238 } // namespace copresence |
| OLD | NEW |