diff options
Diffstat (limited to 'chromium/third_party/blink/public/platform/modules/indexeddb')
11 files changed, 0 insertions, 814 deletions
diff --git a/chromium/third_party/blink/public/platform/modules/indexeddb/indexed_db_key_builder.h b/chromium/third_party/blink/public/platform/modules/indexeddb/indexed_db_key_builder.h deleted file mode 100644 index 28a5e8fad19..00000000000 --- a/chromium/third_party/blink/public/platform/modules/indexeddb/indexed_db_key_builder.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_INDEXED_DB_KEY_BUILDER_H_ -#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_INDEXED_DB_KEY_BUILDER_H_ - -#include "third_party/blink/public/common/indexeddb/indexeddb_key.h" -#include "third_party/blink/public/common/indexeddb/indexeddb_key_path.h" -#include "third_party/blink/public/platform/modules/indexeddb/web_idb_key.h" -#include "third_party/blink/public/platform/web_common.h" - -namespace blink { - -class IndexedDBKeyRange; -class WebIDBKeyPath; -class WebIDBKeyRange; - -class BLINK_EXPORT IndexedDBKeyBuilder { - public: - static IndexedDBKey Build(WebIDBKeyView key); - - private: - DISALLOW_COPY_AND_ASSIGN(IndexedDBKeyBuilder); -}; - -class BLINK_EXPORT WebIDBKeyBuilder { - public: - static WebIDBKey Build(const IndexedDBKey& key); - static WebIDBKey Build(const WebIDBKeyView& key); - - private: - DISALLOW_COPY_AND_ASSIGN(WebIDBKeyBuilder); -}; - -class BLINK_EXPORT IndexedDBKeyRangeBuilder { - public: - static IndexedDBKeyRange Build(const WebIDBKeyRange& key_range); - - // Builds a point range (containing a single key). - static IndexedDBKeyRange Build(WebIDBKeyView key); - - private: - DISALLOW_COPY_AND_ASSIGN(IndexedDBKeyRangeBuilder); -}; - -class BLINK_EXPORT WebIDBKeyRangeBuilder { - public: - static WebIDBKeyRange Build(const IndexedDBKeyRange& key); - - // Builds a point range (containing a single key). - static WebIDBKeyRange Build(WebIDBKeyView key); - - private: - DISALLOW_COPY_AND_ASSIGN(WebIDBKeyRangeBuilder); -}; - -class BLINK_EXPORT IndexedDBKeyPathBuilder { - public: - static IndexedDBKeyPath Build(const WebIDBKeyPath& key_path); - - private: - DISALLOW_COPY_AND_ASSIGN(IndexedDBKeyPathBuilder); -}; - -class BLINK_EXPORT WebIDBKeyPathBuilder { - public: - static WebIDBKeyPath Build(const IndexedDBKeyPath& key_path); - - private: - DISALLOW_COPY_AND_ASSIGN(WebIDBKeyPathBuilder); -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_INDEXED_DB_KEY_BUILDER_H_ diff --git a/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_callbacks.h b/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_callbacks.h deleted file mode 100644 index 65d1ff386f5..00000000000 --- a/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_callbacks.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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. - */ - -#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_CALLBACKS_H_ -#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_CALLBACKS_H_ - -#include "third_party/blink/public/mojom/indexeddb/indexeddb.mojom-shared.h" -#include "third_party/blink/public/platform/web_common.h" -#include "third_party/blink/public/platform/web_string.h" -#include "third_party/blink/public/platform/web_vector.h" - -namespace blink { - -class WebIDBCursor; -class WebIDBDatabase; -class WebIDBDatabaseError; -class WebIDBKey; -struct WebIDBMetadata; -struct WebIDBNameAndVersion; -class WebIDBValue; - -class WebIDBCallbacks { - public: - virtual ~WebIDBCallbacks() = default; - - // Pointers transfer ownership. - virtual void OnError(const WebIDBDatabaseError&) = 0; - virtual void OnSuccess(const WebVector<WebIDBNameAndVersion>&) = 0; - virtual void OnSuccess(const WebVector<WebString>&) = 0; - virtual void OnSuccess(WebIDBCursor*, - WebIDBKey, - WebIDBKey primary_key, - WebIDBValue) = 0; - virtual void OnSuccess(WebIDBDatabase*, const WebIDBMetadata&) = 0; - virtual void OnSuccess(WebIDBKey) = 0; - virtual void OnSuccess(WebIDBValue) = 0; - virtual void OnSuccess(WebVector<WebIDBValue>) = 0; - virtual void OnSuccess(long long) = 0; - virtual void OnSuccess() = 0; - virtual void OnSuccess(WebIDBKey, WebIDBKey primary_key, WebIDBValue) = 0; - virtual void OnBlocked(long long old_version) = 0; - virtual void OnUpgradeNeeded(long long old_version, - WebIDBDatabase*, - const WebIDBMetadata&, - mojom::IDBDataLoss data_loss, - WebString data_loss_message) = 0; - virtual void Detach() = 0; -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_CALLBACKS_H_ diff --git a/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_database_callbacks.h b/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_database_callbacks.h deleted file mode 100644 index deac9f44d73..00000000000 --- a/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_database_callbacks.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2011 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. - */ - -#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_DATABASE_CALLBACKS_H_ -#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_DATABASE_CALLBACKS_H_ - -#include "third_party/blink/public/platform/modules/indexeddb/web_idb_database_error.h" -#include "third_party/blink/public/platform/web_common.h" -#include "third_party/blink/public/platform/web_vector.h" - -#include <unordered_map> -#include <utility> -#include <vector> - -namespace blink { - -struct WebIDBObservation; - -class WebIDBDatabaseCallbacks { - public: - using ObservationIndexMap = std::unordered_map<int32_t, WebVector<int32_t>>; - - // Maps observer to transaction, which needs an id and a scope. - using TransactionMap = - std::unordered_map<int32_t, std::pair<int64_t, WebVector<int64_t>>>; - - virtual ~WebIDBDatabaseCallbacks() = default; - - virtual void OnForcedClose() = 0; - virtual void OnVersionChange(long long old_version, - long long new_version) = 0; - - virtual void OnAbort(long long transaction_id, - const WebIDBDatabaseError&) = 0; - virtual void OnComplete(long long transaction_id) = 0; - virtual void OnChanges(const ObservationIndexMap&, - WebVector<WebIDBObservation> observations, - const TransactionMap& transactions) = 0; - virtual void Detach() = 0; -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_DATABASE_CALLBACKS_H_ diff --git a/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_database_error.h b/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_database_error.h deleted file mode 100644 index f6dc017f550..00000000000 --- a/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_database_error.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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. - * 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. - */ - -#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_DATABASE_ERROR_H_ -#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_DATABASE_ERROR_H_ - -#include "third_party/blink/public/platform/web_common.h" -#include "third_party/blink/public/platform/web_string.h" - -namespace blink { - -class WebIDBDatabaseError { - public: - explicit WebIDBDatabaseError(unsigned short code) : code_(code) {} - - WebIDBDatabaseError(unsigned short code, const WebString& message) - : code_(code), message_(message) {} - - WebIDBDatabaseError(const WebIDBDatabaseError& error) = default; - - ~WebIDBDatabaseError() = default; - - WebIDBDatabaseError& operator=(const WebIDBDatabaseError& error) = default; - - unsigned short Code() const { return code_; } - const WebString& Message() const { return message_; } - - private: - unsigned short code_; - WebString message_; -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_DATABASE_ERROR_H_ diff --git a/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_key.h b/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_key.h deleted file mode 100644 index afd027054f6..00000000000 --- a/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_key.h +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (C) 2011 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. - */ - -#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_KEY_H_ -#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_KEY_H_ - -#include <memory> - -#include "third_party/blink/public/common/indexeddb/web_idb_types.h" -#include "third_party/blink/public/platform/web_common.h" -#include "third_party/blink/public/platform/web_data.h" -#include "third_party/blink/public/platform/web_private_ptr.h" -#include "third_party/blink/public/platform/web_string.h" -#include "third_party/blink/public/platform/web_vector.h" - -namespace blink { - -class IDBKey; -class WebIDBKeyView; - -// Minimal interface for iterating over an IndexedDB array key. -// -// See WebIDBKeyView for the rationale behind this class' existence. -class WebIDBKeyArrayView { - public: - BLINK_EXPORT size_t size() const; - - BLINK_EXPORT WebIDBKeyView operator[](size_t index) const; - - private: - // Only WebIDBKeyView can vend WebIDBArrayKeyView instances. - friend class WebIDBKeyView; - explicit WebIDBKeyArrayView(const IDBKey* idb_key) : private_(idb_key) {} - - const IDBKey* const private_; -}; - -// Non-owning reference to an IndexedDB key. -// -// The Blink object wrapped by WebIDBKey is immutable, so WebIDBKeyView -// instances are implicitly const references. -// -// Having both WebIDBKeyView and WebIDBKey is extra complexity, and we pay this -// price to avoid unnecessary memory copying. Specifically, WebIDBKeyView is -// used to issue requests to the IndexedDB backing store. -// -// For example, IDBCursor.update() must send the cursor's primary key to the -// backing store. IDBCursor cannot give up the ownership of its primary key, -// because it might need to satisfy further update() or delete() calls. -class WebIDBKeyView { - public: - WebIDBKeyView(const WebIDBKeyView&) noexcept = default; - - explicit WebIDBKeyView(const IDBKey* idb_key) noexcept : private_(idb_key) {} - - BLINK_EXPORT WebIDBKeyType KeyType() const; - - BLINK_EXPORT bool IsValid() const; - - // Only valid for ArrayType. - // - // The caller is responsible for ensuring that the WebIDBKeyView is valid for - // the lifetime of the returned WeIDBKeyArrayView. - BLINK_EXPORT const WebIDBKeyArrayView ArrayView() const { - return WebIDBKeyArrayView(private_); - } - - // Only valid for BinaryType. - BLINK_EXPORT WebData Binary() const; - - // Only valid for StringType. - BLINK_EXPORT WebString String() const; - - // Only valid for DateType. - BLINK_EXPORT double Date() const; - - // Only valid for NumberType. - BLINK_EXPORT double Number() const; - - BLINK_EXPORT size_t SizeEstimate() const; - - // TODO(cmp): Ensure |private_| can never be null. - // - // SizeEstimate() can be called when |private_| is null. That happens if and - // only if the |WebIDBKey| instance is created using WebIDBKey::CreateNull(). - // - // Eventually, WebIDBKey::CreateNull() will change so that case will lead to - // a non-null |private_|. At that time, this null check can change to a - // DCHECK that |private_| is not null and the special null case handling can - // be removed. - BLINK_EXPORT bool IsNull() const { return !private_; } - - private: - const IDBKey* const private_; -}; - -// Move-only handler that owns an IndexedDB key. -// -// The wrapped Blink object wrapped is immutable while it is owned by the -// WebIDBKey. -// -// Having both WebIDBKeyView and WebIDBKeyArrayView is extra complexity, and we -// pay this price to avoid unnecessary memory copying. Specifically, WebIDBKey -// is used to receive data from the IndexedDB backing store. Once constructed, a -// WebIDBKey is moved through the layer cake until the underlying Blink object -// ends up at its final destination. -class WebIDBKey { - public: - BLINK_EXPORT static WebIDBKey CreateArray(WebVector<WebIDBKey>); - BLINK_EXPORT static WebIDBKey CreateBinary(const WebData&); - BLINK_EXPORT static WebIDBKey CreateString(const WebString&); - BLINK_EXPORT static WebIDBKey CreateDate(double); - BLINK_EXPORT static WebIDBKey CreateNumber(double); - BLINK_EXPORT static WebIDBKey CreateInvalid(); - BLINK_EXPORT static WebIDBKey CreateNull() noexcept { return WebIDBKey(); } - - // The default constructor must not be used explicitly. - // It is only provided for WebVector and Mojo's use. - BLINK_EXPORT WebIDBKey() noexcept; - - BLINK_EXPORT WebIDBKey(WebIDBKey&&) noexcept; - BLINK_EXPORT WebIDBKey& operator=(WebIDBKey&&) noexcept; - - // TODO(cmp): Remove copy and assignment constructors when Vector<->WebVector - // conversions are no longer needed. - BLINK_EXPORT WebIDBKey(const WebIDBKey& rkey); - BLINK_EXPORT WebIDBKey& operator=(const WebIDBKey& rkey); - - BLINK_EXPORT ~WebIDBKey(); - - BLINK_EXPORT WebIDBKeyView View() const { - return WebIDBKeyView(private_.get()); - } - - BLINK_EXPORT size_t SizeEstimate() const { return View().SizeEstimate(); } - -#if INSIDE_BLINK - explicit WebIDBKey(std::unique_ptr<IDBKey>) noexcept; - WebIDBKey& operator=(std::unique_ptr<IDBKey>) noexcept; - operator IDBKey*() const noexcept { return private_.get(); } - - std::unique_ptr<IDBKey> ReleaseIdbKey() noexcept; -#endif // INSIDE_BLINK - - private: - - std::unique_ptr<IDBKey> private_; -}; - -using WebIDBIndexKeys = std::pair<int64_t, WebVector<WebIDBKey>>; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_KEY_H_ diff --git a/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_key_path.h b/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_key_path.h deleted file mode 100644 index 3ceceab17f1..00000000000 --- a/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_key_path.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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. - */ - -#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_KEY_PATH_H_ -#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_KEY_PATH_H_ - -#include "third_party/blink/public/common/indexeddb/web_idb_types.h" -#include "third_party/blink/public/platform/web_common.h" -#include "third_party/blink/public/platform/web_string.h" -#include "third_party/blink/public/platform/web_vector.h" - -namespace blink { - -class WebIDBKeyPath { - public: - // FIXME: Update callers use constructors directly, and remove these. - static WebIDBKeyPath Create(const WebString& string) { - return WebIDBKeyPath(string); - } - static WebIDBKeyPath Create(const WebVector<WebString>& array) { - return WebIDBKeyPath(array); - } - static WebIDBKeyPath CreateNull() { return WebIDBKeyPath(); } - - WebIDBKeyPath() : type_(kWebIDBKeyPathTypeNull) {} - - explicit WebIDBKeyPath(const WebString& string) - : type_(kWebIDBKeyPathTypeString), string_(string) {} - - explicit WebIDBKeyPath(const WebVector<WebString>& array) - : type_(kWebIDBKeyPathTypeArray), array_(array) {} - - WebIDBKeyPath(const WebIDBKeyPath& key_path) = default; - - ~WebIDBKeyPath() = default; - - WebIDBKeyPath& operator=(const WebIDBKeyPath& key_path) = default; - - WebIDBKeyPathType KeyPathType() const { return type_; } - - // Only valid for ArrayType. - const WebVector<WebString>& Array() const { return array_; } - - // Only valid for StringType. - const WebString& String() const { return string_; } - - private: - WebIDBKeyPathType type_; - WebVector<WebString> array_; - WebString string_; -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_KEY_PATH_H_ diff --git a/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_key_range.h b/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_key_range.h deleted file mode 100644 index 79be20ae4fc..00000000000 --- a/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_key_range.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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. - */ - -#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_KEY_RANGE_H_ -#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_KEY_RANGE_H_ - -#include "third_party/blink/public/platform/modules/indexeddb/web_idb_key.h" -#include "third_party/blink/public/platform/web_common.h" -#include "third_party/blink/public/platform/web_private_ptr.h" - -namespace blink { - -class IDBKeyRange; - -class WebIDBKeyRange { - public: - ~WebIDBKeyRange() { Reset(); } - - WebIDBKeyRange() = default; - WebIDBKeyRange(const WebIDBKeyRange& key_range) { Assign(key_range); } - WebIDBKeyRange(WebIDBKey lower, - WebIDBKey upper, - bool lower_open, - bool upper_open) { - Assign(std::move(lower), std::move(upper), lower_open, upper_open); - } - - BLINK_EXPORT WebIDBKeyView Lower() const; - BLINK_EXPORT WebIDBKeyView Upper() const; - BLINK_EXPORT bool LowerOpen() const; - BLINK_EXPORT bool UpperOpen() const; - - BLINK_EXPORT void Assign(const WebIDBKeyRange&); - BLINK_EXPORT void Assign(WebIDBKey lower, - WebIDBKey upper, - bool lower_open, - bool upper_open); - - WebIDBKeyRange& operator=(const WebIDBKeyRange& e) { - Assign(e); - return *this; - } - - BLINK_EXPORT void Reset(); - -#if INSIDE_BLINK - WebIDBKeyRange(IDBKeyRange* value) : private_(value) {} - WebIDBKeyRange& operator=(IDBKeyRange* value) { - private_ = value; - return *this; - } - operator IDBKeyRange*() const { return private_.Get(); } -#endif - - private: - WebPrivatePtr<IDBKeyRange> private_; -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_KEY_RANGE_H_ diff --git a/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_metadata.h b/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_metadata.h deleted file mode 100644 index 5be6cdbf9e3..00000000000 --- a/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_metadata.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2012 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. - */ - -#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_METADATA_H_ -#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_METADATA_H_ - -#include "third_party/blink/public/platform/modules/indexeddb/web_idb_key_path.h" -#include "third_party/blink/public/platform/web_common.h" -#include "third_party/blink/public/platform/web_string.h" -#include "third_party/blink/public/platform/web_vector.h" - -namespace blink { - -struct WebIDBMetadata { - enum { kNoVersion = -1 }; - struct Index; - struct ObjectStore; - - WebString name; - long long version; - long long id; - long long max_object_store_id; - WebVector<ObjectStore> object_stores; - WebIDBMetadata() : version(kNoVersion) {} - - struct ObjectStore { - WebString name; - WebIDBKeyPath key_path; - bool auto_increment; - long long id; - long long max_index_id; - WebVector<Index> indexes; - ObjectStore() - : key_path(WebIDBKeyPath::CreateNull()), auto_increment(false) {} - }; - - struct Index { - WebString name; - WebIDBKeyPath key_path; - bool unique; - bool multi_entry; - long long id; - Index() - : key_path(WebIDBKeyPath::CreateNull()), - unique(false), - multi_entry(false) {} - }; -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_METADATA_H_ diff --git a/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_name_and_version.h b/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_name_and_version.h deleted file mode 100644 index 6368c4aafaf..00000000000 --- a/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_name_and_version.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_NAME_AND_VERSION_H_ -#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_NAME_AND_VERSION_H_ - -#include "third_party/blink/public/platform/web_string.h" - -namespace blink { - -struct WebIDBNameAndVersion { - enum { kNoVersion = -1 }; - WebString name; - int64_t version; - - WebIDBNameAndVersion() : version(kNoVersion) {} - WebIDBNameAndVersion(WebString name, int64_t version) - : name(name), version(version) {} -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_NAME_AND_VERSION_H_ diff --git a/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_observation.h b/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_observation.h deleted file mode 100644 index 3ba4de6e5dd..00000000000 --- a/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_observation.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_OBSERVATION_H_ -#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_OBSERVATION_H_ - -#include "third_party/blink/public/common/indexeddb/web_idb_types.h" -#include "third_party/blink/public/mojom/indexeddb/indexeddb.mojom-shared.h" -#include "third_party/blink/public/platform/modules/indexeddb/web_idb_key_range.h" -#include "third_party/blink/public/platform/modules/indexeddb/web_idb_value.h" - -namespace blink { - -struct WebIDBObservation { - int64_t object_store_id; - mojom::IDBOperationType type; - WebIDBKeyRange key_range; - WebIDBValue value; - - WebIDBObservation(int64_t object_store_id, - mojom::IDBOperationType type, - WebIDBKeyRange key_range, - WebIDBValue value) - : object_store_id(object_store_id), - type(type), - key_range(key_range), - value(std::move(value)) {} - - WebIDBObservation(WebIDBObservation&&) = default; - WebIDBObservation& operator=(WebIDBObservation&&) = default; - - private: - // WebIDBObservation has to be move-only, because WebIDBValue is move-only. - // Making the restriction explicit results in slightly better compilation - // error messages in code that attempts copying. - WebIDBObservation(const WebIDBObservation&) = delete; - WebIDBObservation& operator=(const WebIDBObservation&) = delete; -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_OBSERVATION_H_ diff --git a/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_value.h b/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_value.h deleted file mode 100644 index e090e63106f..00000000000 --- a/chromium/third_party/blink/public/platform/modules/indexeddb/web_idb_value.h +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_VALUE_H_ -#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_VALUE_H_ - -#include <memory> -#include <utility> - -#include "third_party/blink/public/platform/modules/indexeddb/web_idb_key.h" -#include "third_party/blink/public/platform/web_blob_info.h" -#include "third_party/blink/public/platform/web_common.h" -#include "third_party/blink/public/platform/web_vector.h" - -namespace blink { - -class IDBValue; -class WebData; -class WebIDBKeyPath; - -// Handle to an IndexedDB Object Store value retrieved from the backing store. -class WebIDBValue { - public: - BLINK_EXPORT WebIDBValue(const WebData&, const WebVector<WebBlobInfo>&); - - BLINK_EXPORT WebIDBValue(WebIDBValue&& other) noexcept; - BLINK_EXPORT WebIDBValue& operator=(WebIDBValue&&) noexcept; - - BLINK_EXPORT ~WebIDBValue(); - - // Used by object stores that store primary keys separately from wire data. - BLINK_EXPORT void SetInjectedPrimaryKey( - WebIDBKey primary_key, - const WebIDBKeyPath& primary_key_path); - - // Returns the Blobs associated with this value. Should only be used for - // testing. - BLINK_EXPORT WebVector<WebBlobInfo> BlobInfoForTesting() const; - -#if INSIDE_BLINK - // TODO(pwnall): When Onion Soup-ing IndexedDB, ReleaseIDBValue() should - // take a v8::Isolate, and all the ownership tracking logic - // can be deleted. - BLINK_EXPORT std::unique_ptr<IDBValue> ReleaseIdbValue() noexcept; -#endif // INSIDE_BLINK - - private: - // WebIDBValue has to be move-only, because std::unique_ptr is move-only. - // Making the restriction explicit results in slightly better compilation - // error messages in code that attempts copying. - WebIDBValue(const WebIDBValue&) = delete; - WebIDBValue& operator=(const WebIDBValue&) = delete; - -#if DCHECK_IS_ON() - // Called when the underlying IDBValue is about to be released. - BLINK_EXPORT void ReleaseIdbValueOwnership(); -#endif // DCHECK_IS_ON() - - std::unique_ptr<IDBValue> private_; -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_INDEXEDDB_WEB_IDB_VALUE_H_ |