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

Unified Diff: content/browser/media/midi_host.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/media/midi_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/midi_host.h
diff --git a/content/browser/media/midi_host.h b/content/browser/media/midi_host.h
index 87be30513a34478903b5669a38deab515ccc31c5..acaee52bb901ea546c7ad9d9dc4e0d4b53106379 100644
--- a/content/browser/media/midi_host.h
+++ b/content/browser/media/midi_host.h
@@ -11,6 +11,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
+#include "base/synchronization/lock.h"
#include "content/common/content_export.h"
#include "content/public/browser/browser_message_filter.h"
#include "content/public/browser/browser_thread.h"
@@ -35,7 +36,7 @@ class CONTENT_EXPORT MidiHost
bool OnMessageReceived(const IPC::Message& message) override;
// MidiManagerClient implementation.
- void CompleteStartSession(int client_id, media::MidiResult result) override;
+ void CompleteStartSession(media::MidiResult result) override;
void ReceiveMidiData(uint32 port,
const uint8* data,
size_t length,
@@ -43,13 +44,15 @@ class CONTENT_EXPORT MidiHost
void AccumulateMidiBytesSent(size_t n) override;
// Start session to access MIDI hardware.
- void OnStartSession(int client_id);
+ void OnStartSession();
// Data to be sent to a MIDI output port.
void OnSendData(uint32 port,
const std::vector<uint8>& data,
double timestamp);
+ void OnEndSession();
+
private:
FRIEND_TEST_ALL_PREFIXES(MidiHostTest, IsValidWebMIDIData);
friend class base::DeleteHelper<MidiHost>;
@@ -70,6 +73,9 @@ class CONTENT_EXPORT MidiHost
// messages.
bool has_sys_ex_permission_;
+ // Represents if a session is requested to start.
+ bool is_session_requested_;
+
// |midi_manager_| talks to the platform-specific MIDI APIs.
// It can be NULL if the platform (or our current implementation)
// does not support MIDI. If not supported then a call to
« no previous file with comments | « no previous file | content/browser/media/midi_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698