chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction.cc

/*
 * Copyright (C) 2007, 2008, 2013 Apple 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.
 * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
 *     its contributors may be used to endorse or promote products derived
 *     from this software without specific prior written permission.
 *
 * 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.
 */

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "third_party/blink/renderer/modules/webdatabase/sql_transaction.h"

#include "third_party/blink/renderer/core/probe/core_probes.h"
#include "third_party/blink/renderer/modules/webdatabase/database.h"
#include "third_party/blink/renderer/modules/webdatabase/database_authorizer.h"
#include "third_party/blink/renderer/modules/webdatabase/database_context.h"
#include "third_party/blink/renderer/modules/webdatabase/database_thread.h"
#include "third_party/blink/renderer/modules/webdatabase/sql_error.h"
#include "third_party/blink/renderer/modules/webdatabase/sql_transaction_backend.h"
#include "third_party/blink/renderer/modules/webdatabase/sql_transaction_client.h"  // FIXME: Should be used in the backend only.
#include "third_party/blink/renderer/modules/webdatabase/storage_log.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/wtf/std_lib_extras.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"

namespace blink {

void SQLTransaction::OnProcessV8Impl::Trace(Visitor* visitor) const {}

bool SQLTransaction::OnProcessV8Impl::OnProcess(SQLTransaction* transaction) {}

void SQLTransaction::OnSuccessV8Impl::Trace(Visitor* visitor) const {}

void SQLTransaction::OnSuccessV8Impl::OnSuccess() {}

void SQLTransaction::OnErrorV8Impl::Trace(Visitor* visitor) const {}

bool SQLTransaction::OnErrorV8Impl::OnError(SQLError* error) {}

SQLTransaction* SQLTransaction::Create(Database* db,
                                       OnProcessCallback* callback,
                                       OnSuccessCallback* success_callback,
                                       OnErrorCallback* error_callback,
                                       bool read_only) {}

SQLTransaction::SQLTransaction(Database* db,
                               OnProcessCallback* callback,
                               OnSuccessCallback* success_callback,
                               OnErrorCallback* error_callback,
                               bool read_only)
    :{}

SQLTransaction::~SQLTransaction() = default;

void SQLTransaction::Trace(Visitor* visitor) const {}

bool SQLTransaction::HasCallback() const {}

bool SQLTransaction::HasSuccessCallback() const {}

bool SQLTransaction::HasErrorCallback() const {}

void SQLTransaction::SetBackend(SQLTransactionBackend* backend) {}

SQLTransaction::StateFunction SQLTransaction::StateFunctionFor(
    SQLTransactionState state) {}

// requestTransitToState() can be called from the backend. Hence, it should
// NOT be modifying SQLTransactionBackend in general. The only safe field to
// modify is m_requestedState which is meant for this purpose.
void SQLTransaction::RequestTransitToState(SQLTransactionState next_state) {}

SQLTransactionState SQLTransaction::NextStateForTransactionError() {}

SQLTransactionState SQLTransaction::DeliverTransactionCallback() {}

SQLTransactionState SQLTransaction::DeliverTransactionErrorCallback() {}

SQLTransactionState SQLTransaction::DeliverStatementCallback() {}

SQLTransactionState SQLTransaction::DeliverQuotaIncreaseCallback() {}

SQLTransactionState SQLTransaction::DeliverSuccessCallback() {}

// This state function is used as a stub function to plug unimplemented states
// in the state dispatch table. They are unimplemented because they should
// never be reached in the course of correct execution.
SQLTransactionState SQLTransaction::UnreachableState() {}

SQLTransactionState SQLTransaction::SendToBackendState() {}

void SQLTransaction::PerformPendingCallback() {}

void SQLTransaction::ExecuteSQL(const String& sql_statement,
                                const Vector<SQLValue>& arguments,
                                SQLStatement::OnSuccessCallback* callback,
                                SQLStatement::OnErrorCallback* callback_error,
                                ExceptionState& exception_state) {}

void SQLTransaction::executeSql(ScriptState* script_state,
                                const String& sql_statement,
                                ExceptionState& exception_state) {}

void SQLTransaction::executeSql(
    ScriptState* script_state,
    const String& sql_statement,
    const std::optional<HeapVector<ScriptValue>>& arguments,
    V8SQLStatementCallback* callback,
    V8SQLStatementErrorCallback* callback_error,
    ExceptionState& exception_state) {}

bool SQLTransaction::ComputeNextStateAndCleanupIfNeeded() {}

void SQLTransaction::ClearCallbacks() {}

SQLTransaction::OnErrorCallback* SQLTransaction::ReleaseErrorCallback() {}

}  // namespace blink