Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp

Issue 2578193004: Remove ActiveScriptWrappableBase::m_scriptWrappable (Closed)
Patch Set: temp Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 : SuspendableObject(scriptState->getExecutionContext()),
106 SuspendableObject(scriptState->getExecutionContext()),
107 m_id(id), 106 m_id(id),
108 m_database(db), 107 m_database(db),
109 m_mode(mode), 108 m_mode(mode),
110 m_scope(scope) { 109 m_scope(scope) {
111 DCHECK(m_database); 110 DCHECK(m_database);
112 DCHECK(!m_scope.isEmpty()) << "Non-versionchange transactions must operate " 111 DCHECK(!m_scope.isEmpty()) << "Non-versionchange transactions must operate "
113 "on a well-defined set of stores"; 112 "on a well-defined set of stores";
114 DCHECK(m_mode == WebIDBTransactionModeReadOnly || 113 DCHECK(m_mode == WebIDBTransactionModeReadOnly ||
115 m_mode == WebIDBTransactionModeReadWrite) 114 m_mode == WebIDBTransactionModeReadWrite)
116 << "Invalid transaction mode"; 115 << "Invalid transaction mode";
117 116
118 DCHECK_EQ(m_state, Active); 117 DCHECK_EQ(m_state, Active);
119 V8PerIsolateData::from(scriptState->isolate()) 118 V8PerIsolateData::from(scriptState->isolate())
120 ->addEndOfScopeTask(DeactivateTransactionTask::create(this)); 119 ->addEndOfScopeTask(DeactivateTransactionTask::create(this));
121 120
122 m_database->transactionCreated(this); 121 m_database->transactionCreated(this);
123 } 122 }
124 123
125 IDBTransaction::IDBTransaction(ExecutionContext* executionContext, 124 IDBTransaction::IDBTransaction(ExecutionContext* executionContext,
126 int64_t id, 125 int64_t id,
127 IDBDatabase* db, 126 IDBDatabase* db,
128 IDBOpenDBRequest* openDBRequest, 127 IDBOpenDBRequest* openDBRequest,
129 const IDBDatabaseMetadata& oldMetadata) 128 const IDBDatabaseMetadata& oldMetadata)
130 : ActiveScriptWrappable(this), 129 : SuspendableObject(executionContext),
131 SuspendableObject(executionContext),
132 m_id(id), 130 m_id(id),
133 m_database(db), 131 m_database(db),
134 m_openDBRequest(openDBRequest), 132 m_openDBRequest(openDBRequest),
135 m_mode(WebIDBTransactionModeVersionChange), 133 m_mode(WebIDBTransactionModeVersionChange),
136 m_state(Inactive), 134 m_state(Inactive),
137 m_oldDatabaseMetadata(oldMetadata) { 135 m_oldDatabaseMetadata(oldMetadata) {
138 DCHECK(m_database); 136 DCHECK(m_database);
139 DCHECK(m_openDBRequest); 137 DCHECK(m_openDBRequest);
140 DCHECK(m_scope.isEmpty()); 138 DCHECK(m_scope.isEmpty());
141 139
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 IDBObjectStore* objectStore = it.key; 573 IDBObjectStore* objectStore = it.key;
576 objectStore->clearIndexCache(); 574 objectStore->clearIndexCache();
577 } 575 }
578 m_oldStoreMetadata.clear(); 576 m_oldStoreMetadata.clear();
579 577
580 m_deletedIndexes.clear(); 578 m_deletedIndexes.clear();
581 m_deletedObjectStores.clear(); 579 m_deletedObjectStores.clear();
582 } 580 }
583 581
584 } // namespace blink 582 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698