| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 } | 173 } |
| 174 | 174 |
| 175 DispatchEventResult IDBOpenDBRequest::DispatchEventInternal(Event* event) { | 175 DispatchEventResult IDBOpenDBRequest::DispatchEventInternal(Event* event) { |
| 176 // If the connection closed between onUpgradeNeeded and the delivery of the | 176 // If the connection closed between onUpgradeNeeded and the delivery of the |
| 177 // "success" event, an "error" event should be fired instead. | 177 // "success" event, an "error" event should be fired instead. |
| 178 if (event->type() == EventTypeNames::success && | 178 if (event->type() == EventTypeNames::success && |
| 179 ResultAsAny()->GetType() == IDBAny::kIDBDatabaseType && | 179 ResultAsAny()->GetType() == IDBAny::kIDBDatabaseType && |
| 180 ResultAsAny()->IdbDatabase()->IsClosePending()) { | 180 ResultAsAny()->IdbDatabase()->IsClosePending()) { |
| 181 DequeueEvent(event); | 181 DequeueEvent(event); |
| 182 SetResult(nullptr); | 182 SetResult(nullptr); |
| 183 EnqueueResponse( | 183 HandleResponse( |
| 184 DOMException::Create(kAbortError, "The connection was closed.")); | 184 DOMException::Create(kAbortError, "The connection was closed.")); |
| 185 return DispatchEventResult::kCanceledBeforeDispatch; | 185 return DispatchEventResult::kCanceledBeforeDispatch; |
| 186 } | 186 } |
| 187 | 187 |
| 188 return IDBRequest::DispatchEventInternal(event); | 188 return IDBRequest::DispatchEventInternal(event); |
| 189 } | 189 } |
| 190 | 190 |
| 191 } // namespace blink | 191 } // namespace blink |
| OLD | NEW |