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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 class MIDIAccessPromise : public RefCounted<MIDIAccessPromise>, public ScriptWra
ppable, public ActiveDOMObject { | 51 class MIDIAccessPromise : public RefCounted<MIDIAccessPromise>, public ScriptWra
ppable, public ActiveDOMObject { |
52 public: | 52 public: |
53 static PassRefPtr<MIDIAccessPromise> create(ScriptExecutionContext*, const D
ictionary&); | 53 static PassRefPtr<MIDIAccessPromise> create(ScriptExecutionContext*, const D
ictionary&); |
54 virtual ~MIDIAccessPromise(); | 54 virtual ~MIDIAccessPromise(); |
55 | 55 |
56 void then(PassRefPtr<MIDISuccessCallback>, PassRefPtr<MIDIErrorCallback>); | 56 void then(PassRefPtr<MIDISuccessCallback>, PassRefPtr<MIDIErrorCallback>); |
57 | 57 |
58 // ActiveDOMObject | 58 // ActiveDOMObject |
59 virtual bool canSuspend() const OVERRIDE { return true; } | 59 virtual bool canSuspend() const OVERRIDE { return true; } |
60 | 60 |
| 61 MIDIOptions* options() { return m_options.get(); } |
| 62 |
61 void fulfill(); | 63 void fulfill(); |
62 void reject(DOMError*); | 64 void reject(PassRefPtr<DOMError>); |
63 | 65 |
64 private: | 66 private: |
65 enum State { | 67 enum State { |
66 Pending, | 68 Pending, |
67 Accepted, | 69 Accepted, |
68 Rejected, | 70 Rejected, |
69 Invoked, | 71 Invoked, |
70 }; | 72 }; |
71 | 73 |
72 MIDIAccessPromise(ScriptExecutionContext*, const Dictionary&); | 74 MIDIAccessPromise(ScriptExecutionContext*, const Dictionary&); |
73 | 75 |
74 State m_state; | 76 State m_state; |
75 RefPtr<MIDISuccessCallback> m_successCallback; | 77 RefPtr<MIDISuccessCallback> m_successCallback; |
76 RefPtr<MIDIErrorCallback> m_errorCallback; | 78 RefPtr<MIDIErrorCallback> m_errorCallback; |
77 OwnPtr<MIDIOptions> m_options; | 79 OwnPtr<MIDIOptions> m_options; |
78 RefPtr<DOMError> m_error; | 80 RefPtr<DOMError> m_error; |
79 RefPtr<MIDIAccess> m_access; | 81 RefPtr<MIDIAccess> m_access; |
80 }; | 82 }; |
81 | 83 |
82 } // namespace WebCore | 84 } // namespace WebCore |
83 | 85 |
84 #endif // MIDIAccessPromise_h | 86 #endif // MIDIAccessPromise_h |
OLD | NEW |