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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 return false; | 143 return false; |
144 return true; | 144 return true; |
145 } | 145 } |
146 | 146 |
147 bool IDBOpenDBRequest::dispatchEvent(PassRefPtr<Event> event) | 147 bool IDBOpenDBRequest::dispatchEvent(PassRefPtr<Event> event) |
148 { | 148 { |
149 // If the connection closed between onUpgradeNeeded and the delivery of the
"success" event, | 149 // If the connection closed between onUpgradeNeeded and the delivery of the
"success" event, |
150 // an "error" event should be fired instead. | 150 // an "error" event should be fired instead. |
151 if (event->type() == EventTypeNames::success && resultAsAny()->type() == IDB
Any::IDBDatabaseType && resultAsAny()->idbDatabase()->isClosePending()) { | 151 if (event->type() == EventTypeNames::success && resultAsAny()->type() == IDB
Any::IDBDatabaseType && resultAsAny()->idbDatabase()->isClosePending()) { |
152 dequeueEvent(event.get()); | 152 dequeueEvent(event.get()); |
153 setResult(0); | 153 setResult(nullptr); |
154 onError(DOMError::create(AbortError, "The connection was closed.")); | 154 onError(DOMError::create(AbortError, "The connection was closed.")); |
155 return false; | 155 return false; |
156 } | 156 } |
157 | 157 |
158 return IDBRequest::dispatchEvent(event); | 158 return IDBRequest::dispatchEvent(event); |
159 } | 159 } |
160 | 160 |
161 } // namespace WebCore | 161 } // namespace WebCore |
OLD | NEW |