| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 Persistent<IDBTransaction> m_transaction; | 95 Persistent<IDBTransaction> m_transaction; |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 } // namespace | 98 } // namespace |
| 99 | 99 |
| 100 IDBTransaction::IDBTransaction(ScriptState* scriptState, | 100 IDBTransaction::IDBTransaction(ScriptState* scriptState, |
| 101 int64_t id, | 101 int64_t id, |
| 102 const HashSet<String>& scope, | 102 const HashSet<String>& scope, |
| 103 WebIDBTransactionMode mode, | 103 WebIDBTransactionMode mode, |
| 104 IDBDatabase* db) | 104 IDBDatabase* db) |
| 105 : ActiveScriptWrappable(this), | 105 : ActiveScriptWrappable(), |
| 106 SuspendableObject(scriptState->getExecutionContext()), | 106 SuspendableObject(scriptState->getExecutionContext()), |
| 107 m_id(id), | 107 m_id(id), |
| 108 m_database(db), | 108 m_database(db), |
| 109 m_mode(mode), | 109 m_mode(mode), |
| 110 m_scope(scope) { | 110 m_scope(scope) { |
| 111 DCHECK(m_database); | 111 DCHECK(m_database); |
| 112 DCHECK(!m_scope.isEmpty()) << "Non-versionchange transactions must operate " | 112 DCHECK(!m_scope.isEmpty()) << "Non-versionchange transactions must operate " |
| 113 "on a well-defined set of stores"; | 113 "on a well-defined set of stores"; |
| 114 DCHECK(m_mode == WebIDBTransactionModeReadOnly || | 114 DCHECK(m_mode == WebIDBTransactionModeReadOnly || |
| 115 m_mode == WebIDBTransactionModeReadWrite) | 115 m_mode == WebIDBTransactionModeReadWrite) |
| 116 << "Invalid transaction mode"; | 116 << "Invalid transaction mode"; |
| 117 | 117 |
| 118 DCHECK_EQ(m_state, Active); | 118 DCHECK_EQ(m_state, Active); |
| 119 V8PerIsolateData::from(scriptState->isolate()) | 119 V8PerIsolateData::from(scriptState->isolate()) |
| 120 ->addEndOfScopeTask(DeactivateTransactionTask::create(this)); | 120 ->addEndOfScopeTask(DeactivateTransactionTask::create(this)); |
| 121 | 121 |
| 122 m_database->transactionCreated(this); | 122 m_database->transactionCreated(this); |
| 123 } | 123 } |
| 124 | 124 |
| 125 IDBTransaction::IDBTransaction(ExecutionContext* executionContext, | 125 IDBTransaction::IDBTransaction(ExecutionContext* executionContext, |
| 126 int64_t id, | 126 int64_t id, |
| 127 IDBDatabase* db, | 127 IDBDatabase* db, |
| 128 IDBOpenDBRequest* openDBRequest, | 128 IDBOpenDBRequest* openDBRequest, |
| 129 const IDBDatabaseMetadata& oldMetadata) | 129 const IDBDatabaseMetadata& oldMetadata) |
| 130 : ActiveScriptWrappable(this), | 130 : ActiveScriptWrappable(), |
| 131 SuspendableObject(executionContext), | 131 SuspendableObject(executionContext), |
| 132 m_id(id), | 132 m_id(id), |
| 133 m_database(db), | 133 m_database(db), |
| 134 m_openDBRequest(openDBRequest), | 134 m_openDBRequest(openDBRequest), |
| 135 m_mode(WebIDBTransactionModeVersionChange), | 135 m_mode(WebIDBTransactionModeVersionChange), |
| 136 m_state(Inactive), | 136 m_state(Inactive), |
| 137 m_oldDatabaseMetadata(oldMetadata) { | 137 m_oldDatabaseMetadata(oldMetadata) { |
| 138 DCHECK(m_database); | 138 DCHECK(m_database); |
| 139 DCHECK(m_openDBRequest); | 139 DCHECK(m_openDBRequest); |
| 140 DCHECK(m_scope.isEmpty()); | 140 DCHECK(m_scope.isEmpty()); |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 IDBObjectStore* objectStore = it.key; | 575 IDBObjectStore* objectStore = it.key; |
| 576 objectStore->clearIndexCache(); | 576 objectStore->clearIndexCache(); |
| 577 } | 577 } |
| 578 m_oldStoreMetadata.clear(); | 578 m_oldStoreMetadata.clear(); |
| 579 | 579 |
| 580 m_deletedIndexes.clear(); | 580 m_deletedIndexes.clear(); |
| 581 m_deletedObjectStores.clear(); | 581 m_deletedObjectStores.clear(); |
| 582 } | 582 } |
| 583 | 583 |
| 584 } // namespace blink | 584 } // namespace blink |
| OLD | NEW |