Commit 1adcf7bc authored by Chris Hamilton's avatar Chris Hamilton Committed by Commit Bot

Create FrameToken typemaps.

This makes FrameTokens consistent with WorkerTokens. A further CL will
migrate usage of base::UnguessableToken to FrameToken.

BUG=1096617

Change-Id: If29b4e50b17b4ead953b378339df214afd619ddd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2314276
Commit-Queue: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792301}
parent 29b0ea0b
...@@ -168,6 +168,8 @@ source_set("headers") { ...@@ -168,6 +168,8 @@ source_set("headers") {
"sms/sms_receiver_destroyed_reason.h", "sms/sms_receiver_destroyed_reason.h",
"sms/sms_receiver_outcome.h", "sms/sms_receiver_outcome.h",
"switches.h", "switches.h",
"tokens/frame_token.h",
"tokens/frame_token_mojom_traits.h",
"tokens/token_mojom_traits_helper.h", "tokens/token_mojom_traits_helper.h",
"tokens/worker_tokens.h", "tokens/worker_tokens.h",
"tokens/worker_tokens_mojom_traits.h", "tokens/worker_tokens_mojom_traits.h",
......
// Copyright 2020 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_COMMON_TOKENS_FRAME_TOKEN_H_
#define THIRD_PARTY_BLINK_PUBLIC_COMMON_TOKENS_FRAME_TOKEN_H_
#include "base/util/type_safety/token_type.h"
namespace blink {
// Frame token type. Note that this token is type-mapped to its mojom equivalent
// (defined in third_party/blink/public/mojom/tokens/frame_token.mojom). See
// frame_token_mojom_traits.h for the StructTraits.
using FrameToken = util::TokenType<class FrameTokenTypeMarker>;
} // namespace blink
#endif // THIRD_PARTY_BLINK_PUBLIC_COMMON_TOKENS_FRAME_TOKEN_H_
// Copyright 2020 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_COMMON_TOKENS_FRAME_TOKEN_MOJOM_TRAITS_H_
#define THIRD_PARTY_BLINK_PUBLIC_COMMON_TOKENS_FRAME_TOKEN_MOJOM_TRAITS_H_
#include "third_party/blink/public/common/tokens/frame_token.h"
#include "third_party/blink/public/common/tokens/token_mojom_traits_helper.h"
#include "third_party/blink/public/mojom/tokens/frame_token.mojom-shared.h"
namespace mojo {
template <>
struct StructTraits<blink::mojom::FrameTokenDataView, blink::FrameToken>
: public blink::TokenMojomTraitsHelper<blink::mojom::FrameTokenDataView,
blink::FrameToken> {};
} // namespace mojo
#endif // THIRD_PARTY_BLINK_PUBLIC_COMMON_TOKENS_FRAME_TOKEN_MOJOM_TRAITS_H_
...@@ -34,6 +34,17 @@ mojom_component("tokens") { ...@@ -34,6 +34,17 @@ mojom_component("tokens") {
"//third_party/blink/public/common/tokens/worker_tokens_mojom_traits.h", "//third_party/blink/public/common/tokens/worker_tokens_mojom_traits.h",
] ]
}, },
{
types = [
{
mojom = "blink.mojom.FrameToken"
cpp = "::blink::FrameToken"
},
]
traits_headers = [
"//third_party/blink/public/common/tokens/frame_token_mojom_traits.h",
]
},
] ]
cpp_typemaps = shared_cpp_typemaps cpp_typemaps = shared_cpp_typemaps
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment