| OLD | NEW | 
|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/midi/midi_scheduler.h" | 5 #include "media/midi/midi_scheduler.h" | 
| 6 | 6 | 
| 7 #include <algorithm> | 7 #include <algorithm> | 
| 8 | 8 | 
| 9 #include "base/bind.h" | 9 #include "base/bind.h" | 
| 10 #include "base/location.h" | 10 #include "base/location.h" | 
| 11 #include "base/threading/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" | 
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" | 
| 13 #include "media/midi/midi_manager.h" | 13 #include "media/midi/midi_manager.h" | 
| 14 | 14 | 
| 15 namespace media { |  | 
| 16 namespace midi { | 15 namespace midi { | 
| 17 | 16 | 
| 18 MidiScheduler::MidiScheduler(MidiManager* manager) | 17 MidiScheduler::MidiScheduler(MidiManager* manager) | 
| 19     : manager_(manager), | 18     : manager_(manager), | 
| 20       task_runner_(base::ThreadTaskRunnerHandle::Get()), | 19       task_runner_(base::ThreadTaskRunnerHandle::Get()), | 
| 21       weak_factory_(this) {} | 20       weak_factory_(this) {} | 
| 22 | 21 | 
| 23 MidiScheduler::~MidiScheduler() { | 22 MidiScheduler::~MidiScheduler() { | 
| 24   DCHECK(thread_checker_.CalledOnValidThread()); | 23   DCHECK(thread_checker_.CalledOnValidThread()); | 
| 25 } | 24 } | 
| (...skipping 26 matching lines...) Expand all  Loading... | 
| 52 | 51 | 
| 53 void MidiScheduler::InvokeClosure(MidiManagerClient* client, | 52 void MidiScheduler::InvokeClosure(MidiManagerClient* client, | 
| 54                                   size_t length, | 53                                   size_t length, | 
| 55                                   const base::Closure& closure) { | 54                                   const base::Closure& closure) { | 
| 56   DCHECK(thread_checker_.CalledOnValidThread()); | 55   DCHECK(thread_checker_.CalledOnValidThread()); | 
| 57   closure.Run(); | 56   closure.Run(); | 
| 58   manager_->AccumulateMidiBytesSent(client, length); | 57   manager_->AccumulateMidiBytesSent(client, length); | 
| 59 } | 58 } | 
| 60 | 59 | 
| 61 }  // namespace midi | 60 }  // namespace midi | 
| 62 }  // namespace media |  | 
| OLD | NEW | 
|---|