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

Unified Diff: media/midi/midi_manager.cc

Issue 108603004: [WebMIDI] MIDIManager::create should return non-null object. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/midi/midi_manager.cc
diff --git a/media/midi/midi_manager.cc b/media/midi/midi_manager.cc
index 6d3f1d30b959139aaad7df5237090fc550b7f462..97678b3cc78aa73fc45409d8fa9e20d9b5a81e15 100644
--- a/media/midi/midi_manager.cc
+++ b/media/midi/midi_manager.cc
@@ -10,9 +10,34 @@
namespace media {
#if !defined(OS_MACOSX) && !defined(OS_WIN)
+namespace {
+
+class NullMIDIManager : public MIDIManager {
Takashi Toyoshima 2013/12/19 07:58:24 How about just adding default implementations of I
yhirano 2013/12/19 08:21:54 Done.
+ public:
+ virtual ~NullMIDIManager();
+ virtual void DispatchSendMIDIData(MIDIManagerClient* client,
+ uint32 port_index,
+ const std::vector<uint8>& data,
+ double timestamp) OVERRIDE;
+ virtual bool Initialize() OVERRIDE;
+};
+
+NullMIDIManager::~NullMIDIManager() {}
+
+void NullMIDIManager::DispatchSendMIDIData(MIDIManagerClient* client,
+ uint32 port_index,
+ const std::vector<uint8>& data,
+ double timestamp) {}
+
+bool NullMIDIManager::Initialize() {
+ return false;
+}
+
+} // namespace
+
// TODO(crogers): implement MIDIManager for other platforms.
MIDIManager* MIDIManager::Create() {
- return NULL;
+ return new NullMIDIManager;
}
#endif
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698