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

Side by Side Diff: content/renderer/media/renderer_webmidiaccessor_impl.cc

Issue 662853003: Manage MIDI related objects and sessions' lifecycles correctly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: one line bug fix Created 6 years, 2 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
« no previous file with comments | « content/renderer/media/midi_message_filter.cc ('k') | media/midi/midi_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "content/renderer/media/renderer_webmidiaccessor_impl.h" 5 #include "content/renderer/media/renderer_webmidiaccessor_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/renderer/media/midi_message_filter.h" 8 #include "content/renderer/media/midi_message_filter.h"
9 #include "content/renderer/render_thread_impl.h" 9 #include "content/renderer/render_thread_impl.h"
10 10
11 namespace content { 11 namespace content {
12 12
13 RendererWebMIDIAccessorImpl::RendererWebMIDIAccessorImpl( 13 RendererWebMIDIAccessorImpl::RendererWebMIDIAccessorImpl(
14 blink::WebMIDIAccessorClient* client) 14 blink::WebMIDIAccessorClient* client)
15 : client_(client) { 15 : client_(client) {
16 DCHECK(client_); 16 DCHECK(client_);
17 } 17 }
18 18
19 RendererWebMIDIAccessorImpl::~RendererWebMIDIAccessorImpl() { 19 RendererWebMIDIAccessorImpl::~RendererWebMIDIAccessorImpl() {
20 midi_message_filter()->RemoveClient(client_); 20 midi_message_filter()->RemoveClient(client_);
21 } 21 }
22 22
23 void RendererWebMIDIAccessorImpl::startSession() { 23 void RendererWebMIDIAccessorImpl::startSession() {
24 midi_message_filter()->StartSession(client_); 24 midi_message_filter()->AddClient(client_);
25 } 25 }
26 26
27 void RendererWebMIDIAccessorImpl::sendMIDIData( 27 void RendererWebMIDIAccessorImpl::sendMIDIData(
28 unsigned port_index, 28 unsigned port_index,
29 const unsigned char* data, 29 const unsigned char* data,
30 size_t length, 30 size_t length,
31 double timestamp) { 31 double timestamp) {
32 midi_message_filter()->SendMidiData( 32 midi_message_filter()->SendMidiData(
33 port_index, 33 port_index,
34 data, 34 data,
35 length, 35 length,
36 timestamp); 36 timestamp);
37 } 37 }
38 38
39 MidiMessageFilter* RendererWebMIDIAccessorImpl::midi_message_filter() { 39 MidiMessageFilter* RendererWebMIDIAccessorImpl::midi_message_filter() {
40 return RenderThreadImpl::current()->midi_message_filter(); 40 return RenderThreadImpl::current()->midi_message_filter();
41 } 41 }
42 42
43 } // namespace content 43 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/midi_message_filter.cc ('k') | media/midi/midi_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698