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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 } | 125 } |
126 | 126 |
127 void IDBOpenDBRequest::OnSuccess(std::unique_ptr<WebIDBDatabase> backend, | 127 void IDBOpenDBRequest::OnSuccess(std::unique_ptr<WebIDBDatabase> backend, |
128 const IDBDatabaseMetadata& metadata) { | 128 const IDBDatabaseMetadata& metadata) { |
129 IDB_TRACE("IDBOpenDBRequest::onSuccess()"); | 129 IDB_TRACE("IDBOpenDBRequest::onSuccess()"); |
130 if (!ShouldEnqueueEvent()) | 130 if (!ShouldEnqueueEvent()) |
131 return; | 131 return; |
132 | 132 |
133 IDBDatabase* idb_database = nullptr; | 133 IDBDatabase* idb_database = nullptr; |
134 if (ResultAsAny()) { | 134 if (ResultAsAny()) { |
135 // Previous onUpgradeNeeded call delivered the backend. | 135 // Previous OnUpgradeNeeded call delivered the backend. |
136 DCHECK(!backend.get()); | 136 DCHECK(!backend.get()); |
137 idb_database = ResultAsAny()->IdbDatabase(); | 137 idb_database = ResultAsAny()->IdbDatabase(); |
138 DCHECK(idb_database); | 138 DCHECK(idb_database); |
139 DCHECK(!database_callbacks_); | 139 DCHECK(!database_callbacks_); |
140 } else { | 140 } else { |
141 DCHECK(backend.get()); | 141 DCHECK(backend.get()); |
142 DCHECK(database_callbacks_); | 142 DCHECK(database_callbacks_); |
143 idb_database = | 143 idb_database = |
144 IDBDatabase::Create(GetExecutionContext(), std::move(backend), | 144 IDBDatabase::Create(GetExecutionContext(), std::move(backend), |
145 database_callbacks_.Release(), isolate_); | 145 database_callbacks_.Release(), isolate_); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 DequeueEvent(event); | 180 DequeueEvent(event); |
181 SetResult(nullptr); | 181 SetResult(nullptr); |
182 OnError(DOMException::Create(kAbortError, "The connection was closed.")); | 182 OnError(DOMException::Create(kAbortError, "The connection was closed.")); |
183 return DispatchEventResult::kCanceledBeforeDispatch; | 183 return DispatchEventResult::kCanceledBeforeDispatch; |
184 } | 184 } |
185 | 185 |
186 return IDBRequest::DispatchEventInternal(event); | 186 return IDBRequest::DispatchEventInternal(event); |
187 } | 187 } |
188 | 188 |
189 } // namespace blink | 189 } // namespace blink |
OLD | NEW |