chromium/third_party/blink/renderer/modules/indexeddb/idb_cursor.cc

/*
 * Copyright (C) 2010 Google Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1.  Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 * 2.  Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#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) {}

}  // namespace

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() {}

// Keep the request's wrapper alive as long as the cursor's wrapper is alive,
// so that the same script object is seen each time the cursor is used.
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 {}

// static
mojom::IDBCursorDirection IDBCursor::StringToDirection(
    const String& direction_string) {}

// static
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) {}

}  // namespace blink