# Copyright 2019 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. import("//third_party/protobuf/proto_library.gni") source_set("storage") { sources = [ "dom_storage/async_dom_storage_database.cc", "dom_storage/async_dom_storage_database.h", "dom_storage/dom_storage_constants.cc", "dom_storage/dom_storage_constants.h", "dom_storage/dom_storage_database.cc", "dom_storage/dom_storage_database.h", "dom_storage/legacy_dom_storage_database.cc", "dom_storage/legacy_dom_storage_database.h", "dom_storage/local_storage_impl.cc", "dom_storage/local_storage_impl.h", "dom_storage/session_storage_area_impl.cc", "dom_storage/session_storage_area_impl.h", "dom_storage/session_storage_data_map.cc", "dom_storage/session_storage_data_map.h", "dom_storage/session_storage_impl.cc", "dom_storage/session_storage_impl.h", "dom_storage/session_storage_metadata.cc", "dom_storage/session_storage_metadata.h", "dom_storage/session_storage_namespace_impl.cc", "dom_storage/session_storage_namespace_impl.h", "dom_storage/storage_area_impl.cc", "dom_storage/storage_area_impl.h", "indexed_db/leveldb/leveldb_factory.cc", "indexed_db/leveldb/leveldb_factory.h", "indexed_db/leveldb/leveldb_state.cc", "indexed_db/leveldb/leveldb_state.h", "indexed_db/scopes/disjoint_range_lock_manager.cc", "indexed_db/scopes/disjoint_range_lock_manager.h", "indexed_db/scopes/leveldb_scope.cc", "indexed_db/scopes/leveldb_scope.h", "indexed_db/scopes/leveldb_scope_deletion_mode.h", "indexed_db/scopes/leveldb_scopes.cc", "indexed_db/scopes/leveldb_scopes.h", "indexed_db/scopes/leveldb_scopes_coding.cc", "indexed_db/scopes/leveldb_scopes_coding.h", "indexed_db/scopes/leveldb_scopes_factory.cc", "indexed_db/scopes/leveldb_scopes_factory.h", "indexed_db/scopes/leveldb_scopes_tasks.cc", "indexed_db/scopes/leveldb_scopes_tasks.h", "indexed_db/scopes/scope_lock.cc", "indexed_db/scopes/scope_lock.h", "indexed_db/scopes/scope_lock_range.cc", "indexed_db/scopes/scope_lock_range.h", "indexed_db/scopes/scopes_lock_manager.cc", "indexed_db/scopes/scopes_lock_manager.h", "indexed_db/scopes/varint_coding.cc", "indexed_db/scopes/varint_coding.h", "indexed_db/transactional_leveldb/leveldb_write_batch.cc", "indexed_db/transactional_leveldb/leveldb_write_batch.h", "indexed_db/transactional_leveldb/transactional_leveldb_database.cc", "indexed_db/transactional_leveldb/transactional_leveldb_database.h", "indexed_db/transactional_leveldb/transactional_leveldb_factory.cc", "indexed_db/transactional_leveldb/transactional_leveldb_factory.h", "indexed_db/transactional_leveldb/transactional_leveldb_iterator.cc", "indexed_db/transactional_leveldb/transactional_leveldb_iterator.h", "indexed_db/transactional_leveldb/transactional_leveldb_transaction.cc", "indexed_db/transactional_leveldb/transactional_leveldb_transaction.h", "origin_context_impl.cc", "origin_context_impl.h", "partition_impl.cc", "partition_impl.h", "sandboxed_vfs_delegate.cc", "sandboxed_vfs_delegate.h", "storage_service_impl.cc", "storage_service_impl.h", ] public_deps = [ ":test_api_stubs", "//base", "//components/services/storage/dom_storage:local_storage_proto", "//components/services/storage/indexed_db/scopes:scopes_metadata_proto", "//components/services/storage/public/mojom", "//mojo/public/cpp/bindings", "//sql", "//third_party/blink/public/common", "//third_party/leveldatabase", "//third_party/sqlite", "//url", ] deps = [ ":filesystem_proxy_factory", "//components/services/storage/public/cpp", "//storage/common", ] } # This is its own component target because it exposes global state to multiple # independent libraries in component builds. component("filesystem_proxy_factory") { sources = [ "filesystem_proxy_factory.cc", "filesystem_proxy_factory.h", ] public_deps = [ "//base", "//components/services/storage/public/cpp/filesystem", ] defines = [ "IS_FILESYSTEM_PROXY_FACTORY_IMPL" ] } # A separate component target which merely defines storage for a global testing # API binder implementations to be injected. No actual testing logic should be # included in this target. component("test_api_stubs") { sources = [ "test_api_stubs.cc", "test_api_stubs.h", ] public_deps = [ "//base", "//mojo/public/cpp/system", ] defines = [ "IS_STORAGE_SERVICE_TEST_API_STUBS_IMPL" ] } source_set("tests") { testonly = true sources = [ "dom_storage/dom_storage_database_unittest.cc", "dom_storage/legacy_dom_storage_database_unittest.cc", "dom_storage/local_storage_impl_unittest.cc", "dom_storage/session_storage_area_impl_unittest.cc", "dom_storage/session_storage_data_map_unittest.cc", "dom_storage/session_storage_impl_unittest.cc", "dom_storage/session_storage_metadata_unittest.cc", "dom_storage/session_storage_namespace_impl_unittest.cc", "dom_storage/storage_area_impl_unittest.cc", "indexed_db/scopes/disjoint_range_lock_manager_unittest.cc", "indexed_db/scopes/leveldb_scope_unittest.cc", "indexed_db/scopes/leveldb_scopes_coding_unittest.cc", "indexed_db/scopes/leveldb_scopes_tasks_unittest.cc", "indexed_db/scopes/leveldb_scopes_unittest.cc", "indexed_db/scopes/scopes_lock_manager_unittest.cc", "indexed_db/scopes/varint_coding_unittest.cc", "indexed_db/transactional_leveldb/transactional_leveldb_transaction_unittest.cc", "indexed_db/transactional_leveldb/transactional_leveldb_unittest.cc", "partition_impl_unittest.cc", "storage_service_impl_unittest.cc", ] deps = [ ":storage", ":test_support", "//base", "//base/test:test_support", "//components/services/storage/public/cpp", "//components/services/storage/public/cpp/filesystem:tests", "//components/services/storage/public/mojom", "//mojo/public/cpp/bindings", "//mojo/public/cpp/system", "//sql:test_support", "//testing/gmock", "//testing/gtest", ] data = [ "//components/services/storage/test_data/" ] } source_set("test_support") { testonly = true sources = [ "dom_storage/storage_area_test_util.cc", "dom_storage/storage_area_test_util.h", "dom_storage/testing_legacy_session_storage_database.cc", "dom_storage/testing_legacy_session_storage_database.h", "indexed_db/leveldb/fake_leveldb_factory.cc", "indexed_db/leveldb/fake_leveldb_factory.h", "indexed_db/leveldb/mock_level_db.cc", "indexed_db/leveldb/mock_level_db.h", "indexed_db/scopes/leveldb_scopes_test_utils.cc", "indexed_db/scopes/leveldb_scopes_test_utils.h", ] deps = [ ":storage", "//base/test:test_support", "//testing/gmock", "//testing/gtest", "//third_party/leveldatabase", ] public_deps = [ "//base", "//mojo/public/cpp/bindings", "//testing/gmock", "//third_party/blink/public/mojom/dom_storage", ] }