OLD | NEW |
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 if (enable) | 75 if (enable) |
76 m_accessor->startSession(); | 76 m_accessor->startSession(); |
77 else | 77 else |
78 permissionDenied(); | 78 permissionDenied(); |
79 } | 79 } |
80 | 80 |
81 void MIDIAccess::didAddInputPort(const String& id, const String& manufacturer, c
onst String& name, const String& version) | 81 void MIDIAccess::didAddInputPort(const String& id, const String& manufacturer, c
onst String& name, const String& version) |
82 { | 82 { |
83 ASSERT(isMainThread()); | 83 ASSERT(isMainThread()); |
84 | 84 |
85 // FIXME: Pass in |this| to create() method so we can filter system exclusiv
e messages correctly. | 85 m_inputs.append(MIDIInput::create(this, scriptExecutionContext(), id, manufa
cturer, name, version)); |
86 m_inputs.append(MIDIInput::create(scriptExecutionContext(), id, manufacturer
, name, version)); | |
87 } | 86 } |
88 | 87 |
89 void MIDIAccess::didAddOutputPort(const String& id, const String& manufacturer,
const String& name, const String& version) | 88 void MIDIAccess::didAddOutputPort(const String& id, const String& manufacturer,
const String& name, const String& version) |
90 { | 89 { |
91 ASSERT(isMainThread()); | 90 ASSERT(isMainThread()); |
92 | 91 |
93 unsigned portIndex = m_outputs.size(); | 92 unsigned portIndex = m_outputs.size(); |
94 m_outputs.append(MIDIOutput::create(this, portIndex, scriptExecutionContext(
), id, manufacturer, name, version)); | 93 m_outputs.append(MIDIOutput::create(this, portIndex, scriptExecutionContext(
), id, manufacturer, name, version)); |
95 } | 94 } |
96 | 95 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 177 |
179 void MIDIAccess::permissionDenied() | 178 void MIDIAccess::permissionDenied() |
180 { | 179 { |
181 ASSERT(isMainThread()); | 180 ASSERT(isMainThread()); |
182 | 181 |
183 m_hasAccess = false; | 182 m_hasAccess = false; |
184 m_promise->reject(DOMError::create("SecurityError")); | 183 m_promise->reject(DOMError::create("SecurityError")); |
185 } | 184 } |
186 | 185 |
187 } // namespace WebCore | 186 } // namespace WebCore |
OLD | NEW |