| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 MIDIAccess::~MIDIAccess() | 79 MIDIAccess::~MIDIAccess() |
| 80 { | 80 { |
| 81 } | 81 } |
| 82 | 82 |
| 83 MIDIAccess::MIDIAccess(const MIDIOptions& options, ExecutionContext* context) | 83 MIDIAccess::MIDIAccess(const MIDIOptions& options, ExecutionContext* context) |
| 84 : ActiveDOMObject(context) | 84 : ActiveDOMObject(context) |
| 85 , m_state(Requesting) | 85 , m_state(Requesting) |
| 86 , m_weakPtrFactory(this) | 86 , m_weakPtrFactory(this) |
| 87 , m_options(options) | 87 , m_options(options) |
| 88 , m_sysExEnabled(false) | 88 , m_sysexEnabled(false) |
| 89 , m_asyncResolveRunner(this, &MIDIAccess::resolveNow) | 89 , m_asyncResolveRunner(this, &MIDIAccess::resolveNow) |
| 90 , m_asyncRejectRunner(this, &MIDIAccess::rejectNow) | 90 , m_asyncRejectRunner(this, &MIDIAccess::rejectNow) |
| 91 { | 91 { |
| 92 ScriptWrappable::init(this); | 92 ScriptWrappable::init(this); |
| 93 m_accessor = MIDIAccessor::create(this); | 93 m_accessor = MIDIAccessor::create(this); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void MIDIAccess::setSysExEnabled(bool enable) | 96 void MIDIAccess::setSysexEnabled(bool enable) |
| 97 { | 97 { |
| 98 m_sysExEnabled = enable; | 98 m_sysexEnabled = enable; |
| 99 if (enable) { | 99 if (enable) { |
| 100 m_accessor->startSession(); | 100 m_accessor->startSession(); |
| 101 } else { | 101 } else { |
| 102 reject(DOMError::create("SecurityError")); | 102 reject(DOMError::create("SecurityError")); |
| 103 } | 103 } |
| 104 } | 104 } |
| 105 | 105 |
| 106 void MIDIAccess::didAddInputPort(const String& id, const String& manufacturer, c
onst String& name, const String& version) | 106 void MIDIAccess::didAddInputPort(const String& id, const String& manufacturer, c
onst String& name, const String& version) |
| 107 { | 107 { |
| 108 ASSERT(isMainThread()); | 108 ASSERT(isMainThread()); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 } | 265 } |
| 266 | 266 |
| 267 void MIDIAccess::trace(Visitor* visitor) | 267 void MIDIAccess::trace(Visitor* visitor) |
| 268 { | 268 { |
| 269 visitor->trace(m_inputs); | 269 visitor->trace(m_inputs); |
| 270 visitor->trace(m_outputs); | 270 visitor->trace(m_outputs); |
| 271 visitor->trace(m_error); | 271 visitor->trace(m_error); |
| 272 } | 272 } |
| 273 | 273 |
| 274 } // namespace WebCore | 274 } // namespace WebCore |
| OLD | NEW |