OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 bool IDBOpenDBRequest::shouldEnqueueEvent() const | 155 bool IDBOpenDBRequest::shouldEnqueueEvent() const |
156 { | 156 { |
157 if (m_contextStopped || !executionContext()) | 157 if (m_contextStopped || !executionContext()) |
158 return false; | 158 return false; |
159 ASSERT(m_readyState == PENDING || m_readyState == DONE); | 159 ASSERT(m_readyState == PENDING || m_readyState == DONE); |
160 if (m_requestAborted) | 160 if (m_requestAborted) |
161 return false; | 161 return false; |
162 return true; | 162 return true; |
163 } | 163 } |
164 | 164 |
165 bool IDBOpenDBRequest::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) | 165 bool IDBOpenDBRequest::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event
) |
166 { | 166 { |
167 // If the connection closed between onUpgradeNeeded and the delivery of the
"success" event, | 167 // If the connection closed between onUpgradeNeeded and the delivery of the
"success" event, |
168 // an "error" event should be fired instead. | 168 // an "error" event should be fired instead. |
169 if (event->type() == EventTypeNames::success && resultAsAny()->type() == IDB
Any::IDBDatabaseType && resultAsAny()->idbDatabase()->isClosePending()) { | 169 if (event->type() == EventTypeNames::success && resultAsAny()->type() == IDB
Any::IDBDatabaseType && resultAsAny()->idbDatabase()->isClosePending()) { |
170 dequeueEvent(event.get()); | 170 dequeueEvent(event.get()); |
171 setResult(nullptr); | 171 setResult(nullptr); |
172 onError(DOMError::create(AbortError, "The connection was closed.")); | 172 onError(DOMError::create(AbortError, "The connection was closed.")); |
173 return false; | 173 return false; |
174 } | 174 } |
175 | 175 |
176 return IDBRequest::dispatchEvent(event); | 176 return IDBRequest::dispatchEventInternal(event); |
177 } | 177 } |
178 | 178 |
179 } // namespace blink | 179 } // namespace blink |
OLD | NEW |