#include "third_party/blink/renderer/modules/indexeddb/idb_cursor.h"
#include <limits>
#include <memory>
#include <utility>
#include "base/check.h"
#include "third_party/blink/renderer/bindings/core/v8/to_v8_traits.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_binding_for_modules.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_idb_request.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_union_idbcursor_idbindex_idbobjectstore.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_union_idbindex_idbobjectstore.h"
#include "third_party/blink/renderer/modules/indexed_db_names.h"
#include "third_party/blink/renderer/modules/indexeddb/idb_any.h"
#include "third_party/blink/renderer/modules/indexeddb/idb_cursor_with_value.h"
#include "third_party/blink/renderer/modules/indexeddb/idb_database.h"
#include "third_party/blink/renderer/modules/indexeddb/idb_object_store.h"
#include "third_party/blink/renderer/modules/indexeddb/idb_request.h"
#include "third_party/blink/renderer/modules/indexeddb/idb_transaction.h"
#include "third_party/blink/renderer/modules/indexeddb/idb_value.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_private_property.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/member.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/wtf/casting.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "third_party/blink/renderer/platform/wtf/thread_specific.h"
namespace blink {
namespace {
CursorSet;
CursorSet& GetGlobalCursorSet() { … }
void RegisterCursor(IDBCursor* cursor) { … }
}
IDBCursor::IDBCursor(
mojo::PendingAssociatedRemote<mojom::blink::IDBCursor> pending_cursor,
mojom::IDBCursorDirection direction,
IDBRequest* request,
const Source* source,
IDBTransaction* transaction)
: … { … }
IDBCursor::~IDBCursor() = default;
void IDBCursor::Trace(Visitor* visitor) const { … }
void IDBCursor::ContextWillBeDestroyed() { … }
v8::Local<v8::Object> IDBCursor::AssociateWithWrapper(
v8::Isolate* isolate,
const WrapperTypeInfo* wrapper_type,
v8::Local<v8::Object> wrapper) { … }
IDBRequest* IDBCursor::update(ScriptState* script_state,
const ScriptValue& value,
ExceptionState& exception_state) { … }
void IDBCursor::advance(unsigned count, ExceptionState& exception_state) { … }
void IDBCursor::Continue(ScriptState* script_state,
const ScriptValue& key_value,
ExceptionState& exception_state) { … }
void IDBCursor::continuePrimaryKey(ScriptState* script_state,
const ScriptValue& key_value,
const ScriptValue& primary_key_value,
ExceptionState& exception_state) { … }
void IDBCursor::Continue(std::unique_ptr<IDBKey> key,
std::unique_ptr<IDBKey> primary_key,
IDBRequest::AsyncTraceState metrics,
ExceptionState& exception_state) { … }
IDBRequest* IDBCursor::Delete(ScriptState* script_state,
ExceptionState& exception_state) { … }
void IDBCursor::Close() { … }
ScriptValue IDBCursor::key(ScriptState* script_state) { … }
ScriptValue IDBCursor::primaryKey(ScriptState* script_state) { … }
ScriptValue IDBCursor::value(ScriptState* script_state) { … }
const IDBCursor::Source* IDBCursor::source() const { … }
void IDBCursor::SetValueReady(std::unique_ptr<IDBKey> key,
std::unique_ptr<IDBKey> primary_key,
std::unique_ptr<IDBValue> value) { … }
const IDBKey* IDBCursor::IdbPrimaryKey() const { … }
IDBObjectStore* IDBCursor::EffectiveObjectStore() const { … }
bool IDBCursor::IsDeleted() const { … }
mojom::IDBCursorDirection IDBCursor::StringToDirection(
const String& direction_string) { … }
void IDBCursor::ResetCursorPrefetchCaches(int64_t transaction_id,
IDBCursor* except_cursor) { … }
const String& IDBCursor::direction() const { … }
void IDBCursor::AdvanceImpl(uint32_t count, IDBRequest* request) { … }
void IDBCursor::AdvanceCallback(IDBRequest* request,
mojom::blink::IDBCursorResultPtr result) { … }
void IDBCursor::CursorContinue(const IDBKey* key,
const IDBKey* primary_key,
IDBRequest* request) { … }
void IDBCursor::PrefetchCallback(IDBRequest* request,
mojom::blink::IDBCursorResultPtr result) { … }
void IDBCursor::PostSuccessHandlerCallback() { … }
void IDBCursor::SetPrefetchData(Vector<std::unique_ptr<IDBKey>> keys,
Vector<std::unique_ptr<IDBKey>> primary_keys,
Vector<std::unique_ptr<IDBValue>> values) { … }
void IDBCursor::CachedAdvance(uint32_t count, IDBRequest* request) { … }
void IDBCursor::CachedContinue(IDBRequest* request) { … }
void IDBCursor::ResetPrefetchCache() { … }
int64_t IDBCursor::GetTransactionId() const { … }
bool IDBCursor::CheckForCommonExceptions(ExceptionState& exception_state,
const char* read_only_error_message) { … }
}