mirror of
https://github.com/electron/electron.git
synced 2026-01-10 16:08:06 -05:00
Co-authored-by: Samuel Attard <sattard@salesforce.com> Co-authored-by: VerteDinde <vertedinde@electronjs.org> Co-authored-by: Keeley Hammond <khammond@slack-corp.com> Co-authored-by: Jeremy Rose <jeremya@chromium.org>
60 lines
2.9 KiB
Diff
60 lines
2.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: John Kleinschmidt <jkleinsc@electronjs.org>
|
|
Date: Thu, 1 Sep 2022 11:31:24 -0400
|
|
Subject: disable optimization guide for preconnect feature
|
|
|
|
The optimization guide component
|
|
(https://source.chromium.org/chromium/chromium/src/+/main:components/optimization_guide/)
|
|
is not enabled for Electron, but the preconnect feature uses the resource prefetch
|
|
predictor code which includes this component. This patch disables the optimization guide
|
|
component code in the resource prefetch predictor code since it is unused and including
|
|
it causes compilation problems on Windows.
|
|
|
|
diff --git a/chrome/browser/predictors/resource_prefetch_predictor.cc b/chrome/browser/predictors/resource_prefetch_predictor.cc
|
|
index 603c4094711700a5ae5b3769f161fc9149ccac75..e54844f7d331d60b9780d89747ecc333a4176c5d 100644
|
|
--- a/chrome/browser/predictors/resource_prefetch_predictor.cc
|
|
+++ b/chrome/browser/predictors/resource_prefetch_predictor.cc
|
|
@@ -100,10 +100,12 @@ PreconnectPrediction& PreconnectPrediction::operator=(
|
|
PreconnectPrediction& PreconnectPrediction::operator=(
|
|
PreconnectPrediction&& other) = default;
|
|
|
|
+#if 0
|
|
OptimizationGuidePrediction::OptimizationGuidePrediction() = default;
|
|
OptimizationGuidePrediction::OptimizationGuidePrediction(
|
|
const OptimizationGuidePrediction& prediction) = default;
|
|
OptimizationGuidePrediction::~OptimizationGuidePrediction() = default;
|
|
+#endif
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
// ResourcePrefetchPredictor static functions.
|
|
diff --git a/chrome/browser/predictors/resource_prefetch_predictor.h b/chrome/browser/predictors/resource_prefetch_predictor.h
|
|
index 60b0eaabd98695838fffd9a7255fd017fe2a01f0..a3d12988d28ef5be0507994d0ef3922aea44b22c 100644
|
|
--- a/chrome/browser/predictors/resource_prefetch_predictor.h
|
|
+++ b/chrome/browser/predictors/resource_prefetch_predictor.h
|
|
@@ -26,7 +26,9 @@
|
|
#include "components/history/core/browser/history_service_observer.h"
|
|
#include "components/history/core/browser/history_types.h"
|
|
#include "components/keyed_service/core/keyed_service.h"
|
|
+#if 0
|
|
#include "components/optimization_guide/content/browser/optimization_guide_decider.h"
|
|
+#endif
|
|
#include "components/sqlite_proto/key_value_data.h"
|
|
#include "net/base/network_isolation_key.h"
|
|
#include "services/network/public/mojom/fetch_api.mojom-forward.h"
|
|
@@ -110,6 +112,7 @@ struct PreconnectPrediction {
|
|
std::vector<PrefetchRequest> prefetch_requests;
|
|
};
|
|
|
|
+#if 0
|
|
// Stores a result of a prediction from the optimization guide.
|
|
struct OptimizationGuidePrediction {
|
|
OptimizationGuidePrediction();
|
|
@@ -121,6 +124,7 @@ struct OptimizationGuidePrediction {
|
|
std::vector<GURL> predicted_subresources;
|
|
absl::optional<base::TimeTicks> optimization_guide_prediction_arrived;
|
|
};
|
|
+#endif
|
|
|
|
// Contains logic for learning what can be prefetched and for kicking off
|
|
// speculative prefetching.
|