Merge //base/util/type_safety into //base/types.
This is part of merging all of //base/util back into //base. Bug: 1227210 Change-Id: I4440beb5ed161cfab78b19915d09e71d4834d82e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3012177 Reviewed-by: Wez <wez@chromium.org> Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org> Commit-Queue: Wez <wez@chromium.org> Owners-Override: Wez <wez@chromium.org> Auto-Submit: Albert J. Wong <ajwong@chromium.org> Cr-Commit-Position: refs/heads/master@{#900074}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
0c7499c8ca
commit
1b6dc9656f
base
chrome/browser
ash
crosapi
predictors
touch_to_fill
ui
webui
discards
chromecast/browser
components
autofill
core
feed
core
v2
password_manager
core
browser
leak_detection
performance_manager
public
permissions
services
storage
public
cpp
viz
common
content
browser
public
device/vr
android
openxr
util
extensions/common/api/declarative_net_request
gpu
command_buffer
vulkan
ipc
media/filters
mojo/public/cpp/bindings
net
storage/browser/quota
third_party/blink
common
tokens
public
tools/ipc_fuzzer/fuzzer
ui/base
@ -842,8 +842,10 @@ component("base") {
|
||||
"trace_event/trace_id_helper.h",
|
||||
"traits_bag.h",
|
||||
"tuple.h",
|
||||
"types/id_type.h",
|
||||
"types/pass_key.h",
|
||||
"types/strong_alias.h",
|
||||
"types/token_type.h",
|
||||
"unguessable_token.cc",
|
||||
"unguessable_token.h",
|
||||
"updateable_sequenced_task_runner.h",
|
||||
@ -3151,8 +3153,10 @@ test("base_unittests") {
|
||||
"tools_sanity_unittest.cc",
|
||||
"traits_bag_unittest.cc",
|
||||
"tuple_unittest.cc",
|
||||
"types/id_type_unittest.cc",
|
||||
"types/pass_key_unittest.cc",
|
||||
"types/strong_alias_unittest.cc",
|
||||
"types/token_type_unittest.cc",
|
||||
"unguessable_token_unittest.cc",
|
||||
"value_iterators_unittest.cc",
|
||||
"values_unittest.cc",
|
||||
|
@ -2,15 +2,15 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef BASE_UTIL_TYPE_SAFETY_ID_TYPE_H_
|
||||
#define BASE_UTIL_TYPE_SAFETY_ID_TYPE_H_
|
||||
#ifndef BASE_TYPES_ID_TYPE_H_
|
||||
#define BASE_TYPES_ID_TYPE_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <type_traits>
|
||||
|
||||
#include "base/types/strong_alias.h"
|
||||
|
||||
namespace util {
|
||||
namespace base {
|
||||
|
||||
// A specialization of StrongAlias for integer-based identifiers.
|
||||
//
|
||||
@ -51,7 +51,7 @@ template <typename TypeMarker,
|
||||
typename WrappedType,
|
||||
WrappedType kInvalidValue,
|
||||
WrappedType kFirstGeneratedId = kInvalidValue + 1>
|
||||
class IdType : public base::StrongAlias<TypeMarker, WrappedType> {
|
||||
class IdType : public StrongAlias<TypeMarker, WrappedType> {
|
||||
public:
|
||||
static_assert(
|
||||
std::is_unsigned<WrappedType>::value || kInvalidValue <= 0,
|
||||
@ -67,7 +67,7 @@ class IdType : public base::StrongAlias<TypeMarker, WrappedType> {
|
||||
"invalid value so that the monotonically increasing "
|
||||
"GenerateNextId method will never return the invalid value.");
|
||||
|
||||
using base::StrongAlias<TypeMarker, WrappedType>::StrongAlias;
|
||||
using StrongAlias<TypeMarker, WrappedType>::StrongAlias;
|
||||
|
||||
// This class can be used to generate unique IdTypes. It keeps an internal
|
||||
// counter that is continually increased by one every time an ID is generated.
|
||||
@ -88,8 +88,7 @@ class IdType : public base::StrongAlias<TypeMarker, WrappedType> {
|
||||
|
||||
// Default-construct in the null state.
|
||||
constexpr IdType()
|
||||
: base::StrongAlias<TypeMarker, WrappedType>::StrongAlias(kInvalidValue) {
|
||||
}
|
||||
: StrongAlias<TypeMarker, WrappedType>::StrongAlias(kInvalidValue) {}
|
||||
|
||||
constexpr bool is_null() const { return this->value() == kInvalidValue; }
|
||||
constexpr explicit operator bool() const { return !is_null(); }
|
||||
@ -112,6 +111,7 @@ template <typename TypeMarker>
|
||||
using IdType64 = IdType<TypeMarker, std::int64_t, 0>;
|
||||
template <typename TypeMarker>
|
||||
using IdTypeU64 = IdType<TypeMarker, std::uint64_t, 0>;
|
||||
} // namespace util
|
||||
|
||||
#endif // BASE_UTIL_TYPE_SAFETY_ID_TYPE_H_
|
||||
} // namespace base
|
||||
|
||||
#endif // BASE_TYPES_ID_TYPE_H_
|
@ -4,10 +4,10 @@
|
||||
|
||||
#include <limits>
|
||||
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
namespace util {
|
||||
namespace base {
|
||||
|
||||
namespace {
|
||||
|
||||
@ -110,4 +110,4 @@ INSTANTIATE_TEST_SUITE_P(All,
|
||||
123,
|
||||
std::numeric_limits<int>::max()));
|
||||
|
||||
} // namespace util
|
||||
} // namespace base
|
@ -68,10 +68,10 @@ namespace base {
|
||||
// See also
|
||||
// - //styleguide/c++/blink-c++.md which provides recommendation and examples of
|
||||
// using StrongAlias<Tag, bool> instead of a bare bool.
|
||||
// - util::IdType<...> which provides helpers for specializing
|
||||
// StrongAlias to be used as an id.
|
||||
// - util::TokenType<...> which provides helpers for specializing StrongAlias
|
||||
// to be used as a wrapper of base::UnguessableToken.
|
||||
// - IdType<...> which provides helpers for specializing StrongAlias to be
|
||||
// used as an id.
|
||||
// - TokenType<...> which provides helpers for specializing StrongAlias to be
|
||||
// used as a wrapper of base::UnguessableToken.
|
||||
template <typename TagType, typename UnderlyingType>
|
||||
class StrongAlias {
|
||||
public:
|
||||
|
@ -2,31 +2,31 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef BASE_UTIL_TYPE_SAFETY_TOKEN_TYPE_H_
|
||||
#define BASE_UTIL_TYPE_SAFETY_TOKEN_TYPE_H_
|
||||
#ifndef BASE_TYPES_TOKEN_TYPE_H_
|
||||
#define BASE_TYPES_TOKEN_TYPE_H_
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include "base/types/strong_alias.h"
|
||||
#include "base/unguessable_token.h"
|
||||
|
||||
namespace util {
|
||||
namespace base {
|
||||
|
||||
// A specialization of StrongAlias for base::UnguessableToken. Unlike
|
||||
// base::UnguessableToken, a TokenType<...> does not default to null and does
|
||||
// not expose the concept of null tokens. If you need to indicate a null token,
|
||||
// A specialization of StrongAlias for UnguessableToken. Unlike
|
||||
// UnguessableToken, a TokenType<...> does not default to null and does not
|
||||
// expose the concept of null tokens. If you need to indicate a null token,
|
||||
// please use absl::optional<TokenType<...>>.
|
||||
template <typename TypeMarker>
|
||||
class TokenType : public base::StrongAlias<TypeMarker, base::UnguessableToken> {
|
||||
class TokenType : public StrongAlias<TypeMarker, UnguessableToken> {
|
||||
private:
|
||||
using Super = base::StrongAlias<TypeMarker, base::UnguessableToken>;
|
||||
using Super = StrongAlias<TypeMarker, UnguessableToken>;
|
||||
|
||||
public:
|
||||
TokenType() : Super(base::UnguessableToken::Create()) {}
|
||||
TokenType() : Super(UnguessableToken::Create()) {}
|
||||
// The parameter |unused| is here to prevent multiple definitions of a
|
||||
// single argument constructor. This is only needed during the migration to
|
||||
// strongly typed frame tokens.
|
||||
explicit TokenType(const base::UnguessableToken& token) : Super(token) {}
|
||||
explicit TokenType(const UnguessableToken& token) : Super(token) {}
|
||||
TokenType(const TokenType& token) : Super(token.value()) {}
|
||||
TokenType(TokenType&& token) noexcept : Super(token.value()) {}
|
||||
TokenType& operator=(const TokenType& token) = default;
|
||||
@ -40,14 +40,14 @@ class TokenType : public base::StrongAlias<TypeMarker, base::UnguessableToken> {
|
||||
using argument_type = TokenType;
|
||||
using result_type = size_t;
|
||||
result_type operator()(const argument_type& token) const {
|
||||
return base::UnguessableTokenHash()(token.value());
|
||||
return UnguessableTokenHash()(token.value());
|
||||
}
|
||||
};
|
||||
|
||||
// Mimic the base::UnguessableToken API for ease and familiarity of use.
|
||||
// Mimic the UnguessableToken API for ease and familiarity of use.
|
||||
std::string ToString() const { return this->value().ToString(); }
|
||||
};
|
||||
|
||||
} // namespace util
|
||||
} // namespace base
|
||||
|
||||
#endif // BASE_UTIL_TYPE_SAFETY_TOKEN_TYPE_H_
|
||||
#endif // BASE_TYPES_TOKEN_TYPE_H_
|
@ -2,12 +2,12 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "base/util/type_safety/token_type.h"
|
||||
#include "base/types/token_type.h"
|
||||
|
||||
#include "base/unguessable_token.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
namespace util {
|
||||
namespace base {
|
||||
|
||||
using FooToken = TokenType<class Foo>;
|
||||
|
||||
@ -37,11 +37,10 @@ TEST(TokenType, TokenApi) {
|
||||
EXPECT_TRUE(token1 != token4);
|
||||
|
||||
// Test hasher.
|
||||
EXPECT_EQ(FooToken::Hasher()(token2),
|
||||
base::UnguessableTokenHash()(token2.value()));
|
||||
EXPECT_EQ(FooToken::Hasher()(token2), UnguessableTokenHash()(token2.value()));
|
||||
|
||||
// Test string representation.
|
||||
EXPECT_EQ(token2.ToString(), token2.value().ToString());
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
} // namespace base
|
@ -9,7 +9,6 @@ test("base_util_unittests") {
|
||||
"enum_set:unittests",
|
||||
"memory_pressure:unittests",
|
||||
"timer:unittests",
|
||||
"type_safety:tests",
|
||||
"values:unittests",
|
||||
"//base/test:run_all_unittests",
|
||||
]
|
||||
|
@ -1,31 +0,0 @@
|
||||
# Copyright (c) 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("//build/nocompile.gni")
|
||||
|
||||
# Change this target's type to component if it starts to contain more than
|
||||
# just headers. Header-only targets cannot be compiled to libraries, so it must
|
||||
# remain a source_set for now.
|
||||
source_set("type_safety") {
|
||||
sources = [
|
||||
"id_type.h",
|
||||
"token_type.h",
|
||||
]
|
||||
|
||||
deps = [ "//base" ]
|
||||
}
|
||||
|
||||
source_set("tests") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"id_type_unittest.cc",
|
||||
"token_type_unittest.cc",
|
||||
]
|
||||
|
||||
deps = [
|
||||
":type_safety",
|
||||
"//base",
|
||||
"//testing/gtest",
|
||||
]
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
include_rules = [
|
||||
"-base",
|
||||
"+base/types",
|
||||
"+base/unguessable_token.h",
|
||||
"+base/util/type_safety",
|
||||
"-third_party",
|
||||
]
|
@ -1,2 +0,0 @@
|
||||
lukasza@chromium.org
|
||||
mpawlowski@opera.com
|
@ -5,7 +5,7 @@
|
||||
#ifndef CHROME_BROWSER_ASH_CROSAPI_CROSAPI_ID_H_
|
||||
#define CHROME_BROWSER_ASH_CROSAPI_CROSAPI_ID_H_
|
||||
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
|
||||
namespace crosapi {
|
||||
namespace internal {
|
||||
@ -15,7 +15,7 @@ struct CrosapiIdTag {};
|
||||
// CrosapiId is an id created on a new Crosapi connection creation.
|
||||
// This will be useful to identify what bindings/remote of sub crosapi
|
||||
// interfaces are related each other.
|
||||
using CrosapiId = util::IdTypeU32<internal::CrosapiIdTag>;
|
||||
using CrosapiId = base::IdTypeU32<internal::CrosapiIdTag>;
|
||||
|
||||
} // namespace crosapi
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include "base/containers/flat_set.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "chrome/browser/predictors/loading_predictor_config.h"
|
||||
#include "services/metrics/public/cpp/ukm_source_id.h"
|
||||
#include "services/network/public/mojom/fetch_api.mojom-forward.h"
|
||||
@ -29,7 +29,7 @@ namespace predictors {
|
||||
class LoadingStatsCollector;
|
||||
struct OptimizationGuidePrediction;
|
||||
class ResourcePrefetchPredictor;
|
||||
using NavigationId = util::IdType64<content::NavigationHandle>;
|
||||
using NavigationId = base::IdType64<content::NavigationHandle>;
|
||||
|
||||
// Data collected for origin-based prediction, for a single origin during a
|
||||
// page load (see PageRequestSummary).
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/memory/scoped_refptr.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "chrome/browser/predictors/resource_prefetch_predictor.h"
|
||||
#include "content/public/browser/navigation_handle_user_data.h"
|
||||
#include "content/public/browser/render_document_host_user_data.h"
|
||||
@ -27,7 +27,7 @@ class OptimizationMetadata;
|
||||
} // namespace optimization_guide
|
||||
|
||||
namespace predictors {
|
||||
using NavigationId = util::IdType64<content::NavigationHandle>;
|
||||
using NavigationId = base::IdType64<content::NavigationHandle>;
|
||||
|
||||
class LoadingPredictor;
|
||||
|
||||
|
@ -29,7 +29,6 @@ source_set("factory") {
|
||||
source_set("public") {
|
||||
deps = [
|
||||
"//base",
|
||||
"//base/util/type_safety",
|
||||
"//url",
|
||||
]
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "base/memory/ref_counted_memory.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/sequence_checker.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "chrome/browser/ui/webui/discards/discards.mojom.h"
|
||||
#include "components/performance_manager/public/graph/frame_node.h"
|
||||
#include "components/performance_manager/public/graph/graph.h"
|
||||
@ -207,7 +207,7 @@ class DiscardsGraphDumpImpl : public discards::mojom::GraphDump,
|
||||
// The favicon requests happen on the UI thread. This helper class
|
||||
// maintains the state required to do that.
|
||||
class FaviconRequestHelper;
|
||||
using NodeId = util::IdType64<class NodeIdTag>;
|
||||
using NodeId = base::IdType64<class NodeIdTag>;
|
||||
|
||||
void AddNode(const performance_manager::Node* node);
|
||||
void RemoveNode(const performance_manager::Node* node);
|
||||
|
@ -5,7 +5,7 @@
|
||||
#ifndef CHROMECAST_BROWSER_SERVICE_CONNECTOR_H_
|
||||
#define CHROMECAST_BROWSER_SERVICE_CONNECTOR_H_
|
||||
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "chromecast/common/mojom/service_connector.mojom.h"
|
||||
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
||||
#include "mojo/public/cpp/bindings/pending_remote.h"
|
||||
@ -20,7 +20,7 @@ class ServiceConnector;
|
||||
//
|
||||
// We don't use an enum because the definition of these IDs is split across
|
||||
// public and internal sources.
|
||||
using ServiceConnectorClientId = util::IdType32<ServiceConnector>;
|
||||
using ServiceConnectorClientId = base::IdType32<ServiceConnector>;
|
||||
|
||||
// Something in browser process itself (e.g. CastAudioManager)
|
||||
extern const ServiceConnectorClientId kBrowserProcessClientId;
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "components/autofill/core/browser/autofill_client.h"
|
||||
#include "components/autofill/core/browser/data_model/autofill_profile.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
@ -16,7 +16,7 @@ namespace autofill {
|
||||
|
||||
// The id of an ongoing profile import process.
|
||||
using AutofillProfileImportId =
|
||||
::util::IdTypeU64<class AutofillProfileImportIdMarker>;
|
||||
::base::IdTypeU64<class AutofillProfileImportIdMarker>;
|
||||
|
||||
// Specifies the type of a profile form import.
|
||||
enum class AutofillProfileImportType {
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
|
||||
namespace autofill {
|
||||
|
||||
@ -17,8 +17,8 @@ struct FormData;
|
||||
struct FormFieldData;
|
||||
|
||||
namespace internal {
|
||||
using FormSignatureType = ::util::IdTypeU64<class FormSignatureMarker>;
|
||||
using FieldSignatureType = ::util::IdTypeU32<class FieldSignatureMarker>;
|
||||
using FormSignatureType = ::base::IdTypeU64<class FormSignatureMarker>;
|
||||
using FieldSignatureType = ::base::IdTypeU32<class FieldSignatureMarker>;
|
||||
} // namespace internal
|
||||
|
||||
// The below strong aliases are defined as subclasses instead of typedefs in
|
||||
|
@ -9,15 +9,15 @@
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
|
||||
#include "base/types/id_type.h"
|
||||
#include "base/unguessable_token.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
|
||||
namespace autofill {
|
||||
|
||||
namespace internal {
|
||||
|
||||
// TokenType wraps an base::UnguessableToken just like util::TokenType but
|
||||
// TokenType wraps an base::UnguessableToken just like base::TokenType but
|
||||
// initializes to zero by default. We use it to define our own versions of
|
||||
// LocalFrameToken and RemoteFrameToken to avoid dependencies on blink here and
|
||||
// in the mojo code, since iOS depends on this code.
|
||||
@ -54,8 +54,8 @@ using FrameToken = absl::variant<RemoteFrameToken, LocalFrameToken>;
|
||||
|
||||
namespace internal {
|
||||
|
||||
using FormRendererIdType = ::util::IdTypeU32<class FormRendererIdMarker>;
|
||||
using FieldRendererIdType = ::util::IdTypeU32<class FieldRendererIdMarker>;
|
||||
using FormRendererIdType = ::base::IdTypeU32<class FormRendererIdMarker>;
|
||||
using FieldRendererIdType = ::base::IdTypeU32<class FieldRendererIdMarker>;
|
||||
|
||||
} // namespace internal
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "base/time/time.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "base/version.h"
|
||||
#include "components/version_info/channel.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
@ -39,9 +39,9 @@ struct DisplayMetrics {
|
||||
};
|
||||
|
||||
// A unique ID for an ephemeral change.
|
||||
using EphemeralChangeId = util::IdTypeU32<class EphemeralChangeIdClass>;
|
||||
using SurfaceId = util::IdTypeU32<class SurfaceIdClass>;
|
||||
using ImageFetchId = util::IdTypeU32<class ImageFetchIdClass>;
|
||||
using EphemeralChangeId = base::IdTypeU32<class EphemeralChangeIdClass>;
|
||||
using SurfaceId = base::IdTypeU32<class SurfaceIdClass>;
|
||||
using ImageFetchId = base::IdTypeU32<class ImageFetchIdClass>;
|
||||
|
||||
// A map of trial names (key) to group names (value) that is
|
||||
// sent from the server.
|
||||
@ -171,7 +171,7 @@ enum class WebFeedSubscriptionRequestStatus {
|
||||
std::ostream& operator<<(std::ostream& out,
|
||||
WebFeedSubscriptionRequestStatus value);
|
||||
|
||||
using NetworkRequestId = util::IdTypeU32<class NetworkRequestIdClass>;
|
||||
using NetworkRequestId = base::IdTypeU32<class NetworkRequestIdClass>;
|
||||
|
||||
} // namespace feed
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "components/feed/core/proto/v2/store.pb.h"
|
||||
#include "components/feed/core/v2/proto_util.h"
|
||||
#include "components/feed/core/v2/types.h"
|
||||
@ -19,7 +19,7 @@ namespace feed {
|
||||
namespace stream_model {
|
||||
|
||||
// Uniquely identifies a feedwire::ContentId. Provided by |ContentMap|.
|
||||
using ContentTag = util::IdTypeU32<class ContentTagClass>;
|
||||
using ContentTag = base::IdTypeU32<class ContentTagClass>;
|
||||
using ContentRevision = feed::ContentRevision;
|
||||
|
||||
// Owns instances of feedstore::Content pointed to by the feature tree, and
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include "base/containers/flat_set.h"
|
||||
#include "base/time/time.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "base/values.h"
|
||||
#include "components/feed/core/proto/v2/wire/reliability_logging_enums.pb.h"
|
||||
#include "components/feed/core/v2/enums.h"
|
||||
@ -28,10 +28,10 @@ using ::feed::WebFeedSubscriptionStatus;
|
||||
|
||||
// Uniquely identifies a revision of a |feedstore::Content|. If Content changes,
|
||||
// it is assigned a new revision number.
|
||||
using ContentRevision = util::IdTypeU32<class ContentRevisionClass>;
|
||||
using ContentRevision = base::IdTypeU32<class ContentRevisionClass>;
|
||||
|
||||
// ID for a stored pending action.
|
||||
using LocalActionId = util::IdType32<class LocalActionIdClass>;
|
||||
using LocalActionId = base::IdType32<class LocalActionIdClass>;
|
||||
|
||||
std::string ToString(ContentRevision c);
|
||||
ContentRevision ToContentRevision(const std::string& str);
|
||||
|
@ -16,7 +16,6 @@ source_set("leak_detection_interface_headers") {
|
||||
]
|
||||
deps = [
|
||||
"//base",
|
||||
"//base/util/type_safety",
|
||||
"//url",
|
||||
]
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "base/callback_forward.h"
|
||||
#include "base/containers/flat_set.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/util/type_safety/token_type.h"
|
||||
#include "base/types/token_type.h"
|
||||
#include "components/performance_manager/public/execution_context_priority/execution_context_priority.h"
|
||||
#include "components/performance_manager/public/graph/node.h"
|
||||
#include "third_party/blink/public/common/tokens/tokens.h"
|
||||
|
@ -5,13 +5,13 @@
|
||||
#ifndef COMPONENTS_PERFORMANCE_MANAGER_PUBLIC_RENDER_PROCESS_HOST_ID_H_
|
||||
#define COMPONENTS_PERFORMANCE_MANAGER_PUBLIC_RENDER_PROCESS_HOST_ID_H_
|
||||
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "content/public/common/child_process_host.h"
|
||||
|
||||
namespace performance_manager {
|
||||
|
||||
using RenderProcessHostIdBase =
|
||||
util::IdType<class RenderProcessHostIdTag,
|
||||
base::IdType<class RenderProcessHostIdTag,
|
||||
int32_t,
|
||||
content::ChildProcessHost::kInvalidUniqueID,
|
||||
1>;
|
||||
|
@ -44,8 +44,8 @@
|
||||
#include "base/check_op.h"
|
||||
#include "base/containers/flat_map.h"
|
||||
#include "base/dcheck_is_on.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "base/types/pass_key.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
|
||||
namespace performance_manager {
|
||||
namespace voting {
|
||||
@ -83,7 +83,7 @@ class Vote final {
|
||||
|
||||
// Identifies a VotingChannel.
|
||||
template <typename VoteImpl>
|
||||
using VoterId = util::IdTypeU32<VoteImpl>;
|
||||
using VoterId = base::IdTypeU32<VoteImpl>;
|
||||
|
||||
template <class VoteImpl>
|
||||
class VoteObserver {
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
namespace content {
|
||||
@ -24,7 +24,7 @@ namespace permissions {
|
||||
class PermissionRequestID {
|
||||
public:
|
||||
// Uniquely identifies a request (at least) within a given frame.
|
||||
using RequestLocalId = util::IdType64<PermissionRequestID>;
|
||||
using RequestLocalId = base::IdType64<PermissionRequestID>;
|
||||
|
||||
PermissionRequestID(content::RenderFrameHost* render_frame_host,
|
||||
RequestLocalId request_local_id);
|
||||
|
@ -10,7 +10,6 @@ component("buckets") {
|
||||
|
||||
public_deps = [
|
||||
"//base",
|
||||
"//base/util/type_safety",
|
||||
"//third_party/blink/public/common",
|
||||
]
|
||||
|
||||
|
@ -5,13 +5,13 @@
|
||||
#ifndef COMPONENTS_SERVICES_STORAGE_PUBLIC_CPP_BUCKETS_BUCKET_ID_H_
|
||||
#define COMPONENTS_SERVICES_STORAGE_PUBLIC_CPP_BUCKETS_BUCKET_ID_H_
|
||||
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
|
||||
namespace storage {
|
||||
|
||||
// Type for the Storage Bucket ID.
|
||||
// IDs will always be generated by SQLite, and all valid BucketIds are positive.
|
||||
using BucketId = util::IdType64<class BucketTag>;
|
||||
using BucketId = base::IdType64<class BucketTag>;
|
||||
|
||||
} // namespace storage
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
#define COMPONENTS_SERVICES_STORAGE_PUBLIC_CPP_BUCKETS_BUCKET_INFO_H_
|
||||
|
||||
#include "base/time/time.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "components/services/storage/public/cpp/buckets/bucket_id.h"
|
||||
#include "third_party/blink/public/common/storage_key/storage_key.h"
|
||||
#include "third_party/blink/public/mojom/quota/quota_types.mojom-shared.h"
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "base/callback.h"
|
||||
#include "base/hash/hash.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "cc/base/list_container.h"
|
||||
#include "cc/paint/filter_operations.h"
|
||||
#include "components/viz/common/quads/draw_quad.h"
|
||||
@ -33,7 +33,7 @@ class AggregatedRenderPass;
|
||||
class CompositorRenderPassDrawQuad;
|
||||
class AggregatedRenderPassDrawQuad;
|
||||
|
||||
using AggregatedRenderPassId = util::IdTypeU64<AggregatedRenderPass>;
|
||||
using AggregatedRenderPassId = base::IdTypeU64<AggregatedRenderPass>;
|
||||
|
||||
// This class represents a render pass that is a result of aggregating render
|
||||
// passes from all of the relevant surfaces. It is _not_ mojo-serializable since
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "base/callback.h"
|
||||
#include "base/hash/hash.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "cc/base/list_container.h"
|
||||
#include "cc/paint/filter_operations.h"
|
||||
#include "components/viz/common/quads/draw_quad.h"
|
||||
@ -43,7 +43,7 @@ class DrawQuad;
|
||||
class CompositorRenderPass;
|
||||
class CompositorRenderPassDrawQuad;
|
||||
|
||||
using CompositorRenderPassId = util::IdTypeU64<CompositorRenderPass>;
|
||||
using CompositorRenderPassId = base::IdTypeU64<CompositorRenderPass>;
|
||||
|
||||
// This class represents a render pass that is submitted from the UI or renderer
|
||||
// compositor to viz. It is mojo-serializable and typically has a unique
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "base/check_op.h"
|
||||
#include "base/containers/flat_set.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
|
||||
namespace viz {
|
||||
|
||||
@ -20,7 +20,7 @@ struct ResourceIdTypeMarker {};
|
||||
|
||||
// Note that if you need to generate new ResourceIds, please use
|
||||
// ResourceIdGenerator below, since it will skip generating reserved ids.
|
||||
using ResourceId = util::IdTypeU32<ResourceIdTypeMarker>;
|
||||
using ResourceId = base::IdTypeU32<ResourceIdTypeMarker>;
|
||||
using ResourceIdSet = base::flat_set<ResourceId>;
|
||||
constexpr ResourceId kInvalidResourceId(0);
|
||||
constexpr ResourceId kVizReservedRangeStartId(
|
||||
|
@ -270,8 +270,8 @@ source_set("browser") {
|
||||
}
|
||||
|
||||
public_deps = [
|
||||
"//base",
|
||||
"//base/util/memory_pressure",
|
||||
"//base/util/type_safety",
|
||||
"//ipc",
|
||||
"//media/mojo/mojom:remoting",
|
||||
"//third_party/blink/public/mojom:embedded_frame_sink_mojo_bindings",
|
||||
|
@ -13,16 +13,16 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
namespace content {
|
||||
|
||||
class SavePackage;
|
||||
using SavePackageId = util::IdType32<SavePackage>;
|
||||
using SavePackageId = base::IdType32<SavePackage>;
|
||||
|
||||
class SaveItem;
|
||||
using SaveItemId = util::IdType32<SaveItem>;
|
||||
using SaveItemId = base::IdType32<SaveItem>;
|
||||
|
||||
// Map from save_item_id into final file path.
|
||||
using FinalNamesMap =
|
||||
|
@ -5,7 +5,7 @@
|
||||
#ifndef CONTENT_BROWSER_ISOLATION_CONTEXT_H_
|
||||
#define CONTENT_BROWSER_ISOLATION_CONTEXT_H_
|
||||
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "content/common/content_export.h"
|
||||
#include "content/public/browser/browser_or_resource_context.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
@ -13,7 +13,7 @@
|
||||
namespace content {
|
||||
|
||||
class BrowsingInstance;
|
||||
using BrowsingInstanceId = util::IdType32<BrowsingInstance>;
|
||||
using BrowsingInstanceId = base::IdType32<BrowsingInstance>;
|
||||
|
||||
// This class is used to specify the context in which process model decisions
|
||||
// need to be made. For example, dynamically added isolated origins only take
|
||||
|
@ -194,7 +194,7 @@ class CONTENT_EXPORT FrameTree {
|
||||
}
|
||||
PageDelegate* page_delegate() { return page_delegate_; }
|
||||
|
||||
using RenderViewHostMapId = util::IdType32<class RenderViewHostMap>;
|
||||
using RenderViewHostMapId = base::IdType32<class RenderViewHostMap>;
|
||||
using RenderViewHostMap = std::unordered_map<RenderViewHostMapId,
|
||||
RenderViewHostImpl*,
|
||||
RenderViewHostMapId::Hasher>;
|
||||
|
@ -6,7 +6,7 @@
|
||||
#define CONTENT_PUBLIC_BROWSER_PERMISSION_CONTROLLER_H_
|
||||
|
||||
#include "base/supports_user_data.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "content/common/content_export.h"
|
||||
#include "content/public/browser/permission_type.h"
|
||||
#include "third_party/blink/public/mojom/permissions/permission_status.mojom.h"
|
||||
@ -24,7 +24,7 @@ class CONTENT_EXPORT PermissionController
|
||||
// Identifier for an active subscription. This is intentionally a distinct
|
||||
// type from PermissionControllerDelegate::SubscriptionId as the concrete
|
||||
// identifier values may be different.
|
||||
using SubscriptionId = util::IdType64<PermissionController>;
|
||||
using SubscriptionId = base::IdType64<PermissionController>;
|
||||
|
||||
~PermissionController() override {}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
#ifndef CONTENT_PUBLIC_BROWSER_PERMISSION_CONTROLLER_DELEGATE_H_
|
||||
#define CONTENT_PUBLIC_BROWSER_PERMISSION_CONTROLLER_DELEGATE_H_
|
||||
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "content/common/content_export.h"
|
||||
#include "content/public/browser/devtools_permission_overrides.h"
|
||||
#include "third_party/blink/public/mojom/permissions/permission_status.mojom.h"
|
||||
@ -21,7 +21,7 @@ class CONTENT_EXPORT PermissionControllerDelegate {
|
||||
using PermissionOverrides = DevToolsPermissionOverrides::PermissionOverrides;
|
||||
|
||||
// Identifier for an active subscription.
|
||||
using SubscriptionId = util::IdType64<PermissionControllerDelegate>;
|
||||
using SubscriptionId = base::IdType64<PermissionControllerDelegate>;
|
||||
|
||||
virtual ~PermissionControllerDelegate() = default;
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "base/process/process_handle.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "content/common/content_export.h"
|
||||
|
||||
namespace content {
|
||||
@ -22,7 +22,7 @@ struct CONTENT_EXPORT ServiceProcessIdTypeMarker {};
|
||||
// An opaque ID type used to uniquely identify service process instances. This
|
||||
// is separate from system PID. Values are never reused.
|
||||
using ServiceProcessId =
|
||||
util::IdType<internal::ServiceProcessIdTypeMarker, uint64_t, 0u>;
|
||||
base::IdType<internal::ServiceProcessIdTypeMarker, uint64_t, 0u>;
|
||||
|
||||
// Information about a running (or very recently running) service process.
|
||||
struct CONTENT_EXPORT ServiceProcessInfo {
|
||||
|
@ -20,7 +20,7 @@ namespace device {
|
||||
// be passed over mojo. The Ids should be directly exposable from blink if
|
||||
// desired.
|
||||
// Note that IdType must be constructable from a uint64_t, and should most often
|
||||
// be a util::IdTypeU64 type.
|
||||
// be a base::IdTypeU64 type.
|
||||
template <typename IdType>
|
||||
class AddressToIdMap {
|
||||
public:
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "base/types/id_type.h"
|
||||
#include "base/types/pass_key.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "device/vr/android/arcore/address_to_id_map.h"
|
||||
#include "device/vr/android/arcore/arcore_plane_manager.h"
|
||||
#include "device/vr/android/arcore/arcore_sdk.h"
|
||||
@ -20,7 +20,7 @@ namespace device {
|
||||
|
||||
class ArCoreImpl;
|
||||
|
||||
using AnchorId = util::IdTypeU64<class AnchorTag>;
|
||||
using AnchorId = base::IdTypeU64<class AnchorTag>;
|
||||
|
||||
class ArCoreAnchorManager {
|
||||
public:
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "base/component_export.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/time/time.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "device/vr/android/arcore/arcore.h"
|
||||
#include "device/vr/android/arcore/arcore_anchor_manager.h"
|
||||
#include "device/vr/android/arcore/arcore_plane_manager.h"
|
||||
@ -22,7 +22,7 @@ namespace device {
|
||||
|
||||
class ArCorePlaneManager;
|
||||
|
||||
using AnchorId = util::IdTypeU64<class AnchorTag>;
|
||||
using AnchorId = base::IdTypeU64<class AnchorTag>;
|
||||
|
||||
class CreateAnchorRequest {
|
||||
public:
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "base/types/id_type.h"
|
||||
#include "base/types/pass_key.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "device/vr/android/arcore/address_to_id_map.h"
|
||||
#include "device/vr/android/arcore/arcore_sdk.h"
|
||||
#include "device/vr/android/arcore/scoped_arcore_objects.h"
|
||||
@ -20,7 +20,7 @@ namespace device {
|
||||
class ArCoreImpl;
|
||||
class ArCoreAnchorManager;
|
||||
|
||||
using PlaneId = util::IdTypeU64<class PlaneTag>;
|
||||
using PlaneId = base::IdTypeU64<class PlaneTag>;
|
||||
|
||||
std::pair<gfx::Quaternion, gfx::Point3F> GetPositionAndOrientationFromArPose(
|
||||
const ArSession* session,
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "device/vr/openxr/openxr_defs.h"
|
||||
#include "device/vr/openxr/openxr_extension_helper.h"
|
||||
#include "third_party/openxr/src/include/openxr/openxr.h"
|
||||
@ -17,7 +17,7 @@
|
||||
#include "ui/gfx/transform.h"
|
||||
#include "ui/gfx/transform_util.h"
|
||||
|
||||
using AnchorId = util::IdTypeU64<class AnchorTag>;
|
||||
using AnchorId = base::IdTypeU64<class AnchorTag>;
|
||||
constexpr AnchorId kInvalidAnchorId;
|
||||
|
||||
namespace device {
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
namespace device {
|
||||
|
||||
using HitTestSubscriptionId = util::IdTypeU64<class HitTestSubscriptionTag>;
|
||||
using HitTestSubscriptionId = base::IdTypeU64<class HitTestSubscriptionTag>;
|
||||
|
||||
struct COMPONENT_EXPORT(DEVICE_VR_UTIL) HitTestSubscriptionData {
|
||||
mojom::XRNativeOriginInformationPtr native_origin_information;
|
||||
|
@ -5,7 +5,7 @@
|
||||
#ifndef EXTENSIONS_COMMON_API_DECLARATIVE_NET_REQUEST_CONSTANTS_H_
|
||||
#define EXTENSIONS_COMMON_API_DECLARATIVE_NET_REQUEST_CONSTANTS_H_
|
||||
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
|
||||
namespace extensions {
|
||||
namespace declarative_net_request {
|
||||
@ -23,7 +23,7 @@ constexpr int kMinValidID = 1;
|
||||
constexpr int kMinValidPriority = 1;
|
||||
|
||||
using RulesetID =
|
||||
::util::IdType<class RulesetIDTag, int, -2 /* invalid value */>;
|
||||
::base::IdType<class RulesetIDTag, int, -2 /* invalid value */>;
|
||||
|
||||
constexpr RulesetID kMinValidStaticRulesetID(1);
|
||||
constexpr RulesetID kDynamicRulesetID(0);
|
||||
|
@ -62,7 +62,6 @@ source_set("common_base_sources") {
|
||||
public_deps = [
|
||||
":mailbox",
|
||||
"//base",
|
||||
"//base/util/type_safety",
|
||||
]
|
||||
configs += [ "//gpu:gpu_implementation" ]
|
||||
}
|
||||
@ -112,7 +111,7 @@ source_set("common_sources") {
|
||||
public_deps = [
|
||||
":common_base_sources",
|
||||
":mailbox",
|
||||
"//base/util/type_safety",
|
||||
"//base",
|
||||
"//mojo/public/cpp/system",
|
||||
"//ui/gfx:memory_buffer",
|
||||
"//ui/gfx/geometry",
|
||||
|
@ -5,12 +5,12 @@
|
||||
#ifndef GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_ID_H_
|
||||
#define GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_ID_H_
|
||||
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
|
||||
namespace gpu {
|
||||
|
||||
class CommandBuffer;
|
||||
using CommandBufferId = util::IdTypeU64<CommandBuffer>;
|
||||
using CommandBufferId = base::IdTypeU64<CommandBuffer>;
|
||||
|
||||
} // namespace gpu
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
#define GPU_COMMAND_BUFFER_COMMON_DISCARDABLE_HANDLE_H_
|
||||
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "gpu/gpu_export.h"
|
||||
|
||||
namespace gpu {
|
||||
@ -83,7 +83,7 @@ class GPU_EXPORT DiscardableHandleBase {
|
||||
// handle (via the constructor), and can Lock an existing handle.
|
||||
class GPU_EXPORT ClientDiscardableHandle : public DiscardableHandleBase {
|
||||
public:
|
||||
using Id = util::IdType32<ClientDiscardableHandle>;
|
||||
using Id = base::IdType32<ClientDiscardableHandle>;
|
||||
|
||||
ClientDiscardableHandle(); // Constructs an invalid handle.
|
||||
ClientDiscardableHandle(scoped_refptr<Buffer> buffer,
|
||||
|
@ -75,7 +75,7 @@ target(link_target_type, "service_sources") {
|
||||
]
|
||||
|
||||
public_deps = [
|
||||
"//base/util/type_safety",
|
||||
"//base",
|
||||
"//gpu/command_buffer/common:common_sources",
|
||||
"//url:url",
|
||||
]
|
||||
@ -297,7 +297,7 @@ target(link_target_type, "gles2_sources") {
|
||||
include_dirs = [ "//third_party/mesa_headers" ]
|
||||
|
||||
public_deps = [
|
||||
"//base/util/type_safety",
|
||||
"//base",
|
||||
"//cc/paint",
|
||||
"//gpu/command_buffer/common",
|
||||
"//gpu/command_buffer/common:gles2_sources",
|
||||
|
@ -5,12 +5,12 @@
|
||||
#ifndef GPU_COMMAND_BUFFER_SERVICE_SEQUENCE_ID_H_
|
||||
#define GPU_COMMAND_BUFFER_SERVICE_SEQUENCE_ID_H_
|
||||
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
|
||||
namespace gpu {
|
||||
|
||||
class SyncPointOrderData;
|
||||
using SequenceId = util::IdTypeU32<SyncPointOrderData>;
|
||||
using SequenceId = base::IdTypeU32<SyncPointOrderData>;
|
||||
|
||||
} // namespace gpu
|
||||
|
||||
|
@ -105,7 +105,6 @@ if (enable_vulkan) {
|
||||
deps = [
|
||||
":buildflags",
|
||||
"//base",
|
||||
"//base/util/type_safety",
|
||||
"//build:chromeos_buildflags",
|
||||
"//components/crash/core/common:crash_key",
|
||||
"//gpu/ipc/common:vulkan_ycbcr_info",
|
||||
|
@ -27,7 +27,7 @@ component("win32") {
|
||||
public_configs = [ ":vulkan_win32" ]
|
||||
|
||||
deps = [
|
||||
"//base/util/type_safety",
|
||||
"//base",
|
||||
"//ui/gfx",
|
||||
]
|
||||
|
||||
|
@ -90,7 +90,7 @@ component("ipc") {
|
||||
":mojom",
|
||||
":native_handle_type_converters",
|
||||
":param_traits",
|
||||
"//base/util/type_safety",
|
||||
"//base",
|
||||
"//mojo/public/cpp/base",
|
||||
"//mojo/public/cpp/bindings",
|
||||
"//mojo/public/cpp/system",
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "base/memory/writable_shared_memory_region.h"
|
||||
#include "base/numerics/safe_conversions.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "build/build_config.h"
|
||||
#include "ipc/ipc_param_traits.h"
|
||||
#include "ipc/ipc_sync_message.h"
|
||||
@ -1063,8 +1063,8 @@ struct ParamTraits<absl::optional<P>> {
|
||||
// base/util types ParamTraits
|
||||
|
||||
template <typename TypeMarker, typename WrappedType, WrappedType kInvalidValue>
|
||||
struct ParamTraits<util::IdType<TypeMarker, WrappedType, kInvalidValue>> {
|
||||
using param_type = util::IdType<TypeMarker, WrappedType, kInvalidValue>;
|
||||
struct ParamTraits<base::IdType<TypeMarker, WrappedType, kInvalidValue>> {
|
||||
using param_type = base::IdType<TypeMarker, WrappedType, kInvalidValue>;
|
||||
static void Write(base::Pickle* m, const param_type& p) {
|
||||
WriteParam(m, p.GetUnsafeValue());
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ source_set("filters") {
|
||||
]
|
||||
|
||||
deps = [
|
||||
"//base/util/type_safety:type_safety",
|
||||
"//base",
|
||||
"//build:chromeos_buildflags",
|
||||
"//cc/base", # For MathUtil.
|
||||
"//media:media_buildflags",
|
||||
|
@ -236,7 +236,6 @@ component("bindings") {
|
||||
":bindings_base",
|
||||
":struct_traits",
|
||||
"//base",
|
||||
"//base/util/type_safety",
|
||||
"//ipc:message_support",
|
||||
"//ipc:param_traits",
|
||||
"//mojo/public/cpp/system",
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_refptr.h"
|
||||
#include "base/sequenced_task_runner.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "mojo/public/cpp/bindings/associated_remote.h"
|
||||
#include "mojo/public/cpp/bindings/pending_associated_remote.h"
|
||||
#include "mojo/public/cpp/bindings/pending_remote.h"
|
||||
@ -27,7 +27,7 @@ namespace internal {
|
||||
struct RemoteSetElementIdTypeTag {};
|
||||
} // namespace internal
|
||||
|
||||
using RemoteSetElementId = util::IdTypeU32<internal::RemoteSetElementIdTypeTag>;
|
||||
using RemoteSetElementId = base::IdTypeU32<internal::RemoteSetElementIdTypeTag>;
|
||||
|
||||
// Shared implementation of a set of remotes, used by both RemoteSet and
|
||||
// AssociatedRemoteSet aliases (see below).
|
||||
|
@ -1644,7 +1644,6 @@ source_set("net_deps") {
|
||||
":preload_decoder",
|
||||
"//base",
|
||||
"//base/third_party/dynamic_annotations",
|
||||
"//base/util/type_safety:type_safety",
|
||||
"//net/base/registry_controlled_domains",
|
||||
"//third_party/protobuf:protobuf_lite",
|
||||
"//third_party/zlib",
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "base/sequence_checker.h"
|
||||
#include "base/time/time.h"
|
||||
#include "base/timer/timer.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "components/services/storage/public/cpp/buckets/bucket_id.h"
|
||||
#include "components/services/storage/public/cpp/buckets/bucket_info.h"
|
||||
#include "components/services/storage/public/cpp/quota_error_or.h"
|
||||
|
@ -6,15 +6,15 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "base/types/token_type.h"
|
||||
#include "base/unguessable_token.h"
|
||||
#include "base/util/type_safety/token_type.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
using FooToken = util::TokenType<class FooTokenTag>;
|
||||
using BarToken = util::TokenType<class BarTokenTag>;
|
||||
using BazToken = util::TokenType<class BazTokenTag>;
|
||||
using FooToken = base::TokenType<class FooTokenTag>;
|
||||
using BarToken = base::TokenType<class BarTokenTag>;
|
||||
using BazToken = base::TokenType<class BazTokenTag>;
|
||||
|
||||
// Test MultiTokenVariantCount.
|
||||
static_assert(internal::MultiTokenVariantCount<FooToken, BarToken>::kValue == 2,
|
||||
|
@ -3,7 +3,7 @@
|
||||
## Overview
|
||||
|
||||
This directory contains strongly-typed wrappers (using
|
||||
[`util::TokenType<...>`](/base/util/type_safety/token_type.h)) of
|
||||
[`base::TokenType<...>`](/base/types/token_type.h)) of
|
||||
[`base::UnguessableToken`](/base/unguessable_token.h)
|
||||
for tokens that are commonly passed between browsers and renderers. The strong
|
||||
typing is to prevent type confusion as these tokens are passed around. To support
|
||||
|
@ -18,7 +18,7 @@
|
||||
namespace blink {
|
||||
|
||||
// Defines MultiToken, which is effectively a variant over 2 or more
|
||||
// instances of util::TokenType.
|
||||
// instances of base::TokenType.
|
||||
//
|
||||
// A MultiToken<..> emulates a token like interface. When default constructed
|
||||
// it will construct itself as an instance of |TokenVariant0|. Additionally it
|
||||
@ -34,7 +34,7 @@ namespace blink {
|
||||
//
|
||||
// A variant must have at least 2 valid input types, but can have arbitrarily
|
||||
// many. They must all be distinct, and they must all be instances of
|
||||
// util::TokenType.
|
||||
// base::TokenType.
|
||||
template <typename TokenVariant0,
|
||||
typename TokenVariant1,
|
||||
typename... TokenVariants>
|
||||
|
@ -12,8 +12,8 @@
|
||||
#include <cstring>
|
||||
#include <type_traits>
|
||||
|
||||
#include "base/types/token_type.h"
|
||||
#include "base/unguessable_token.h"
|
||||
#include "base/util/type_safety/token_type.h"
|
||||
|
||||
namespace blink {
|
||||
|
||||
@ -46,7 +46,7 @@ struct MultiTokenVariantCount<> {
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// MultiTokenVariantIsTokenType
|
||||
//
|
||||
// Ensures if a QueryType is a a util::TokenType<>.
|
||||
// Ensures if a QueryType is a a base::TokenType<>.
|
||||
|
||||
// Default case.
|
||||
template <typename QueryType>
|
||||
@ -54,9 +54,9 @@ struct MultiTokenVariantIsTokenType {
|
||||
static constexpr bool kValue = false;
|
||||
};
|
||||
|
||||
// Specialization for util::TokenType<>.
|
||||
// Specialization for base::TokenType<>.
|
||||
template <typename TokenTypeTag>
|
||||
struct MultiTokenVariantIsTokenType<::util::TokenType<TokenTypeTag>> {
|
||||
struct MultiTokenVariantIsTokenType<::base::TokenType<TokenTypeTag>> {
|
||||
static constexpr bool kValue = true;
|
||||
|
||||
// We expect an identical layout, which allows us to reinterpret_cast between
|
||||
@ -64,19 +64,19 @@ struct MultiTokenVariantIsTokenType<::util::TokenType<TokenTypeTag>> {
|
||||
// we can check whether or not the compiler is sane (and if the behaviour is
|
||||
// safe) at compile-time.
|
||||
static_assert(
|
||||
sizeof(::util::TokenType<TokenTypeTag>) ==
|
||||
sizeof(::base::TokenType<TokenTypeTag>) ==
|
||||
sizeof(::base::UnguessableToken),
|
||||
"util::TokenType must have the same sizeof as base::UnguessableToken");
|
||||
"base::TokenType must have the same sizeof as base::UnguessableToken");
|
||||
static_assert(
|
||||
alignof(::util::TokenType<TokenTypeTag>) ==
|
||||
alignof(::base::TokenType<TokenTypeTag>) ==
|
||||
alignof(::base::UnguessableToken),
|
||||
"util::TokenType must have the same alignof as base::UnguessableToken");
|
||||
"base::TokenType must have the same alignof as base::UnguessableToken");
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// MultiTokenAllVariantsAreTokenType
|
||||
//
|
||||
// Ensures that all variants are of type util::TokenType.
|
||||
// Ensures that all variants are of type base::TokenType.
|
||||
|
||||
template <typename... VariantTypes>
|
||||
struct MultiTokenAllVariantsAreTokenType;
|
||||
@ -187,11 +187,11 @@ class MultiTokenBase {
|
||||
using AnyRepeated = internal::MultiTokenAnyTypeRepeated<TokenVariants...>;
|
||||
static_assert(!AnyRepeated::kValue, "input types must not be repeated");
|
||||
|
||||
// Ensures that all variants are instances of util::TokenType.
|
||||
// Ensures that all variants are instances of base::TokenType.
|
||||
using AllVariantsAreTokenType =
|
||||
internal::MultiTokenAllVariantsAreTokenType<TokenVariants...>;
|
||||
static_assert(AllVariantsAreTokenType::kValue,
|
||||
"input types must be instances of util::TokenType");
|
||||
"input types must be instances of base::TokenType");
|
||||
|
||||
// Counts the number of variants.
|
||||
using VariantCount = internal::MultiTokenVariantCount<TokenVariants...>;
|
||||
|
@ -11,7 +11,7 @@ namespace blink {
|
||||
|
||||
// Defines Mojo StructTraits that convert between the given |MojomDataViewType|
|
||||
// and the given |TokenType|. It is assumed that TokenType is an instance of
|
||||
// util::TokenType<...> and that MojomDataViewType is a simple mojom struct
|
||||
// base::TokenType<...> and that MojomDataViewType is a simple mojom struct
|
||||
// containing only a "base.mojom.UnguessableToken value" field.
|
||||
template <typename MojomDataViewType, typename TokenType>
|
||||
struct TokenMojomTraitsHelper {
|
||||
|
24
third_party/blink/public/common/tokens/tokens.h
vendored
24
third_party/blink/public/common/tokens/tokens.h
vendored
@ -5,7 +5,7 @@
|
||||
#ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_TOKENS_TOKENS_H_
|
||||
#define THIRD_PARTY_BLINK_PUBLIC_COMMON_TOKENS_TOKENS_H_
|
||||
|
||||
#include "base/util/type_safety/token_type.h"
|
||||
#include "base/types/token_type.h"
|
||||
#include "third_party/blink/public/common/tokens/multi_token.h"
|
||||
|
||||
namespace blink {
|
||||
@ -26,14 +26,14 @@ namespace blink {
|
||||
// Uniquely identifies a blink::LocalFrame / blink::WebLocalFrame /
|
||||
// content::RenderFrame in a renderer process, and its content::RenderFrameHost
|
||||
// counterpart in the browser.
|
||||
using LocalFrameToken = util::TokenType<class LocalFrameTokenTypeMarker>;
|
||||
using LocalFrameToken = base::TokenType<class LocalFrameTokenTypeMarker>;
|
||||
|
||||
// Uniquely identifies a blink::RemoteFrame / blink::WebRemoteFrame /
|
||||
// content::RenderFrameProxy in a renderer process, and its
|
||||
// content::RenderFrameProxyHost counterpart in the browser. There can be
|
||||
// multiple RemoteFrames corresponding to a single LocalFrame, and each token
|
||||
// will be distinct.
|
||||
using RemoteFrameToken = util::TokenType<class RemoteFrameTokenTypeMarker>;
|
||||
using RemoteFrameToken = base::TokenType<class RemoteFrameTokenTypeMarker>;
|
||||
|
||||
// Can represent either type of FrameToken.
|
||||
using FrameToken = MultiToken<LocalFrameToken, RemoteFrameToken>;
|
||||
@ -44,15 +44,15 @@ using FrameToken = MultiToken<LocalFrameToken, RemoteFrameToken>;
|
||||
// Identifies a blink::DedicatedWorkerGlobalScope in the renderer and a
|
||||
// content::DedicatedWorkerHost in the browser.
|
||||
using DedicatedWorkerToken =
|
||||
util::TokenType<class DedicatedWorkerTokenTypeMarker>;
|
||||
base::TokenType<class DedicatedWorkerTokenTypeMarker>;
|
||||
|
||||
// Identifies a blink::ServiceWorkerGlobalScope in the renderer and a
|
||||
// content::ServiceWorkerVersion in the browser.
|
||||
using ServiceWorkerToken = util::TokenType<class ServiceWorkerTokenTypeMarker>;
|
||||
using ServiceWorkerToken = base::TokenType<class ServiceWorkerTokenTypeMarker>;
|
||||
|
||||
// Identifies a blink::SharedWorkerGlobalScope in the renderer and a
|
||||
// content::SharedWorkerHost in the browser.
|
||||
using SharedWorkerToken = util::TokenType<class SharedWorkerTokenTypeMarker>;
|
||||
using SharedWorkerToken = base::TokenType<class SharedWorkerTokenTypeMarker>;
|
||||
|
||||
// Can represent any type of WorkerToken.
|
||||
using WorkerToken =
|
||||
@ -63,16 +63,16 @@ using WorkerToken =
|
||||
|
||||
// Identifies an animation worklet.
|
||||
using AnimationWorkletToken =
|
||||
util::TokenType<class AnimationWorkletTokenTypeMarker>;
|
||||
base::TokenType<class AnimationWorkletTokenTypeMarker>;
|
||||
|
||||
// Identifies an audio worklet.
|
||||
using AudioWorkletToken = util::TokenType<class AudioWorkletTokenTypeMarker>;
|
||||
using AudioWorkletToken = base::TokenType<class AudioWorkletTokenTypeMarker>;
|
||||
|
||||
// Identifies a layout worklet.
|
||||
using LayoutWorkletToken = util::TokenType<class LayoutWorkletTokenTypeMarker>;
|
||||
using LayoutWorkletToken = base::TokenType<class LayoutWorkletTokenTypeMarker>;
|
||||
|
||||
// Identifies a paint worklet.
|
||||
using PaintWorkletToken = util::TokenType<class PaintWorkletTokenTypeMarker>;
|
||||
using PaintWorkletToken = base::TokenType<class PaintWorkletTokenTypeMarker>;
|
||||
|
||||
// Can represent any type of WorkletToken.
|
||||
using WorkletToken = MultiToken<AnimationWorkletToken,
|
||||
@ -102,10 +102,10 @@ using ExecutionContextToken = MultiToken<LocalFrameToken,
|
||||
|
||||
// Identifies a blink::PortalContents / blink::HTMLPortalElement in the
|
||||
// renderer process, and a content::Portal in the browser process.
|
||||
using PortalToken = util::TokenType<class PortalTokenTypeMarker>;
|
||||
using PortalToken = base::TokenType<class PortalTokenTypeMarker>;
|
||||
|
||||
// Identifies a v8::Context / blink::ScriptState.
|
||||
using V8ContextToken = util::TokenType<class V8ContextTokenTypeMarker>;
|
||||
using V8ContextToken = base::TokenType<class V8ContextTokenTypeMarker>;
|
||||
|
||||
} // namespace blink
|
||||
|
||||
|
@ -20,7 +20,7 @@ executable("ipc_fuzzer") {
|
||||
"rand_util.h",
|
||||
]
|
||||
deps = [
|
||||
"//base/util/type_safety",
|
||||
"//base",
|
||||
"//components/viz/common",
|
||||
"//printing/mojom:mojom_shared_cpp_sources",
|
||||
"//services/device/public/mojom:mojom_headers",
|
||||
|
@ -14,8 +14,8 @@
|
||||
#include "base/cxx17_backports.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/types/id_type.h"
|
||||
#include "base/unguessable_token.h"
|
||||
#include "base/util/type_safety/id_type.h"
|
||||
#include "base/values.h"
|
||||
#include "build/build_config.h"
|
||||
#include "components/content_settings/core/common/content_settings_pattern.h"
|
||||
@ -1029,8 +1029,8 @@ struct FuzzTraits<gfx::Vector2dF> {
|
||||
};
|
||||
|
||||
template <typename TypeMarker, typename WrappedType, WrappedType kInvalidValue>
|
||||
struct FuzzTraits<util::IdType<TypeMarker, WrappedType, kInvalidValue>> {
|
||||
using param_type = util::IdType<TypeMarker, WrappedType, kInvalidValue>;
|
||||
struct FuzzTraits<base::IdType<TypeMarker, WrappedType, kInvalidValue>> {
|
||||
using param_type = base::IdType<TypeMarker, WrappedType, kInvalidValue>;
|
||||
static bool Fuzz(param_type* id, Fuzzer* fuzzer) {
|
||||
WrappedType raw_value = id->GetUnsafeValue();
|
||||
if (!FuzzParam(&raw_value, fuzzer))
|
||||
|
@ -442,10 +442,10 @@ component("base") {
|
||||
|
||||
deps = [
|
||||
":locales_list",
|
||||
"//base",
|
||||
"//base:base_static",
|
||||
"//base:i18n",
|
||||
"//base/third_party/dynamic_annotations",
|
||||
"//base/util/type_safety:type_safety",
|
||||
"//build:chromeos_buildflags",
|
||||
"//net",
|
||||
"//third_party/brotli:dec",
|
||||
|
Reference in New Issue
Block a user