Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 1c225eb4 authored by Carmelo Messina's avatar Carmelo Messina
Browse files

Disable all predictors code: disable RaceNetworkRequest (#1445)

parent 82773311
Loading
Loading
Loading
Loading
+26 −14
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
 .../page_content_annotations_model_manager.cc    |  1 +
 .../notification_content_detection/BUILD.gn      |  7 +++++++
 components/safe_browsing/core/common/features.cc |  1 +
 .../service_worker_main_resource_loader.cc       |  1 +
 .../Disable-all-predictors-code.inc              |  2 ++
 .../Disable-all-predictors-code.inc              |  1 +
 .../Disable-all-predictors-code.inc              |  1 +
@@ -52,7 +53,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
 .../core/html/parser/html_document_parser.cc     |  1 +
 .../document_speculation_rules.cc                |  1 +
 .../platform/runtime_enabled_features.json5      |  2 +-
 47 files changed, 123 insertions(+), 47 deletions(-)
 48 files changed, 124 insertions(+), 47 deletions(-)
 create mode 100644 cromite_flags/chrome/browser/browser_features_cc/Disable-all-predictors-code.inc
 create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Disable-all-predictors-code.inc
 create mode 100644 cromite_flags/chrome/common/chrome_features_cc/Disable-all-predictors-code.inc
@@ -343,7 +344,7 @@ diff --git a/chrome/browser/ui/tab_helpers.cc b/chrome/browser/ui/tab_helpers.cc
diff --git a/chrome/renderer/accessibility/read_anything/read_aloud_app_model.cc b/chrome/renderer/accessibility/read_anything/read_aloud_app_model.cc
--- a/chrome/renderer/accessibility/read_anything/read_aloud_app_model.cc
+++ b/chrome/renderer/accessibility/read_anything/read_aloud_app_model.cc
@@ -16,7 +16,9 @@
@@ -15,7 +15,9 @@
 #include "base/task/task_traits.h"
 #include "base/task/thread_pool.h"
 #include "base/values.h"
@@ -353,7 +354,7 @@ diff --git a/chrome/renderer/accessibility/read_anything/read_aloud_app_model.cc
 #include "chrome/renderer/accessibility/phrase_segmentation/dependency_tree.h"
 #include "chrome/renderer/accessibility/phrase_segmentation/phrase_segmenter.h"
 #include "chrome/renderer/accessibility/phrase_segmentation/token_boundaries.h"
@@ -26,6 +28,7 @@
@@ -25,6 +27,7 @@
 
 namespace {
 
@@ -361,7 +362,7 @@ diff --git a/chrome/renderer/accessibility/read_anything/read_aloud_app_model.cc
 // Returns the dependency parser model for this renderer process.
 DependencyParserModel& GetDependencyParserModel_() {
   static base::NoDestructor<DependencyParserModel> instance;
@@ -38,6 +41,7 @@ std::vector<size_t> GetDependencyHeads(base::span<const std::string> input) {
@@ -37,6 +40,7 @@ std::vector<size_t> GetDependencyHeads(base::span<const std::string> input) {
              ? dependency_parser_model.GetDependencyHeads(input)
              : std::vector<size_t>();
 }
@@ -369,7 +370,7 @@ diff --git a/chrome/renderer/accessibility/read_anything/read_aloud_app_model.cc
 
 }  // namespace
 
@@ -149,10 +153,13 @@ void ReadAloudAppModel::PreprocessTextForSpeech(
@@ -148,10 +152,13 @@ void ReadAloudAppModel::PreprocessTextForSpeech(
   }
 }
 
@@ -383,7 +384,7 @@ diff --git a/chrome/renderer/accessibility/read_anything/read_aloud_app_model.cc
 void ReadAloudAppModel::CalculatePhrases(
     a11y::ReadAloudCurrentGranularity& granularity) {
   if (!features::IsReadAnythingReadAloudPhraseHighlightingEnabled()) {
@@ -209,19 +216,23 @@ void ReadAloudAppModel::CalculatePhrases(
@@ -208,19 +215,23 @@ void ReadAloudAppModel::CalculatePhrases(
       base::BindOnce(&ReadAloudAppModel::UpdatePhraseBoundaries,
                      weak_ptr_factory_.GetWeakPtr(), phrase_tokens));
 }
@@ -409,7 +410,7 @@ diff --git a/chrome/renderer/accessibility/read_anything/read_aloud_app_model.cc
   // Reset the phrase calculation flag, so that the next phrase calculation can
   // be scheduled, if needed.
   is_calculating_phrases = false;
@@ -283,6 +294,7 @@ void ReadAloudAppModel::UpdatePhraseBoundaries(std::vector<std::string> tokens,
@@ -282,6 +293,7 @@ void ReadAloudAppModel::UpdatePhraseBoundaries(std::vector<std::string> tokens,
     current_phrase_calculation_index_ = -1;
     LOG(WARNING) << "All phrases calculated!";
   }
@@ -431,7 +432,7 @@ diff --git a/chrome/renderer/accessibility/read_anything/read_aloud_app_model.h
 #include "chrome/renderer/accessibility/read_anything/read_aloud_traversal_utils.h"
 #include "ui/accessibility/ax_node_position.h"
 
@@ -112,8 +115,10 @@ class ReadAloudAppModel {
@@ -86,8 +89,10 @@ class ReadAloudAppModel {
                                bool is_docs,
                                const std::set<ui::AXNodeID>* current_nodes);
 
@@ -442,7 +443,7 @@ diff --git a/chrome/renderer/accessibility/read_anything/read_aloud_app_model.h
 
   // Increments the processed_granularity_index_, updating ReadAloud's state of
   // the current granularity to refer to the next granularity. The current
@@ -269,9 +274,11 @@ class ReadAloudAppModel {
@@ -241,9 +246,11 @@ class ReadAloudAppModel {
   //      still needs to be read.
   bool NoValidTextRemainingInCurrentNode(bool is_pdf, bool is_docs) const;
 
@@ -454,7 +455,7 @@ diff --git a/chrome/renderer/accessibility/read_anything/read_aloud_app_model.h
 
   // Once the phrase segmentation has completed for a given sentence, update the
   // granularity with the phrase boundaries, and calculate phrases for the next
@@ -333,7 +340,7 @@ class ReadAloudAppModel {
@@ -305,7 +312,7 @@ class ReadAloudAppModel {
 
   // Whether a phrase calculation for a sentence is currently underway. (We
   // do not initiate a second calculation before the first has completed.)
@@ -476,7 +477,7 @@ diff --git a/chrome/renderer/accessibility/read_anything/read_anything_app_contr
 #include "chrome/renderer/accessibility/read_anything/read_aloud_traversal_utils.h"
 #include "chrome/renderer/accessibility/read_anything/read_anything_app_model.h"
 #include "chrome/renderer/accessibility/read_anything/read_anything_node_utils.h"
@@ -1462,6 +1464,7 @@ void ReadAnythingAppController::OnConnected() {
@@ -1454,6 +1456,7 @@ void ReadAnythingAppController::OnConnected() {
   render_frame()->GetBrowserInterfaceBroker().GetInterface(
       std::move(page_handler_factory_receiver));
 
@@ -484,7 +485,7 @@ diff --git a/chrome/renderer/accessibility/read_anything/read_anything_app_contr
   // Get the dependency parser model used by phrase-based highlighting.
   if (read_aloud_model_.GetDependencyParserModel().IsAvailable()) {
     return;
@@ -1470,6 +1473,7 @@ void ReadAnythingAppController::OnConnected() {
@@ -1462,6 +1465,7 @@ void ReadAnythingAppController::OnConnected() {
   page_handler_->GetDependencyParserModel(
       base::BindOnce(&ReadAnythingAppController::UpdateDependencyParserModel,
                      weak_ptr_factory_.GetWeakPtr()));
@@ -492,7 +493,7 @@ diff --git a/chrome/renderer/accessibility/read_anything/read_anything_app_contr
 }
 
 void ReadAnythingAppController::OnCopy() const {
@@ -1674,11 +1678,13 @@ std::vector<ui::AXNodeID> ReadAnythingAppController::GetCurrentText() {
@@ -1666,11 +1670,13 @@ std::vector<ui::AXNodeID> ReadAnythingAppController::GetCurrentText() {
 }
 
 void ReadAnythingAppController::PreprocessTextForSpeech() {
@@ -506,7 +507,7 @@ diff --git a/chrome/renderer/accessibility/read_anything/read_anything_app_contr
 }
 
 void ReadAnythingAppController::MovePositionToNextGranularity() {
@@ -1856,14 +1862,18 @@ bool ReadAnythingAppController::IsDocsLoadMoreButtonVisible() const {
@@ -1848,14 +1854,18 @@ bool ReadAnythingAppController::IsDocsLoadMoreButtonVisible() const {
 
 void ReadAnythingAppController::UpdateDependencyParserModel(
     base::File model_file) {
@@ -864,6 +865,17 @@ diff --git a/components/safe_browsing/core/common/features.cc b/components/safe_
 
 constexpr base::FeatureParam<int>
     kOnDeviceNotificationContentDetectionModelAllowlistSamplingRate{
diff --git a/content/browser/service_worker/service_worker_main_resource_loader.cc b/content/browser/service_worker/service_worker_main_resource_loader.cc
--- a/content/browser/service_worker/service_worker_main_resource_loader.cc
+++ b/content/browser/service_worker/service_worker_main_resource_loader.cc
@@ -517,6 +517,7 @@ bool ServiceWorkerMainResourceLoader::MaybeStartAutoPreload(
 bool ServiceWorkerMainResourceLoader::StartRaceNetworkRequest(
     scoped_refptr<ServiceWorkerContextWrapper> context,
     scoped_refptr<ServiceWorkerVersion> version) {
+  if ((true)) return false;
   // Set fetch_handler_bypass_option to tell the renderer that
   // RaceNetworkRequest is enabled.
   version->set_fetch_handler_bypass_option(
diff --git a/cromite_flags/chrome/browser/browser_features_cc/Disable-all-predictors-code.inc b/cromite_flags/chrome/browser/browser_features_cc/Disable-all-predictors-code.inc
new file mode 100644
--- /dev/null