Update all Performance Scenario callers to use scenario_api paths
Remove the Blink forwarding headers. Bug: 365586676 Change-Id: I5f904df4f11e297e3a5ab289dc35739098b997f8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6262781 Commit-Queue: Joe Mason <joenotcharles@google.com> Reviewed-by: Dave Tapuska <dtapuska@chromium.org> Reviewed-by: Orin Jaworski <orinj@chromium.org> Reviewed-by: Jeremy Roman <jbroman@chromium.org> Cr-Commit-Position: refs/heads/main@{#1420136}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
3e53a94893
commit
5e3b89e6ea
components/passage_embeddings
content
DEPS
browser
BUILD.gn
renderer_host
child
BUILD.gnchild_performance_coordinator.ccchild_performance_coordinator.hchild_performance_coordinator_unittest.cc
test
third_party/blink
public
common
tools
blinkpy
presubmit
@@ -28,13 +28,10 @@ static_library("passage_embeddings") {
|
|||||||
"//build:blink_buildflags",
|
"//build:blink_buildflags",
|
||||||
"//components/optimization_guide/core",
|
"//components/optimization_guide/core",
|
||||||
"//components/optimization_guide/proto:optimization_guide_proto",
|
"//components/optimization_guide/proto:optimization_guide_proto",
|
||||||
|
"//components/performance_manager/scenario_api",
|
||||||
"//mojo/public/cpp/bindings",
|
"//mojo/public/cpp/bindings",
|
||||||
"//services/passage_embeddings/public/mojom",
|
"//services/passage_embeddings/public/mojom",
|
||||||
]
|
]
|
||||||
|
|
||||||
if (use_blink) {
|
|
||||||
deps += [ "//third_party/blink/public/common:headers" ]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
source_set("unit_tests") {
|
source_set("unit_tests") {
|
||||||
|
@@ -2,7 +2,7 @@ include_rules = [
|
|||||||
"+components/keyed_service/core",
|
"+components/keyed_service/core",
|
||||||
"+components/optimization_guide/core",
|
"+components/optimization_guide/core",
|
||||||
"+components/optimization_guide/proto",
|
"+components/optimization_guide/proto",
|
||||||
|
"+components/performance_manager/scenario_api",
|
||||||
"+mojo/public/cpp/bindings",
|
"+mojo/public/cpp/bindings",
|
||||||
"+services/passage_embeddings/public/mojom",
|
"+services/passage_embeddings/public/mojom",
|
||||||
"+third_party/blink/public/common",
|
|
||||||
]
|
]
|
||||||
|
@@ -22,11 +22,9 @@ namespace passage_embeddings {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
#if BUILDFLAG(USE_BLINK)
|
using ScenarioScope = performance_scenarios::ScenarioScope;
|
||||||
using ScenarioScope = blink::performance_scenarios::ScenarioScope;
|
using LoadingScenario = performance_scenarios::LoadingScenario;
|
||||||
using LoadingScenario = blink::performance_scenarios::LoadingScenario;
|
using InputScenario = performance_scenarios::InputScenario;
|
||||||
using InputScenario = blink::performance_scenarios::InputScenario;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
std::string PassagePriorityToString(PassagePriority priority) {
|
std::string PassagePriorityToString(PassagePriority priority) {
|
||||||
switch (priority) {
|
switch (priority) {
|
||||||
@@ -100,17 +98,12 @@ SchedulingEmbedder::SchedulingEmbedder(std::unique_ptr<Embedder> embedder,
|
|||||||
max_jobs_(max_jobs),
|
max_jobs_(max_jobs),
|
||||||
max_batch_size_(max_batch_size),
|
max_batch_size_(max_batch_size),
|
||||||
use_performance_scenario_(use_performance_scenario) {
|
use_performance_scenario_(use_performance_scenario) {
|
||||||
#if BUILDFLAG(USE_BLINK)
|
|
||||||
if (use_performance_scenario_) {
|
if (use_performance_scenario_) {
|
||||||
performance_scenario_observation_.Observe(
|
performance_scenario_observation_.Observe(
|
||||||
blink::performance_scenarios::PerformanceScenarioObserverList::
|
performance_scenarios::PerformanceScenarioObserverList::GetForScope(
|
||||||
GetForScope(ScenarioScope::kGlobal)
|
ScenarioScope::kGlobal)
|
||||||
.get());
|
.get());
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
// Performance scenario is not supported on some builds (e.g. iOS by default).
|
|
||||||
use_performance_scenario_ = false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SchedulingEmbedder::~SchedulingEmbedder() = default;
|
SchedulingEmbedder::~SchedulingEmbedder() = default;
|
||||||
@@ -215,7 +208,6 @@ void SchedulingEmbedder::SubmitWorkToEmbedder() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool SchedulingEmbedder::IsPerformanceScenarioReady() {
|
bool SchedulingEmbedder::IsPerformanceScenarioReady() {
|
||||||
#if BUILDFLAG(USE_BLINK)
|
|
||||||
if (!jobs_.empty() &&
|
if (!jobs_.empty() &&
|
||||||
jobs_.front().priority == PassagePriority::kUserInitiated) {
|
jobs_.front().priority == PassagePriority::kUserInitiated) {
|
||||||
// Do not block on performance scenario if user initiated a query.
|
// Do not block on performance scenario if user initiated a query.
|
||||||
@@ -223,17 +215,14 @@ bool SchedulingEmbedder::IsPerformanceScenarioReady() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LoadingScenario loading_scenario =
|
LoadingScenario loading_scenario =
|
||||||
blink::performance_scenarios::GetLoadingScenario(ScenarioScope::kGlobal)
|
performance_scenarios::GetLoadingScenario(ScenarioScope::kGlobal)
|
||||||
->load(std::memory_order_relaxed);
|
->load(std::memory_order_relaxed);
|
||||||
InputScenario input_scenario =
|
InputScenario input_scenario =
|
||||||
blink::performance_scenarios::GetInputScenario(ScenarioScope::kGlobal)
|
performance_scenarios::GetInputScenario(ScenarioScope::kGlobal)
|
||||||
->load(std::memory_order_relaxed);
|
->load(std::memory_order_relaxed);
|
||||||
return (loading_scenario == LoadingScenario::kNoPageLoading ||
|
return (loading_scenario == LoadingScenario::kNoPageLoading ||
|
||||||
loading_scenario == LoadingScenario::kBackgroundPageLoading) &&
|
loading_scenario == LoadingScenario::kBackgroundPageLoading) &&
|
||||||
input_scenario == InputScenario::kNoInput;
|
input_scenario == InputScenario::kNoInput;
|
||||||
#else
|
|
||||||
return true;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SchedulingEmbedder::SetOnEmbedderReadyCallback(
|
void SchedulingEmbedder::SetOnEmbedderReadyCallback(
|
||||||
@@ -270,7 +259,6 @@ void SchedulingEmbedder::SetEmbedderMetadata(EmbedderMetadata metadata) {
|
|||||||
SubmitWorkToEmbedder();
|
SubmitWorkToEmbedder();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BUILDFLAG(USE_BLINK)
|
|
||||||
void SchedulingEmbedder::OnLoadingScenarioChanged(
|
void SchedulingEmbedder::OnLoadingScenarioChanged(
|
||||||
ScenarioScope scope,
|
ScenarioScope scope,
|
||||||
LoadingScenario old_scenario,
|
LoadingScenario old_scenario,
|
||||||
@@ -287,7 +275,6 @@ void SchedulingEmbedder::OnInputScenarioChanged(ScenarioScope scope,
|
|||||||
<< static_cast<int>(new_scenario);
|
<< static_cast<int>(new_scenario);
|
||||||
SubmitWorkToEmbedder();
|
SubmitWorkToEmbedder();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void SchedulingEmbedder::OnEmbeddingsComputed(std::vector<std::string> passages,
|
void SchedulingEmbedder::OnEmbeddingsComputed(std::vector<std::string> passages,
|
||||||
std::vector<Embedding> embeddings,
|
std::vector<Embedding> embeddings,
|
||||||
|
@@ -16,15 +16,11 @@
|
|||||||
#include "base/scoped_observation.h"
|
#include "base/scoped_observation.h"
|
||||||
#include "base/time/time.h"
|
#include "base/time/time.h"
|
||||||
#include "base/timer/elapsed_timer.h"
|
#include "base/timer/elapsed_timer.h"
|
||||||
#include "build/blink_buildflags.h"
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "components/passage_embeddings/embedder.h"
|
#include "components/passage_embeddings/embedder.h"
|
||||||
#include "components/passage_embeddings/passage_embeddings_types.h"
|
#include "components/passage_embeddings/passage_embeddings_types.h"
|
||||||
|
#include "components/performance_manager/scenario_api/performance_scenario_observer.h"
|
||||||
#if BUILDFLAG(USE_BLINK)
|
#include "components/performance_manager/scenario_api/performance_scenarios.h"
|
||||||
#include "third_party/blink/public/common/performance/performance_scenario_observer.h"
|
|
||||||
#include "third_party/blink/public/common/performance/performance_scenarios.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace passage_embeddings {
|
namespace passage_embeddings {
|
||||||
|
|
||||||
@@ -35,12 +31,8 @@ namespace passage_embeddings {
|
|||||||
// changes, all existing passages need their embeddings recomputed, which can
|
// changes, all existing passages need their embeddings recomputed, which can
|
||||||
// take a very long time and should be done at lower priority.
|
// take a very long time and should be done at lower priority.
|
||||||
class SchedulingEmbedder
|
class SchedulingEmbedder
|
||||||
: public Embedder
|
: public Embedder,
|
||||||
#if BUILDFLAG(USE_BLINK)
|
public performance_scenarios::PerformanceScenarioObserver {
|
||||||
,
|
|
||||||
public blink::performance_scenarios::PerformanceScenarioObserver
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
SchedulingEmbedder(std::unique_ptr<Embedder> embedder,
|
SchedulingEmbedder(std::unique_ptr<Embedder> embedder,
|
||||||
size_t max_jobs,
|
size_t max_jobs,
|
||||||
@@ -75,17 +67,15 @@ class SchedulingEmbedder
|
|||||||
|
|
||||||
void SetEmbedderMetadata(EmbedderMetadata metadata) override;
|
void SetEmbedderMetadata(EmbedderMetadata metadata) override;
|
||||||
|
|
||||||
#if BUILDFLAG(USE_BLINK)
|
|
||||||
// PerformanceScenarioObserver:
|
// PerformanceScenarioObserver:
|
||||||
void OnLoadingScenarioChanged(
|
void OnLoadingScenarioChanged(
|
||||||
blink::performance_scenarios::ScenarioScope scope,
|
performance_scenarios::ScenarioScope scope,
|
||||||
blink::performance_scenarios::LoadingScenario old_scenario,
|
performance_scenarios::LoadingScenario old_scenario,
|
||||||
blink::performance_scenarios::LoadingScenario new_scenario) override;
|
performance_scenarios::LoadingScenario new_scenario) override;
|
||||||
void OnInputScenarioChanged(
|
void OnInputScenarioChanged(
|
||||||
blink::performance_scenarios::ScenarioScope scope,
|
performance_scenarios::ScenarioScope scope,
|
||||||
blink::performance_scenarios::InputScenario old_scenario,
|
performance_scenarios::InputScenario old_scenario,
|
||||||
blink::performance_scenarios::InputScenario new_scenario) override;
|
performance_scenarios::InputScenario new_scenario) override;
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// A job consists of multiple passages, and each passage must have its
|
// A job consists of multiple passages, and each passage must have its
|
||||||
@@ -174,12 +164,10 @@ class SchedulingEmbedder
|
|||||||
// Whether to block embedding work submission on performance scenario.
|
// Whether to block embedding work submission on performance scenario.
|
||||||
bool use_performance_scenario_;
|
bool use_performance_scenario_;
|
||||||
|
|
||||||
#if BUILDFLAG(USE_BLINK)
|
|
||||||
base::ScopedObservation<
|
base::ScopedObservation<
|
||||||
blink::performance_scenarios::PerformanceScenarioObserverList,
|
performance_scenarios::PerformanceScenarioObserverList,
|
||||||
SchedulingEmbedder>
|
SchedulingEmbedder>
|
||||||
performance_scenario_observation_{this};
|
performance_scenario_observation_{this};
|
||||||
#endif
|
|
||||||
|
|
||||||
base::WeakPtrFactory<SchedulingEmbedder> weak_ptr_factory_{this};
|
base::WeakPtrFactory<SchedulingEmbedder> weak_ptr_factory_{this};
|
||||||
};
|
};
|
||||||
|
@@ -33,6 +33,9 @@ include_rules = [
|
|||||||
# components/performance_manager sits between chrome/ and content/, except for
|
# components/performance_manager sits between chrome/ and content/, except for
|
||||||
# the mojo interfaces it exposes to content/ and third_party/blink/.
|
# the mojo interfaces it exposes to content/ and third_party/blink/.
|
||||||
"+components/performance_manager/public/mojom",
|
"+components/performance_manager/public/mojom",
|
||||||
|
# components/performance_manager/scenario_api is a subcomponent that can
|
||||||
|
# query performance_manager scenarios from content/ and third_party/blink/.
|
||||||
|
"+components/performance_manager/scenario_api",
|
||||||
"+components/services/filesystem",
|
"+components/services/filesystem",
|
||||||
"+components/services/font/public",
|
"+components/services/font/public",
|
||||||
"+components/services/font_data/public",
|
"+components/services/font_data/public",
|
||||||
|
@@ -118,6 +118,7 @@ source_set("browser") {
|
|||||||
"//components/os_crypt/sync",
|
"//components/os_crypt/sync",
|
||||||
"//components/payments/content/icon",
|
"//components/payments/content/icon",
|
||||||
"//components/payments/mojom",
|
"//components/payments/mojom",
|
||||||
|
"//components/performance_manager/scenario_api",
|
||||||
"//components/power_monitor",
|
"//components/power_monitor",
|
||||||
"//components/services/filesystem:lib",
|
"//components/services/filesystem:lib",
|
||||||
"//components/services/quarantine:quarantine",
|
"//components/services/quarantine:quarantine",
|
||||||
|
@@ -12,6 +12,7 @@
|
|||||||
#include "base/no_destructor.h"
|
#include "base/no_destructor.h"
|
||||||
#include "base/strings/strcat.h"
|
#include "base/strings/strcat.h"
|
||||||
#include "base/system/sys_info.h"
|
#include "base/system/sys_info.h"
|
||||||
|
#include "components/performance_manager/scenario_api/performance_scenarios.h"
|
||||||
#include "content/browser/renderer_host/render_process_host_impl.h"
|
#include "content/browser/renderer_host/render_process_host_impl.h"
|
||||||
#include "content/browser/site_instance_impl.h"
|
#include "content/browser/site_instance_impl.h"
|
||||||
#include "content/common/features.h"
|
#include "content/common/features.h"
|
||||||
@@ -20,13 +21,12 @@
|
|||||||
#include "content/public/browser/render_process_host.h"
|
#include "content/public/browser/render_process_host.h"
|
||||||
#include "content/public/common/content_client.h"
|
#include "content/public/common/content_client.h"
|
||||||
#include "content/public/common/content_features.h"
|
#include "content/public/common/content_features.h"
|
||||||
#include "third_party/blink/public/common/performance/performance_scenarios.h"
|
|
||||||
|
|
||||||
namespace content {
|
namespace content {
|
||||||
|
|
||||||
using blink::performance_scenarios::LoadingScenario;
|
using performance_scenarios::LoadingScenario;
|
||||||
using blink::performance_scenarios::PerformanceScenarioObserverList;
|
using performance_scenarios::PerformanceScenarioObserverList;
|
||||||
using blink::performance_scenarios::ScenarioScope;
|
using performance_scenarios::ScenarioScope;
|
||||||
using SpareProcessMaybeTakeAction =
|
using SpareProcessMaybeTakeAction =
|
||||||
content::RenderProcessHostImpl::SpareProcessMaybeTakeAction;
|
content::RenderProcessHostImpl::SpareProcessMaybeTakeAction;
|
||||||
|
|
||||||
@@ -286,7 +286,7 @@ SpareRenderProcessHostManagerImpl::SpareRenderProcessHostManagerImpl()
|
|||||||
performance_scenario_observer_list->AddObserver(this);
|
performance_scenario_observer_list->AddObserver(this);
|
||||||
|
|
||||||
is_browser_idle_ =
|
is_browser_idle_ =
|
||||||
blink::performance_scenarios::GetLoadingScenario(ScenarioScope::kGlobal)
|
performance_scenarios::GetLoadingScenario(ScenarioScope::kGlobal)
|
||||||
->load(std::memory_order_relaxed) ==
|
->load(std::memory_order_relaxed) ==
|
||||||
LoadingScenario::kNoPageLoading;
|
LoadingScenario::kNoPageLoading;
|
||||||
}
|
}
|
||||||
|
@@ -13,11 +13,11 @@
|
|||||||
#include "base/time/time.h"
|
#include "base/time/time.h"
|
||||||
#include "base/timer/elapsed_timer.h"
|
#include "base/timer/elapsed_timer.h"
|
||||||
#include "base/timer/timer.h"
|
#include "base/timer/timer.h"
|
||||||
|
#include "components/performance_manager/scenario_api/performance_scenario_observer.h"
|
||||||
#include "content/common/content_export.h"
|
#include "content/common/content_export.h"
|
||||||
#include "content/public/browser/process_allocation_context.h"
|
#include "content/public/browser/process_allocation_context.h"
|
||||||
#include "content/public/browser/render_process_host_observer.h"
|
#include "content/public/browser/render_process_host_observer.h"
|
||||||
#include "content/public/browser/spare_render_process_host_manager.h"
|
#include "content/public/browser/spare_render_process_host_manager.h"
|
||||||
#include "third_party/blink/public/common/performance/performance_scenario_observer.h"
|
|
||||||
|
|
||||||
namespace content {
|
namespace content {
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ enum class NoSpareRendererReason {
|
|||||||
class CONTENT_EXPORT SpareRenderProcessHostManagerImpl
|
class CONTENT_EXPORT SpareRenderProcessHostManagerImpl
|
||||||
: public SpareRenderProcessHostManager,
|
: public SpareRenderProcessHostManager,
|
||||||
public RenderProcessHostObserver,
|
public RenderProcessHostObserver,
|
||||||
public blink::performance_scenarios::PerformanceScenarioObserver {
|
public performance_scenarios::PerformanceScenarioObserver {
|
||||||
public:
|
public:
|
||||||
SpareRenderProcessHostManagerImpl();
|
SpareRenderProcessHostManagerImpl();
|
||||||
~SpareRenderProcessHostManagerImpl() override;
|
~SpareRenderProcessHostManagerImpl() override;
|
||||||
@@ -151,11 +151,11 @@ class CONTENT_EXPORT SpareRenderProcessHostManagerImpl
|
|||||||
const ChildProcessTerminationInfo& info) override;
|
const ChildProcessTerminationInfo& info) override;
|
||||||
void RenderProcessHostDestroyed(RenderProcessHost* host) override;
|
void RenderProcessHostDestroyed(RenderProcessHost* host) override;
|
||||||
|
|
||||||
// blink::performance_scenarios::PerformanceScenarioObserver:
|
// performance_scenarios::PerformanceScenarioObserver:
|
||||||
void OnLoadingScenarioChanged(
|
void OnLoadingScenarioChanged(
|
||||||
blink::performance_scenarios::ScenarioScope scope,
|
performance_scenarios::ScenarioScope scope,
|
||||||
blink::performance_scenarios::LoadingScenario old_scenario,
|
performance_scenarios::LoadingScenario old_scenario,
|
||||||
blink::performance_scenarios::LoadingScenario new_scenario) override;
|
performance_scenarios::LoadingScenario new_scenario) override;
|
||||||
|
|
||||||
void SetIsBrowserIdle(bool is_browser_idle);
|
void SetIsBrowserIdle(bool is_browser_idle);
|
||||||
|
|
||||||
|
@@ -75,6 +75,7 @@ target(link_target_type, "child") {
|
|||||||
"//components/discardable_memory/public/mojom",
|
"//components/discardable_memory/public/mojom",
|
||||||
"//components/metrics",
|
"//components/metrics",
|
||||||
"//components/performance_manager/public/mojom",
|
"//components/performance_manager/public/mojom",
|
||||||
|
"//components/performance_manager/scenario_api",
|
||||||
"//components/permissions:permissions_common",
|
"//components/permissions:permissions_common",
|
||||||
"//components/tracing:startup_tracing",
|
"//components/tracing:startup_tracing",
|
||||||
"//components/variations",
|
"//components/variations",
|
||||||
|
@@ -13,9 +13,9 @@
|
|||||||
#include "base/memory/weak_ptr.h"
|
#include "base/memory/weak_ptr.h"
|
||||||
#include "base/sequence_checker.h"
|
#include "base/sequence_checker.h"
|
||||||
#include "components/performance_manager/public/mojom/coordination_unit.mojom.h"
|
#include "components/performance_manager/public/mojom/coordination_unit.mojom.h"
|
||||||
|
#include "components/performance_manager/scenario_api/performance_scenarios.h"
|
||||||
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
||||||
#include "mojo/public/cpp/bindings/remote.h"
|
#include "mojo/public/cpp/bindings/remote.h"
|
||||||
#include "third_party/blink/public/common/performance/performance_scenarios.h"
|
|
||||||
#include "third_party/perfetto/include/perfetto/tracing/track.h"
|
#include "third_party/perfetto/include/perfetto/tracing/track.h"
|
||||||
|
|
||||||
namespace content {
|
namespace content {
|
||||||
@@ -40,7 +40,7 @@ void ChildPerformanceCoordinator::OnInitializeChildProcessCoordination(
|
|||||||
base::ReadOnlySharedMemoryRegion global_region,
|
base::ReadOnlySharedMemoryRegion global_region,
|
||||||
base::ReadOnlySharedMemoryRegion process_region) {
|
base::ReadOnlySharedMemoryRegion process_region) {
|
||||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||||
using blink::performance_scenarios::ScenarioScope;
|
using performance_scenarios::ScenarioScope;
|
||||||
if (global_region.IsValid()) {
|
if (global_region.IsValid()) {
|
||||||
global_scenario_memory_.emplace(ScenarioScope::kGlobal,
|
global_scenario_memory_.emplace(ScenarioScope::kGlobal,
|
||||||
std::move(global_region));
|
std::move(global_region));
|
||||||
|
@@ -11,10 +11,10 @@
|
|||||||
#include "base/memory/weak_ptr.h"
|
#include "base/memory/weak_ptr.h"
|
||||||
#include "base/sequence_checker.h"
|
#include "base/sequence_checker.h"
|
||||||
#include "components/performance_manager/public/mojom/coordination_unit.mojom.h"
|
#include "components/performance_manager/public/mojom/coordination_unit.mojom.h"
|
||||||
|
#include "components/performance_manager/scenario_api/performance_scenarios.h"
|
||||||
#include "content/common/content_export.h"
|
#include "content/common/content_export.h"
|
||||||
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
||||||
#include "mojo/public/cpp/bindings/remote.h"
|
#include "mojo/public/cpp/bindings/remote.h"
|
||||||
#include "third_party/blink/public/common/performance/performance_scenarios.h"
|
|
||||||
|
|
||||||
namespace content {
|
namespace content {
|
||||||
|
|
||||||
@@ -50,10 +50,10 @@ class CONTENT_EXPORT ChildPerformanceCoordinator {
|
|||||||
|
|
||||||
// Scopers to manage the lifetime of shared memory regions for performance
|
// Scopers to manage the lifetime of shared memory regions for performance
|
||||||
// scenarios. These regions are read by functions in
|
// scenarios. These regions are read by functions in
|
||||||
// //third_party/blink/public/common/performance/performance_scenarios.h.
|
// //components/performance_manager/scenario_api/performance_scenarios.h.
|
||||||
std::optional<blink::performance_scenarios::ScopedReadOnlyScenarioMemory>
|
std::optional<performance_scenarios::ScopedReadOnlyScenarioMemory>
|
||||||
process_scenario_memory_ GUARDED_BY_CONTEXT(sequence_checker_);
|
process_scenario_memory_ GUARDED_BY_CONTEXT(sequence_checker_);
|
||||||
std::optional<blink::performance_scenarios::ScopedReadOnlyScenarioMemory>
|
std::optional<performance_scenarios::ScopedReadOnlyScenarioMemory>
|
||||||
global_scenario_memory_ GUARDED_BY_CONTEXT(sequence_checker_);
|
global_scenario_memory_ GUARDED_BY_CONTEXT(sequence_checker_);
|
||||||
|
|
||||||
base::WeakPtrFactory<ChildPerformanceCoordinator> weak_factory_{this};
|
base::WeakPtrFactory<ChildPerformanceCoordinator> weak_factory_{this};
|
||||||
|
@@ -14,19 +14,19 @@
|
|||||||
#include "base/task/sequenced_task_runner.h"
|
#include "base/task/sequenced_task_runner.h"
|
||||||
#include "base/test/task_environment.h"
|
#include "base/test/task_environment.h"
|
||||||
#include "components/performance_manager/public/mojom/coordination_unit.mojom.h"
|
#include "components/performance_manager/public/mojom/coordination_unit.mojom.h"
|
||||||
|
#include "components/performance_manager/scenario_api/performance_scenarios.h"
|
||||||
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
||||||
#include "mojo/public/cpp/bindings/receiver.h"
|
#include "mojo/public/cpp/bindings/receiver.h"
|
||||||
#include "testing/gmock/include/gmock/gmock.h"
|
#include "testing/gmock/include/gmock/gmock.h"
|
||||||
#include "testing/gtest/include/gtest/gtest.h"
|
#include "testing/gtest/include/gtest/gtest.h"
|
||||||
#include "third_party/blink/public/common/performance/performance_scenarios.h"
|
|
||||||
|
|
||||||
namespace content {
|
namespace content {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using blink::performance_scenarios::ScenarioScope;
|
|
||||||
using blink::performance_scenarios::ScenarioState;
|
|
||||||
using blink::performance_scenarios::ScopedReadOnlyScenarioMemory;
|
|
||||||
using performance_manager::mojom::ChildProcessCoordinationUnit;
|
using performance_manager::mojom::ChildProcessCoordinationUnit;
|
||||||
|
using performance_scenarios::ScenarioScope;
|
||||||
|
using performance_scenarios::ScenarioState;
|
||||||
|
using performance_scenarios::ScopedReadOnlyScenarioMemory;
|
||||||
using ::testing::_;
|
using ::testing::_;
|
||||||
using ::testing::Invoke;
|
using ::testing::Invoke;
|
||||||
|
|
||||||
|
@@ -3085,6 +3085,7 @@ test("content_unittests") {
|
|||||||
"//components/offline_pages/buildflags",
|
"//components/offline_pages/buildflags",
|
||||||
"//components/payments/mojom",
|
"//components/payments/mojom",
|
||||||
"//components/performance_manager/public/mojom",
|
"//components/performance_manager/public/mojom",
|
||||||
|
"//components/performance_manager/scenario_api",
|
||||||
"//components/permissions:permissions_common",
|
"//components/permissions:permissions_common",
|
||||||
"//components/permissions:test_support",
|
"//components/permissions:test_support",
|
||||||
"//components/services/quarantine/public/mojom",
|
"//components/services/quarantine/public/mojom",
|
||||||
|
3
third_party/blink/public/common/BUILD.gn
vendored
3
third_party/blink/public/common/BUILD.gn
vendored
@@ -268,8 +268,6 @@ source_set("headers") {
|
|||||||
"peerconnection/webrtc_ip_handling_policy.h",
|
"peerconnection/webrtc_ip_handling_policy.h",
|
||||||
"peerconnection/webrtc_ip_handling_url_entry.h",
|
"peerconnection/webrtc_ip_handling_url_entry.h",
|
||||||
"performance/largest_contentful_paint_type.h",
|
"performance/largest_contentful_paint_type.h",
|
||||||
"performance/performance_scenario_observer.h",
|
|
||||||
"performance/performance_scenarios.h",
|
|
||||||
"performance/performance_timeline_constants.h",
|
"performance/performance_timeline_constants.h",
|
||||||
"permissions/permission_utils.h",
|
"permissions/permission_utils.h",
|
||||||
"permissions_policy/document_policy.h",
|
"permissions_policy/document_policy.h",
|
||||||
@@ -355,7 +353,6 @@ source_set("headers") {
|
|||||||
"//base",
|
"//base",
|
||||||
"//cc",
|
"//cc",
|
||||||
"//components/content_settings/core/common",
|
"//components/content_settings/core/common",
|
||||||
"//components/performance_manager/scenario_api",
|
|
||||||
"//components/shared_highlighting/core/common",
|
"//components/shared_highlighting/core/common",
|
||||||
"//components/viz/common",
|
"//components/viz/common",
|
||||||
"//gpu/command_buffer/common",
|
"//gpu/command_buffer/common",
|
||||||
|
1
third_party/blink/public/common/DEPS
vendored
1
third_party/blink/public/common/DEPS
vendored
@@ -10,7 +10,6 @@ include_rules = [
|
|||||||
"+build",
|
"+build",
|
||||||
"+cc/paint/element_id.h",
|
"+cc/paint/element_id.h",
|
||||||
"+cc/trees/browser_controls_params.h",
|
"+cc/trees/browser_controls_params.h",
|
||||||
"+components/performance_manager/scenario_api",
|
|
||||||
"+components/viz/common/surfaces/local_surface_id.h",
|
"+components/viz/common/surfaces/local_surface_id.h",
|
||||||
"+components/viz/common/view_transition_element_resource_id.h",
|
"+components/viz/common/view_transition_element_resource_id.h",
|
||||||
"+gpu/command_buffer/client/client_shared_image.h",
|
"+gpu/command_buffer/client/client_shared_image.h",
|
||||||
|
@@ -1,29 +0,0 @@
|
|||||||
// Copyright 2024 The Chromium Authors
|
|
||||||
// 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_PERFORMANCE_PERFORMANCE_SCENARIO_OBSERVER_H_
|
|
||||||
#define THIRD_PARTY_BLINK_PUBLIC_COMMON_PERFORMANCE_PERFORMANCE_SCENARIO_OBSERVER_H_
|
|
||||||
|
|
||||||
// Forwarding header that imports types from ::performance_scenarios into
|
|
||||||
// ::blink::performance_scenarios.
|
|
||||||
//
|
|
||||||
// TODO(crbug.com/365586676): Convert all callers to use
|
|
||||||
// components/performance_manager/scenario_api and delete this.
|
|
||||||
|
|
||||||
#include "components/performance_manager/scenario_api/performance_scenario_observer.h" // IWYU pragma: export
|
|
||||||
|
|
||||||
// PerformanceScenarioObserver uses types from this header in its signature so
|
|
||||||
// they must be forwarded too.
|
|
||||||
#include "third_party/blink/public/common/performance/performance_scenarios.h" // IWYU pragma: export
|
|
||||||
|
|
||||||
namespace blink::performance_scenarios {
|
|
||||||
|
|
||||||
using PerformanceScenarioObserver =
|
|
||||||
::performance_scenarios::PerformanceScenarioObserver;
|
|
||||||
using PerformanceScenarioObserverList =
|
|
||||||
::performance_scenarios::PerformanceScenarioObserverList;
|
|
||||||
|
|
||||||
} // namespace blink::performance_scenarios
|
|
||||||
|
|
||||||
#endif // THIRD_PARTY_BLINK_PUBLIC_COMMON_PERFORMANCE_PERFORMANCE_SCENARIO_OBSERVER_H_
|
|
@@ -1,44 +0,0 @@
|
|||||||
// Copyright 2024 The Chromium Authors
|
|
||||||
// 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_PERFORMANCE_PERFORMANCE_SCENARIOS_H_
|
|
||||||
#define THIRD_PARTY_BLINK_PUBLIC_COMMON_PERFORMANCE_PERFORMANCE_SCENARIOS_H_
|
|
||||||
|
|
||||||
// Forwarding header that imports types from ::performance_scenarios into
|
|
||||||
// ::blink::performance_scenarios.
|
|
||||||
//
|
|
||||||
// TODO(crbug.com/365586676): Convert all callers to use
|
|
||||||
// components/performance_manager/scenario_api and delete this.
|
|
||||||
|
|
||||||
#include "base/compiler_specific.h"
|
|
||||||
#include "components/performance_manager/scenario_api/performance_scenarios.h" // IWYU pragma: export
|
|
||||||
|
|
||||||
namespace blink::performance_scenarios {
|
|
||||||
|
|
||||||
using InputScenario = ::performance_scenarios::InputScenario;
|
|
||||||
using LoadingScenario = ::performance_scenarios::LoadingScenario;
|
|
||||||
using RefCountedScenarioMapping =
|
|
||||||
::performance_scenarios::RefCountedScenarioMapping;
|
|
||||||
using ScenarioScope = ::performance_scenarios::ScenarioScope;
|
|
||||||
using ScenarioState = ::performance_scenarios::ScenarioState;
|
|
||||||
using ScopedReadOnlyScenarioMemory =
|
|
||||||
::performance_scenarios::ScopedReadOnlyScenarioMemory;
|
|
||||||
template <typename T>
|
|
||||||
using SharedAtomicRef = ::performance_scenarios::SharedAtomicRef<T>;
|
|
||||||
|
|
||||||
// If not inlined these function shims will lead to duplicate symbol errors.
|
|
||||||
|
|
||||||
ALWAYS_INLINE SharedAtomicRef<InputScenario> GetInputScenario(
|
|
||||||
ScenarioScope scope) {
|
|
||||||
return ::performance_scenarios::GetInputScenario(scope);
|
|
||||||
}
|
|
||||||
|
|
||||||
ALWAYS_INLINE SharedAtomicRef<LoadingScenario> GetLoadingScenario(
|
|
||||||
ScenarioScope scope) {
|
|
||||||
return ::performance_scenarios::GetLoadingScenario(scope);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace blink::performance_scenarios
|
|
||||||
|
|
||||||
#endif // THIRD_PARTY_BLINK_PUBLIC_COMMON_PERFORMANCE_PERFORMANCE_SCENARIOS_H_
|
|
@@ -419,17 +419,6 @@ _CONFIG = [
|
|||||||
'network::DataElementBytes',
|
'network::DataElementBytes',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
# Forwarding header importing ::performance_scenarios symbols into
|
|
||||||
# blink::performance_scenarios.
|
|
||||||
'paths': [
|
|
||||||
'third_party/blink/public/common/performance/performance_scenarios.h',
|
|
||||||
'third_party/blink/public/common/performance/performance_scenario_observer.h',
|
|
||||||
],
|
|
||||||
'allowed': [
|
|
||||||
'performance_scenarios::.+',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
'paths': [
|
'paths': [
|
||||||
'third_party/blink/common/shared_storage/module_script_downloader.cc',
|
'third_party/blink/common/shared_storage/module_script_downloader.cc',
|
||||||
|
Reference in New Issue
Block a user