30 const std::vector<std::string>& scope)
37 sqlite_transaction(nullptr) {
42 for (
const std::string&
name : scope) {
48 IDBTransaction::~IDBTransaction() {}
55 tracer->
Trace(&requests_);
56 for (
const auto& pair : scope_)
57 tracer->
Trace(&pair.second);
61 const std::string
name) {
68 if (scope_.count(name) == 0)
73 return scope_.at(name);
87 requests_.emplace_back(request);
101 RaiseEvent<events::Event>(EventType::Error);
109 for (
auto it = requests_.begin(); it != requests_.end(); it++) {
115 (*it)->PerformOperation(transaction);
128 RaiseEvent<events::Event>(EventType::Error);
132 RaiseEvent<events::Event>(EventType::Abort);
134 RaiseEvent<events::Event>(EventType::Complete);
138 DCHECK_EQ(scope_.count(name), 0u);
143 DCHECK_EQ(scope_.count(name), 1u);
160 NotImplemented(
"commit");
DatabaseStatus Rollback()
ExceptionOr< void > Abort()
void Trace(memory::HeapTracer *tracer) const override
SqliteTransaction * sqlite_transaction
void DeleteObjectStore(const std::string &name)
void Trace(const Traceable *ptr)
Member< dom::DOMException > error
void AddObjectStore(const std::string &name)
void DoCommit(SqliteConnection *connection)
ExceptionOr< RefPtr< IDBObjectStore > > ObjectStore(const std::string name)
static JsManagerImpl * Instance()
void Trace(memory::HeapTracer *tracer) const override
RefPtr< IDBRequest > AddRequest(RefPtr< IDBRequest > request)
IDBTransaction(RefPtr< IDBDatabase > db, IDBTransactionMode mode, const std::vector< std::string > &scope)
static JsError DOMException(ExceptionCode code)
const Member< IDBDatabase > db
const IDBTransactionMode mode
void AddListenerField(EventType type, Listener *on_field)
DatabaseStatus BeginTransaction(SqliteTransaction *transaction)