Commit 0d911b2d authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Reduce the size of frame.h

This CL reduce the estimated pre-processed size of frame.h by 6.61MB.

- frame.h should use
  user_activation_notification_type.mojom-blink-forward.h instead of
  frame.mojom-blink.h.

- user_activation_state.h, which is included from frame.h, should use
  user_activation_notification_type.mojom-forward.h instead of
  user_activation_notification_type.mojom-shared.h.

This CL has no behavior changes.

Bug: 242216
Change-Id: Iae968c3a820a3d327ff46bf017dbd72dc77c3137
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2319496Reviewed-by: default avatarTakuto Ikuta <tikuta@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791762}
parent 7c30dd65
......@@ -4,6 +4,8 @@
#include "third_party/blink/public/common/frame/user_activation_state.h"
#include "third_party/blink/public/mojom/frame/user_activation_notification_type.mojom-shared.h"
namespace blink {
// The expiry time should be long enough to allow network round trips even in a
......@@ -11,6 +13,9 @@ namespace blink {
// not too long to make an "unattneded" page feel activated.
constexpr base::TimeDelta kActivationLifespan = base::TimeDelta::FromSeconds(5);
UserActivationState::UserActivationState()
: notification_type_(mojom::UserActivationNotificationType::kNone) {}
void UserActivationState::Activate(
mojom::UserActivationNotificationType notification_type) {
has_been_active_ = true;
......@@ -18,6 +23,10 @@ void UserActivationState::Activate(
ActivateTransientState();
}
void UserActivationState::Activate() {
Activate(mojom::UserActivationNotificationType::kNone);
}
void UserActivationState::Clear() {
has_been_active_ = false;
notification_type_ = mojom::UserActivationNotificationType::kNone;
......
......@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "third_party/blink/public/common/frame/user_activation_state.h"
#include "third_party/blink/public/mojom/frame/user_activation_notification_type.mojom-blink-forward.h"
#include "third_party/blink/public/mojom/frame/user_activation_notification_type.mojom-blink.h"
#include "testing/gtest/include/gtest/gtest.h"
......
......@@ -7,7 +7,7 @@
#include "base/time/time_override.h"
#include "third_party/blink/public/common/common_export.h"
#include "third_party/blink/public/mojom/frame/user_activation_notification_type.mojom-shared.h"
#include "third_party/blink/public/mojom/frame/user_activation_notification_type.mojom-forward.h"
namespace blink {
......@@ -88,12 +88,14 @@ namespace blink {
// https://docs.google.com/document/d/1XL3vCedkqL65ueaGVD-kfB5RnnrnTaxLc7kmU91oerg
class BLINK_COMMON_EXPORT UserActivationState {
public:
UserActivationState();
// Marks the user activation state as active, which sets the sticky state to
// true and updates the transient state timestamp to "now".
//
// The |notification_type| parameter is used for histograms only.
void Activate(mojom::UserActivationNotificationType notification_type =
mojom::UserActivationNotificationType::kNone);
void Activate(mojom::UserActivationNotificationType notification_type);
void Activate();
void Clear();
......@@ -124,8 +126,7 @@ class BLINK_COMMON_EXPORT UserActivationState {
base::TimeTicks transient_state_expiry_time_;
// Tracks the type of notification for UMA data.
mojom::UserActivationNotificationType notification_type_ =
mojom::UserActivationNotificationType::kNone;
mojom::UserActivationNotificationType notification_type_;
};
} // namespace blink
......
......@@ -37,8 +37,8 @@
#include "third_party/blink/public/common/frame/user_activation_state.h"
#include "third_party/blink/public/common/frame/user_activation_update_source.h"
#include "third_party/blink/public/mojom/ad_tagging/ad_frame.mojom-blink-forward.h"
#include "third_party/blink/public/mojom/frame/frame.mojom-blink.h"
#include "third_party/blink/public/mojom/frame/frame_owner_properties.mojom-blink-forward.h"
#include "third_party/blink/public/mojom/frame/user_activation_notification_type.mojom-blink-forward.h"
#include "third_party/blink/public/mojom/input/scroll_direction.mojom-blink-forward.h"
#include "third_party/blink/public/web/web_frame_load_type.h"
#include "third_party/blink/renderer/core/core_export.h"
......
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