Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: media/midi/midi_scheduler.h

Issue 1052983002: Web MIDI: add MidiScheduler for send() with timestamp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_MIDI_MIDI_SCHEDULER_H_
6 #define MEDIA_MIDI_MIDI_SCHEDULER_H_
7
8 #include "base/callback.h"
9 #include "base/memory/weak_ptr.h"
10
11 namespace media {
12
13 class MidiManagerClient;
14
15 // TODO(crbug.com/467442): Make tasks cancelable per client.
16 class MidiScheduler {
yhirano 2015/04/03 01:32:16 [optional] +final?
Takashi Toyoshima 2015/04/03 02:35:11 Done.
17 public:
18 MidiScheduler();
19 ~MidiScheduler();
yhirano 2015/04/03 01:32:16 You don't need an empty destructor.
Takashi Toyoshima 2015/04/03 02:35:11 Without this, compiler reports an error like, ../
yhirano 2015/04/03 03:26:38 Oh, sorry, you're right.
20
21 // Post |closure| to the current message loop safely. The |closure| will not
22 // be invoked after MidiScheduler is deleted. AccumulateMidiBytesSent() of
23 // |client| is called internally.
24 void PostSendDataTask(MidiManagerClient* client,
25 size_t length,
26 double timestamp,
27 const base::Closure& closure);
28
29 private:
30 void InvokeClosure(const base::Closure& closure);
31
32 base::WeakPtrFactory<MidiScheduler> weak_factory_;
33
34 DISALLOW_COPY_AND_ASSIGN(MidiScheduler);
35 };
36
37 } // namespace media
38
39 #endif // MEDIA_MIDI_MIDI_SCHEDULER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698