| 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 reject(DOMError::create("SecurityError")); | 228 reject(DOMError::create("SecurityError")); |
| 229 } | 229 } |
| 230 return promise; | 230 return promise; |
| 231 } | 231 } |
| 232 | 232 |
| 233 void MIDIAccess::resolve() | 233 void MIDIAccess::resolve() |
| 234 { | 234 { |
| 235 m_asyncResolveRunner.runAsync(); | 235 m_asyncResolveRunner.runAsync(); |
| 236 } | 236 } |
| 237 | 237 |
| 238 void MIDIAccess::reject(PassRefPtr<DOMError> error) | 238 void MIDIAccess::reject(PassRefPtrWillBeRawPtr<DOMError> error) |
| 239 { | 239 { |
| 240 m_error = error; | 240 m_error = error; |
| 241 m_asyncRejectRunner.runAsync(); | 241 m_asyncRejectRunner.runAsync(); |
| 242 } | 242 } |
| 243 | 243 |
| 244 void MIDIAccess::resolveNow() | 244 void MIDIAccess::resolveNow() |
| 245 { | 245 { |
| 246 m_resolver->resolve(this, executionContext()); | 246 m_resolver->resolve(this, executionContext()); |
| 247 } | 247 } |
| 248 | 248 |
| 249 void MIDIAccess::rejectNow() | 249 void MIDIAccess::rejectNow() |
| 250 { | 250 { |
| 251 m_resolver->reject(m_error.release().get(), executionContext()); | 251 m_resolver->reject(m_error.get(), executionContext()); |
| 252 m_error.clear(); |
| 252 } | 253 } |
| 253 | 254 |
| 254 void MIDIAccess::doPostAction(State state) | 255 void MIDIAccess::doPostAction(State state) |
| 255 { | 256 { |
| 256 ASSERT(m_state == Requesting); | 257 ASSERT(m_state == Requesting); |
| 257 ASSERT(state == Resolved || state == Stopped); | 258 ASSERT(state == Resolved || state == Stopped); |
| 258 m_error.clear(); | 259 m_error.clear(); |
| 259 if (state == Stopped) { | 260 if (state == Stopped) { |
| 260 m_accessor.clear(); | 261 m_accessor.clear(); |
| 261 } | 262 } |
| 262 m_weakPtrFactory.revokeAll(); | 263 m_weakPtrFactory.revokeAll(); |
| 263 m_state = state; | 264 m_state = state; |
| 264 } | 265 } |
| 265 | 266 |
| 266 void MIDIAccess::trace(Visitor* visitor) | 267 void MIDIAccess::trace(Visitor* visitor) |
| 267 { | 268 { |
| 268 visitor->trace(m_inputs); | 269 visitor->trace(m_inputs); |
| 269 visitor->trace(m_outputs); | 270 visitor->trace(m_outputs); |
| 271 visitor->trace(m_error); |
| 270 } | 272 } |
| 271 | 273 |
| 272 } // namespace WebCore | 274 } // namespace WebCore |
| OLD | NEW |