Commit ec1fdad7 authored by Etienne Pierre-doray's avatar Etienne Pierre-doray Committed by Commit Bot

[MessageLoop]: Replace MessageLoopCurrent::task_runner() in /components/subresource_filter.

MessageLoopCurrent::task_runner() is depecated.
This CL replaces it with with ThreadTaskRunnerHandle::Get().
A small step towards deleting MessageLoop.

This CL was generated with git cl split.
Refer to the top-level CL if necessary :
https://chromium-review.googlesource.com/c/chromium/src/+/1631693

Please CQ if LGTY!

This CL was uploaded by git cl split.

R=engedy@chromium.org

Bug: 616447
Change-Id: I78c543a8602663c3d2f8a11bafdd4f65309dfebc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1636356
Auto-Submit: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: default avatarBalazs Engedy <engedy@chromium.org>
Commit-Queue: Balazs Engedy <engedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664924}
parent 21f59b73
......@@ -13,12 +13,12 @@
#include "base/bind_helpers.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/message_loop/message_loop_current.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_simple_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "components/subresource_filter/content/browser/async_document_subresource_filter.h"
#include "components/subresource_filter/content/browser/subresource_filter_client.h"
......@@ -189,7 +189,7 @@ class ContentSubresourceFilterThrottleManagerTest
// tests, to ensure that the NavigationSimulator properly runs all necessary
// tasks while waiting for throttle checks to finish.
dealer_handle_ = std::make_unique<VerifiedRulesetDealer::Handle>(
base::MessageLoopCurrent::Get()->task_runner());
base::ThreadTaskRunnerHandle::Get());
dealer_handle_->TryOpenAndSetRulesetFile(test_ruleset_pair_.indexed.path,
/*expected_checksum=*/0,
base::DoNothing());
......
......@@ -10,10 +10,10 @@
#include "base/bind_helpers.h"
#include "base/callback.h"
#include "base/message_loop/message_loop_current.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/threading/thread_task_runner_handle.h"
#include "components/subresource_filter/content/browser/async_document_subresource_filter.h"
#include "components/subresource_filter/content/browser/async_document_subresource_filter_test_utils.h"
#include "components/subresource_filter/content/browser/subresource_filter_observer_test_utils.h"
......@@ -94,7 +94,7 @@ class SubframeNavigationFilteringThrottleTest
// tests, to ensure that the NavigationSimulator properly runs all necessary
// tasks while waiting for throttle checks to finish.
dealer_handle_ = std::make_unique<VerifiedRulesetDealer::Handle>(
base::MessageLoopCurrent::Get()->task_runner());
base::ThreadTaskRunnerHandle::Get());
dealer_handle_->TryOpenAndSetRulesetFile(test_ruleset_pair_.indexed.path,
/*expected_checksum=*/0,
base::DoNothing());
......
......@@ -13,12 +13,12 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/message_loop/message_loop_current.h"
#include "base/metrics/field_trial.h"
#include "base/run_loop.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_mock_time_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "components/safe_browsing/db/test_database_manager.h"
#include "components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.h"
......@@ -155,7 +155,7 @@ class SubresourceFilterSafeBrowsingActivationThrottleTest
ASSERT_NO_FATAL_FAILURE(test_ruleset_creator_.CreateRulesetWithRules(
rules, &test_ruleset_pair_));
ruleset_dealer_ = std::make_unique<VerifiedRulesetDealer::Handle>(
base::MessageLoopCurrent::Get()->task_runner());
base::ThreadTaskRunnerHandle::Get());
ruleset_dealer_->TryOpenAndSetRulesetFile(test_ruleset_pair_.indexed.path,
/*expected_checksum=*/0,
base::DoNothing());
......
......@@ -9,7 +9,7 @@
#include "base/bind.h"
#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop_current.h"
#include "base/threading/thread_task_runner_handle.h"
#include "components/subresource_filter/core/common/load_policy.h"
#include "components/subresource_filter/core/common/memory_mapped_ruleset.h"
#include "components/subresource_filter/core/mojom/subresource_filter.mojom.h"
......@@ -157,7 +157,7 @@ WebDocumentSubresourceFilterImpl::BuilderImpl::BuilderImpl(
ruleset_file_(std::move(ruleset_file)),
first_disallowed_load_callback_(
std::move(first_disallowed_load_callback)),
main_task_runner_(base::MessageLoopCurrent::Get()->task_runner()) {}
main_task_runner_(base::ThreadTaskRunnerHandle::Get()) {}
WebDocumentSubresourceFilterImpl::BuilderImpl::~BuilderImpl() {}
std::unique_ptr<blink::WebDocumentSubresourceFilter>
......
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