OLD | NEW |
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/browser/renderer_host/media/midi_host.h" | 5 #include "content/browser/renderer_host/media/midi_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/process/process.h" | 10 #include "base/process/process.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 midi_manager_(midi_manager), | 39 midi_manager_(midi_manager), |
40 sent_bytes_in_flight_(0), | 40 sent_bytes_in_flight_(0), |
41 bytes_sent_since_last_acknowledgement_(0) { | 41 bytes_sent_since_last_acknowledgement_(0) { |
42 } | 42 } |
43 | 43 |
44 MIDIHost::~MIDIHost() { | 44 MIDIHost::~MIDIHost() { |
45 if (midi_manager_) | 45 if (midi_manager_) |
46 midi_manager_->EndSession(this); | 46 midi_manager_->EndSession(this); |
47 } | 47 } |
48 | 48 |
49 void MIDIHost::OnChannelClosing() { | |
50 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | |
51 | |
52 BrowserMessageFilter::OnChannelClosing(); | |
53 } | |
54 | |
55 void MIDIHost::OnDestruct() const { | 49 void MIDIHost::OnDestruct() const { |
56 BrowserThread::DeleteOnIOThread::Destruct(this); | 50 BrowserThread::DeleteOnIOThread::Destruct(this); |
57 } | 51 } |
58 | 52 |
59 /////////////////////////////////////////////////////////////////////////////// | 53 /////////////////////////////////////////////////////////////////////////////// |
60 // IPC Messages handler | 54 // IPC Messages handler |
61 bool MIDIHost::OnMessageReceived(const IPC::Message& message, | 55 bool MIDIHost::OnMessageReceived(const IPC::Message& message, |
62 bool* message_was_ok) { | 56 bool* message_was_ok) { |
63 bool handled = true; | 57 bool handled = true; |
64 IPC_BEGIN_MESSAGE_MAP_EX(MIDIHost, message, *message_was_ok) | 58 IPC_BEGIN_MESSAGE_MAP_EX(MIDIHost, message, *message_was_ok) |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 159 |
166 if (bytes_sent_since_last_acknowledgement_ >= | 160 if (bytes_sent_since_last_acknowledgement_ >= |
167 kAcknowledgementThresholdBytes) { | 161 kAcknowledgementThresholdBytes) { |
168 Send(new MIDIMsg_AcknowledgeSentData( | 162 Send(new MIDIMsg_AcknowledgeSentData( |
169 bytes_sent_since_last_acknowledgement_)); | 163 bytes_sent_since_last_acknowledgement_)); |
170 bytes_sent_since_last_acknowledgement_ = 0; | 164 bytes_sent_since_last_acknowledgement_ = 0; |
171 } | 165 } |
172 } | 166 } |
173 | 167 |
174 } // namespace content | 168 } // namespace content |
OLD | NEW |