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

Side by Side Diff: Source/core/platform/midi/MIDIAccessor.cpp

Issue 18260005: Web MIDI: remove old platform API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@midi_permission_request
Patch Set: (rebase) Created 7 years, 4 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
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 { 51 {
52 ASSERT(client); 52 ASSERT(client);
53 53
54 m_accessor = adoptPtr(WebKit::Platform::current()->createMIDIAccessor(this)) ; 54 m_accessor = adoptPtr(WebKit::Platform::current()->createMIDIAccessor(this)) ;
55 55
56 ASSERT(m_accessor); 56 ASSERT(m_accessor);
57 } 57 }
58 58
59 void MIDIAccessor::startSession() 59 void MIDIAccessor::startSession()
60 { 60 {
61 // FIXME: Use new API once embedder side implement the new API. 61 m_accessor->startSession();
62 m_accessor->requestAccess(false);
63 } 62 }
64 63
65 void MIDIAccessor::sendMIDIData(unsigned portIndex, const unsigned char* data, s ize_t length, double timeStamp) 64 void MIDIAccessor::sendMIDIData(unsigned portIndex, const unsigned char* data, s ize_t length, double timeStamp)
66 { 65 {
67 m_accessor->sendMIDIData(portIndex, data, length, timeStamp); 66 m_accessor->sendMIDIData(portIndex, data, length, timeStamp);
68 } 67 }
69 68
70 void MIDIAccessor::didAddInputPort(const WebString& id, const WebString& manufac turer, const WebString& name, const WebString& version) 69 void MIDIAccessor::didAddInputPort(const WebString& id, const WebString& manufac turer, const WebString& name, const WebString& version)
71 { 70 {
72 m_client->didAddInputPort(id, manufacturer, name, version); 71 m_client->didAddInputPort(id, manufacturer, name, version);
73 } 72 }
74 73
75 void MIDIAccessor::didAddOutputPort(const WebString& id, const WebString& manufa cturer, const WebString& name, const WebString& version) 74 void MIDIAccessor::didAddOutputPort(const WebString& id, const WebString& manufa cturer, const WebString& name, const WebString& version)
76 { 75 {
77 m_client->didAddOutputPort(id, manufacturer, name, version); 76 m_client->didAddOutputPort(id, manufacturer, name, version);
78 } 77 }
79 78
80 void MIDIAccessor::didStartSession() 79 void MIDIAccessor::didStartSession()
81 { 80 {
82 m_client->didStartSession(); 81 m_client->didStartSession();
83 } 82 }
84 83
85 void MIDIAccessor::didAllowAccess()
86 {
87 m_client->didStartSession();
88 }
89
90 void MIDIAccessor::didBlockAccess()
91 {
92 m_client->didStartSession();
93 }
94
95 void MIDIAccessor::didReceiveMIDIData(unsigned portIndex, const unsigned char* d ata, size_t length, double timeStamp) 84 void MIDIAccessor::didReceiveMIDIData(unsigned portIndex, const unsigned char* d ata, size_t length, double timeStamp)
96 { 85 {
97 m_client->didReceiveMIDIData(portIndex, data, length, timeStamp); 86 m_client->didReceiveMIDIData(portIndex, data, length, timeStamp);
98 } 87 }
99 88
100 } // namespace WebCore 89 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/platform/midi/MIDIAccessor.h ('k') | Tools/DumpRenderTree/chromium/TestRunner/src/MockWebMIDIAccessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698