From dc8e8ac2ae042661c9ae79eb2925343d43a75868 Mon Sep 17 00:00:00 2001 From: Gyuyoung Kim Date: Fri, 6 Nov 2020 13:40:16 +0900 Subject: [PATCH] Remove components-assist_ranker-ranker_url_fetcher.cc.patch file This PR override RankerURLFetcher::Request() to return false. --- .../assist_ranker/ranker_url_fetcher.cc | 21 +++++++++++++++++++ .../assist_ranker/ranker_url_fetcher.h | 17 +++++++++++++++ ...-assist_ranker-ranker_url_fetcher.cc.patch | 12 ----------- 3 files changed, 38 insertions(+), 12 deletions(-) create mode 100644 chromium_src/components/assist_ranker/ranker_url_fetcher.cc create mode 100644 chromium_src/components/assist_ranker/ranker_url_fetcher.h delete mode 100644 patches/components-assist_ranker-ranker_url_fetcher.cc.patch diff --git a/chromium_src/components/assist_ranker/ranker_url_fetcher.cc b/chromium_src/components/assist_ranker/ranker_url_fetcher.cc new file mode 100644 index 00000000000..77d9d3df2ce --- /dev/null +++ b/chromium_src/components/assist_ranker/ranker_url_fetcher.cc @@ -0,0 +1,21 @@ +/* Copyright (c) 2020 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * you can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "components/assist_ranker/ranker_url_fetcher.h" + +#define Request Request_ChromiumImpl +#include "../../../../components/assist_ranker/ranker_url_fetcher.cc" +#undef Request + +namespace assist_ranker { + +bool RankerURLFetcher::Request( + const GURL& url, + RankerURLFetcher::Callback callback, + network::mojom::URLLoaderFactory* url_loader_factory) { + return false; +} + +} // namespace assist_ranker diff --git a/chromium_src/components/assist_ranker/ranker_url_fetcher.h b/chromium_src/components/assist_ranker/ranker_url_fetcher.h new file mode 100644 index 00000000000..034b1affca5 --- /dev/null +++ b/chromium_src/components/assist_ranker/ranker_url_fetcher.h @@ -0,0 +1,17 @@ +/* Copyright (c) 2020 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * you can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef BRAVE_CHROMIUM_SRC_COMPONENTS_ASSIST_RANKER_RANKER_URL_FETCHER_H_ +#define BRAVE_CHROMIUM_SRC_COMPONENTS_ASSIST_RANKER_RANKER_URL_FETCHER_H_ + +#define Request \ + Request_ChromiumImpl(const GURL& url, Callback callback, \ + network::mojom::URLLoaderFactory* url_loader_factory); \ + bool Request + +#include "../../../../components/assist_ranker/ranker_url_fetcher.h" +#undef Request + +#endif // BRAVE_CHROMIUM_SRC_COMPONENTS_ASSIST_RANKER_RANKER_URL_FETCHER_H_ diff --git a/patches/components-assist_ranker-ranker_url_fetcher.cc.patch b/patches/components-assist_ranker-ranker_url_fetcher.cc.patch deleted file mode 100644 index 0c17548a8d7..00000000000 --- a/patches/components-assist_ranker-ranker_url_fetcher.cc.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/components/assist_ranker/ranker_url_fetcher.cc b/components/assist_ranker/ranker_url_fetcher.cc -index b57f1610eaf2ea991fca458819e36a759e8baf64..7f2fd1e6283e474244de0375cc642452c32e9237 100644 ---- a/components/assist_ranker/ranker_url_fetcher.cc -+++ b/components/assist_ranker/ranker_url_fetcher.cc -@@ -31,6 +31,7 @@ bool RankerURLFetcher::Request( - const GURL& url, - RankerURLFetcher::Callback callback, - network::mojom::URLLoaderFactory* url_loader_factory) { -+ return false; // feature disabled in Brave - // This function is not supposed to be called if the previous operation is not - // finished. - if (state_ == REQUESTING) {