#include "third_party/blink/renderer/modules/indexeddb/idb_transaction.h"
#include <memory>
#include <utility>
#include "base/auto_reset.h"
#include "base/format_macros.h"
#include "third_party/blink/public/mojom/indexeddb/indexeddb.mojom-blink.h"
#include "third_party/blink/renderer/bindings/core/v8/active_script_wrappable_creation_key.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/execution_context/agent.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/modules/indexed_db_names.h"
#include "third_party/blink/renderer/modules/indexeddb/idb_cursor.h"
#include "third_party/blink/renderer/modules/indexeddb/idb_database.h"
#include "third_party/blink/renderer/modules/indexeddb/idb_event_dispatcher.h"
#include "third_party/blink/renderer/modules/indexeddb/idb_index.h"
#include "third_party/blink/renderer/modules/indexeddb/idb_object_store.h"
#include "third_party/blink/renderer/modules/indexeddb/idb_open_db_request.h"
#include "third_party/blink/renderer/modules/indexeddb/idb_request_queue_item.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/bindings/v8_per_isolate_data.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/scheduler/public/event_loop.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
namespace blink {
IDBTransaction* IDBTransaction::CreateNonVersionChange(
ScriptState* script_state,
TransactionMojoRemote remote,
int64_t id,
const HashSet<String>& scope,
mojom::blink::IDBTransactionMode mode,
mojom::blink::IDBTransactionDurability durability,
IDBDatabase* db) { … }
IDBTransaction* IDBTransaction::CreateVersionChange(
ExecutionContext* execution_context,
TransactionMojoRemote remote,
int64_t id,
IDBDatabase* db,
IDBOpenDBRequest* open_db_request,
const IDBDatabaseMetadata& old_metadata) { … }
IDBTransaction::IDBTransaction(
ScriptState* script_state,
TransactionMojoRemote remote,
int64_t id,
const HashSet<String>& scope,
mojom::blink::IDBTransactionMode mode,
mojom::blink::IDBTransactionDurability durability,
IDBDatabase* db)
: … { … }
IDBTransaction::IDBTransaction(ExecutionContext* execution_context,
TransactionMojoRemote remote,
int64_t id,
IDBDatabase* db,
IDBOpenDBRequest* open_db_request,
const IDBDatabaseMetadata& old_metadata)
: … { … }
IDBTransaction::~IDBTransaction() { … }
void IDBTransaction::Trace(Visitor* visitor) const { … }
void IDBTransaction::SetError(DOMException* error) { … }
IDBObjectStore* IDBTransaction::objectStore(const String& name,
ExceptionState& exception_state) { … }
void IDBTransaction::ObjectStoreCreated(const String& name,
IDBObjectStore* object_store) { … }
void IDBTransaction::ObjectStoreDeleted(const int64_t object_store_id,
const String& name) { … }
void IDBTransaction::ObjectStoreRenamed(const String& old_name,
const String& new_name) { … }
void IDBTransaction::IndexDeleted(IDBIndex* index) { … }
void IDBTransaction::SetActive(bool new_is_active) { … }
void IDBTransaction::SetActiveDuringSerialization(bool new_is_active) { … }
void IDBTransaction::abort(ExceptionState& exception_state) { … }
void IDBTransaction::commit(ExceptionState& exception_state) { … }
void IDBTransaction::RegisterRequest(IDBRequest* request) { … }
void IDBTransaction::UnregisterRequest(IDBRequest* request) { … }
void IDBTransaction::EnqueueResult(
std::unique_ptr<IDBRequestQueueItem> result) { … }
void IDBTransaction::OnResultReady() { … }
void IDBTransaction::OnAbort(DOMException* error) { … }
void IDBTransaction::OnComplete() { … }
void IDBTransaction::StartAborting(DOMException* error, bool from_frontend) { … }
void IDBTransaction::CreateObjectStore(int64_t object_store_id,
const String& name,
const IDBKeyPath& key_path,
bool auto_increment) { … }
void IDBTransaction::DeleteObjectStore(int64_t object_store_id) { … }
void IDBTransaction::Put(int64_t object_store_id,
std::unique_ptr<IDBValue> value,
std::unique_ptr<IDBKey> primary_key,
mojom::blink::IDBPutMode put_mode,
Vector<IDBIndexKeys> index_keys,
mojom::blink::IDBTransaction::PutCallback callback) { … }
void IDBTransaction::FlushForTesting() { … }
bool IDBTransaction::HasPendingActivity() const { … }
mojom::blink::IDBTransactionMode IDBTransaction::StringToMode(
const String& mode_string) { … }
const String& IDBTransaction::mode() const { … }
const String& IDBTransaction::durability() const { … }
DOMStringList* IDBTransaction::objectStoreNames() const { … }
const AtomicString& IDBTransaction::InterfaceName() const { … }
ExecutionContext* IDBTransaction::GetExecutionContext() const { … }
const char* IDBTransaction::InactiveErrorMessage() const { … }
DispatchEventResult IDBTransaction::DispatchEventInternal(Event& event) { … }
void IDBTransaction::AbortOutstandingRequests(bool queue_tasks) { … }
void IDBTransaction::RevertDatabaseMetadata() { … }
void IDBTransaction::Finished() { … }
}