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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 m_state = Invoked; | 80 m_state = Invoked; |
81 ASSERT(m_access); | 81 ASSERT(m_access); |
82 m_successCallback->handleEvent(m_access.get(), m_options->sysex); | 82 m_successCallback->handleEvent(m_access.get(), m_options->sysex); |
83 clear(); | 83 clear(); |
84 } else { | 84 } else { |
85 m_state = Accepted; | 85 m_state = Accepted; |
86 } | 86 } |
87 } | 87 } |
88 } | 88 } |
89 | 89 |
90 void MIDIAccessPromise::reject(PassRefPtr<DOMError> error) | 90 void MIDIAccessPromise::reject(PassRefPtrWillBeRawPtr<DOMError> error) |
91 { | 91 { |
92 if (m_state == Pending) { | 92 if (m_state == Pending) { |
93 if (m_errorCallback) { | 93 if (m_errorCallback) { |
94 m_state = Invoked; | 94 m_state = Invoked; |
95 m_errorCallback->handleEvent(error.get()); | 95 m_errorCallback->handleEvent(error.get()); |
96 clear(); | 96 clear(); |
97 } else { | 97 } else { |
98 m_state = Rejected; | 98 m_state = Rejected; |
99 m_error = error; | 99 m_error = error; |
100 } | 100 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 ASSERT(m_state == Invoked); | 134 ASSERT(m_state == Invoked); |
135 m_access.clear(); | 135 m_access.clear(); |
136 m_error.clear(); | 136 m_error.clear(); |
137 m_options.clear(); | 137 m_options.clear(); |
138 m_successCallback.clear(); | 138 m_successCallback.clear(); |
139 m_errorCallback.clear(); | 139 m_errorCallback.clear(); |
140 } | 140 } |
141 | 141 |
142 void MIDIAccessPromise::trace(Visitor* visitor) | 142 void MIDIAccessPromise::trace(Visitor* visitor) |
143 { | 143 { |
| 144 visitor->trace(m_error); |
144 visitor->trace(m_access); | 145 visitor->trace(m_access); |
145 } | 146 } |
146 | 147 |
147 } // namespace WebCore | 148 } // namespace WebCore |
OLD | NEW |