Commit 3f03e935 authored by Ken Rockot's avatar Ken Rockot Committed by Commit Bot

🚫Bind: components/data_reduction_proxy/

Migrates some directories off of deprecated base::Bind, base::Callback,
etc, and onto the newer APIs.

Specifically this covers components/data_reduction_proxy/

Fixed: 1007681
Change-Id: I9c137caef120d3a0d50b905456cdc13543029056
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1979140
Auto-Submit: Ken Rockot <rockot@google.com>
Commit-Queue: rajendrant <rajendrant@chromium.org>
Reviewed-by: default avatarrajendrant <rajendrant@chromium.org>
Cr-Commit-Position: refs/heads/master@{#727833}
parent c92b1ea4
...@@ -333,13 +333,13 @@ void DataReductionProxyCompressionStats::Init() { ...@@ -333,13 +333,13 @@ void DataReductionProxyCompressionStats::Init() {
data_usage_reporting_enabled_.Init( data_usage_reporting_enabled_.Init(
prefs::kDataUsageReportingEnabled, pref_service_, prefs::kDataUsageReportingEnabled, pref_service_,
base::Bind( base::BindRepeating(
&DataReductionProxyCompressionStats::OnDataUsageReportingPrefChanged, &DataReductionProxyCompressionStats::OnDataUsageReportingPrefChanged,
weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
if (data_usage_reporting_enabled_.GetValue()) { if (data_usage_reporting_enabled_.GetValue()) {
current_data_usage_load_status_ = LOADING; current_data_usage_load_status_ = LOADING;
service_->LoadCurrentDataUsageBucket(base::Bind( service_->LoadCurrentDataUsageBucket(base::BindRepeating(
&DataReductionProxyCompressionStats::OnCurrentDataUsageLoaded, &DataReductionProxyCompressionStats::OnCurrentDataUsageLoaded,
weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
} }
...@@ -522,8 +522,9 @@ void DataReductionProxyCompressionStats::GetContentLengths( ...@@ -522,8 +522,9 @@ void DataReductionProxyCompressionStats::GetContentLengths(
} }
void DataReductionProxyCompressionStats::GetHistoricalDataUsage( void DataReductionProxyCompressionStats::GetHistoricalDataUsage(
const HistoricalDataUsageCallback& get_data_usage_callback) { HistoricalDataUsageCallback get_data_usage_callback) {
GetHistoricalDataUsageImpl(get_data_usage_callback, base::Time::Now()); GetHistoricalDataUsageImpl(std::move(get_data_usage_callback),
base::Time::Now());
} }
void DataReductionProxyCompressionStats::DeleteBrowsingHistory( void DataReductionProxyCompressionStats::DeleteBrowsingHistory(
...@@ -751,7 +752,7 @@ void DataReductionProxyCompressionStats::DeleteHistoricalDataUsage() { ...@@ -751,7 +752,7 @@ void DataReductionProxyCompressionStats::DeleteHistoricalDataUsage() {
} }
void DataReductionProxyCompressionStats::GetHistoricalDataUsageImpl( void DataReductionProxyCompressionStats::GetHistoricalDataUsageImpl(
const HistoricalDataUsageCallback& get_data_usage_callback, HistoricalDataUsageCallback get_data_usage_callback,
const base::Time& now) { const base::Time& now) {
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
if (current_data_usage_load_status_ != LOADED) { if (current_data_usage_load_status_ != LOADED) {
...@@ -759,8 +760,8 @@ void DataReductionProxyCompressionStats::GetHistoricalDataUsageImpl( ...@@ -759,8 +760,8 @@ void DataReductionProxyCompressionStats::GetHistoricalDataUsageImpl(
// extension can retry after a slight delay. // extension can retry after a slight delay.
// This use case is unlikely to occur in practice since current data usage // This use case is unlikely to occur in practice since current data usage
// should have sufficient time to load before user tries to view data usage. // should have sufficient time to load before user tries to view data usage.
get_data_usage_callback.Run( std::move(get_data_usage_callback)
std::make_unique<std::vector<DataUsageBucket>>()); .Run(std::make_unique<std::vector<DataUsageBucket>>());
return; return;
} }
#endif #endif
...@@ -779,14 +780,14 @@ void DataReductionProxyCompressionStats::GetHistoricalDataUsageImpl( ...@@ -779,14 +780,14 @@ void DataReductionProxyCompressionStats::GetHistoricalDataUsageImpl(
service_->StoreCurrentDataUsageBucket(std::move(data_usage_bucket)); service_->StoreCurrentDataUsageBucket(std::move(data_usage_bucket));
} }
service_->LoadHistoricalDataUsage(get_data_usage_callback); service_->LoadHistoricalDataUsage(std::move(get_data_usage_callback));
} }
void DataReductionProxyCompressionStats::OnDataUsageReportingPrefChanged() { void DataReductionProxyCompressionStats::OnDataUsageReportingPrefChanged() {
if (data_usage_reporting_enabled_.GetValue()) { if (data_usage_reporting_enabled_.GetValue()) {
if (current_data_usage_load_status_ == NOT_LOADED) { if (current_data_usage_load_status_ == NOT_LOADED) {
current_data_usage_load_status_ = LOADING; current_data_usage_load_status_ = LOADING;
service_->LoadCurrentDataUsageBucket(base::Bind( service_->LoadCurrentDataUsageBucket(base::BindOnce(
&DataReductionProxyCompressionStats::OnCurrentDataUsageLoaded, &DataReductionProxyCompressionStats::OnCurrentDataUsageLoaded,
weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
} }
......
...@@ -135,7 +135,7 @@ class DataReductionProxyCompressionStats { ...@@ -135,7 +135,7 @@ class DataReductionProxyCompressionStats {
// in-memory stats could be initialized from storage. Data usage is sorted // in-memory stats could be initialized from storage. Data usage is sorted
// chronologically with the last entry corresponding to |base::Time::Now()|. // chronologically with the last entry corresponding to |base::Time::Now()|.
void GetHistoricalDataUsage( void GetHistoricalDataUsage(
const HistoricalDataUsageCallback& get_data_usage_callback); HistoricalDataUsageCallback get_data_usage_callback);
// Deletes browsing history from storage and memory for the given time // Deletes browsing history from storage and memory for the given time
// range. Currently, this method deletes all data usage for the given range. // range. Currently, this method deletes all data usage for the given range.
...@@ -242,7 +242,7 @@ class DataReductionProxyCompressionStats { ...@@ -242,7 +242,7 @@ class DataReductionProxyCompressionStats {
// Actual implementation of |GetHistoricalDataUsage|. This helper method // Actual implementation of |GetHistoricalDataUsage|. This helper method
// explicitly passes |base::Time::Now()| to make testing easier. // explicitly passes |base::Time::Now()| to make testing easier.
void GetHistoricalDataUsageImpl( void GetHistoricalDataUsageImpl(
const HistoricalDataUsageCallback& get_data_usage_callback, HistoricalDataUsageCallback get_data_usage_callback,
const base::Time& now); const base::Time& now);
// Called when |prefs::kDataUsageReportingEnabled| pref values changes. // Called when |prefs::kDataUsageReportingEnabled| pref values changes.
......
...@@ -302,15 +302,15 @@ class DataReductionProxyCompressionStatsTest : public testing::Test { ...@@ -302,15 +302,15 @@ class DataReductionProxyCompressionStatsTest : public testing::Test {
original_size, time); original_size, time);
} }
void GetHistoricalDataUsage( void GetHistoricalDataUsage(HistoricalDataUsageCallback on_load_data_usage,
const HistoricalDataUsageCallback& onLoadDataUsage,
const base::Time& now) { const base::Time& now) {
compression_stats_->GetHistoricalDataUsageImpl(onLoadDataUsage, now); compression_stats_->GetHistoricalDataUsageImpl(
std::move(on_load_data_usage), now);
} }
void LoadHistoricalDataUsage( void LoadHistoricalDataUsage(HistoricalDataUsageCallback on_load_data_usage) {
const HistoricalDataUsageCallback& onLoadDataUsage) { compression_stats_->service_->LoadHistoricalDataUsage(
compression_stats_->service_->LoadHistoricalDataUsage(onLoadDataUsage); std::move(on_load_data_usage));
} }
void DeleteHistoricalDataUsage() { void DeleteHistoricalDataUsage() {
...@@ -700,7 +700,7 @@ TEST_F(DataReductionProxyCompressionStatsTest, RecordDataUsageSingleSite) { ...@@ -700,7 +700,7 @@ TEST_F(DataReductionProxyCompressionStatsTest, RecordDataUsageSingleSite) {
DataUsageLoadVerifier verifier(std::move(expected_data_usage)); DataUsageLoadVerifier verifier(std::move(expected_data_usage));
GetHistoricalDataUsage(base::Bind(&DataUsageLoadVerifier::OnLoadDataUsage, GetHistoricalDataUsage(base::BindOnce(&DataUsageLoadVerifier::OnLoadDataUsage,
base::Unretained(&verifier)), base::Unretained(&verifier)),
now); now);
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
...@@ -722,14 +722,14 @@ TEST_F(DataReductionProxyCompressionStatsTest, DisableDataUsageRecording) { ...@@ -722,14 +722,14 @@ TEST_F(DataReductionProxyCompressionStatsTest, DisableDataUsageRecording) {
std::make_unique<std::vector<data_reduction_proxy::DataUsageBucket>>( std::make_unique<std::vector<data_reduction_proxy::DataUsageBucket>>(
kNumExpectedBuckets); kNumExpectedBuckets);
DataUsageLoadVerifier verifier1(std::move(expected_data_usage1)); DataUsageLoadVerifier verifier1(std::move(expected_data_usage1));
LoadHistoricalDataUsage(base::Bind(&DataUsageLoadVerifier::OnLoadDataUsage, LoadHistoricalDataUsage(base::BindOnce(
base::Unretained(&verifier1))); &DataUsageLoadVerifier::OnLoadDataUsage, base::Unretained(&verifier1)));
// Public API must return an empty array. // Public API must return an empty array.
auto expected_data_usage2 = auto expected_data_usage2 =
std::make_unique<std::vector<data_reduction_proxy::DataUsageBucket>>(); std::make_unique<std::vector<data_reduction_proxy::DataUsageBucket>>();
DataUsageLoadVerifier verifier2(std::move(expected_data_usage2)); DataUsageLoadVerifier verifier2(std::move(expected_data_usage2));
GetHistoricalDataUsage(base::Bind(&DataUsageLoadVerifier::OnLoadDataUsage, GetHistoricalDataUsage(base::BindOnce(&DataUsageLoadVerifier::OnLoadDataUsage,
base::Unretained(&verifier2)), base::Unretained(&verifier2)),
now); now);
#else #else
...@@ -747,7 +747,7 @@ TEST_F(DataReductionProxyCompressionStatsTest, DisableDataUsageRecording) { ...@@ -747,7 +747,7 @@ TEST_F(DataReductionProxyCompressionStatsTest, DisableDataUsageRecording) {
DataUsageLoadVerifier verifier(std::move(expected_data_usage)); DataUsageLoadVerifier verifier(std::move(expected_data_usage));
GetHistoricalDataUsage(base::Bind(&DataUsageLoadVerifier::OnLoadDataUsage, GetHistoricalDataUsage(base::BindOnce(&DataUsageLoadVerifier::OnLoadDataUsage,
base::Unretained(&verifier)), base::Unretained(&verifier)),
now); now);
#endif #endif
...@@ -787,7 +787,7 @@ TEST_F(DataReductionProxyCompressionStatsTest, RecordDataUsageMultipleSites) { ...@@ -787,7 +787,7 @@ TEST_F(DataReductionProxyCompressionStatsTest, RecordDataUsageMultipleSites) {
DataUsageLoadVerifier verifier(std::move(expected_data_usage)); DataUsageLoadVerifier verifier(std::move(expected_data_usage));
GetHistoricalDataUsage(base::Bind(&DataUsageLoadVerifier::OnLoadDataUsage, GetHistoricalDataUsage(base::BindOnce(&DataUsageLoadVerifier::OnLoadDataUsage,
base::Unretained(&verifier)), base::Unretained(&verifier)),
now); now);
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
...@@ -825,7 +825,7 @@ TEST_F(DataReductionProxyCompressionStatsTest, ...@@ -825,7 +825,7 @@ TEST_F(DataReductionProxyCompressionStatsTest,
DataUsageLoadVerifier verifier(std::move(expected_data_usage)); DataUsageLoadVerifier verifier(std::move(expected_data_usage));
GetHistoricalDataUsage(base::Bind(&DataUsageLoadVerifier::OnLoadDataUsage, GetHistoricalDataUsage(base::BindOnce(&DataUsageLoadVerifier::OnLoadDataUsage,
base::Unretained(&verifier)), base::Unretained(&verifier)),
now); now);
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
...@@ -856,7 +856,7 @@ TEST_F(DataReductionProxyCompressionStatsTest, ...@@ -856,7 +856,7 @@ TEST_F(DataReductionProxyCompressionStatsTest,
DataUsageLoadVerifier verifier(std::move(expected_data_usage)); DataUsageLoadVerifier verifier(std::move(expected_data_usage));
GetHistoricalDataUsage(base::Bind(&DataUsageLoadVerifier::OnLoadDataUsage, GetHistoricalDataUsage(base::BindOnce(&DataUsageLoadVerifier::OnLoadDataUsage,
base::Unretained(&verifier)), base::Unretained(&verifier)),
now); now);
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
...@@ -881,7 +881,7 @@ TEST_F(DataReductionProxyCompressionStatsTest, DeleteHistoricalDataUsage) { ...@@ -881,7 +881,7 @@ TEST_F(DataReductionProxyCompressionStatsTest, DeleteHistoricalDataUsage) {
kNumExpectedBuckets); kNumExpectedBuckets);
DataUsageLoadVerifier verifier(std::move(expected_data_usage)); DataUsageLoadVerifier verifier(std::move(expected_data_usage));
GetHistoricalDataUsage(base::Bind(&DataUsageLoadVerifier::OnLoadDataUsage, GetHistoricalDataUsage(base::BindOnce(&DataUsageLoadVerifier::OnLoadDataUsage,
base::Unretained(&verifier)), base::Unretained(&verifier)),
now); now);
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
...@@ -918,8 +918,8 @@ TEST_F(DataReductionProxyCompressionStatsTest, DeleteBrowsingHistory) { ...@@ -918,8 +918,8 @@ TEST_F(DataReductionProxyCompressionStatsTest, DeleteBrowsingHistory) {
site_usage->set_original_size(1100); site_usage->set_original_size(1100);
DataUsageLoadVerifier verifier1(std::move(expected_data_usage)); DataUsageLoadVerifier verifier1(std::move(expected_data_usage));
LoadHistoricalDataUsage(base::Bind(&DataUsageLoadVerifier::OnLoadDataUsage, LoadHistoricalDataUsage(base::BindOnce(
base::Unretained(&verifier1))); &DataUsageLoadVerifier::OnLoadDataUsage, base::Unretained(&verifier1)));
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
// This should delete in-storage usage as well. // This should delete in-storage usage as well.
...@@ -930,8 +930,8 @@ TEST_F(DataReductionProxyCompressionStatsTest, DeleteBrowsingHistory) { ...@@ -930,8 +930,8 @@ TEST_F(DataReductionProxyCompressionStatsTest, DeleteBrowsingHistory) {
std::make_unique<std::vector<data_reduction_proxy::DataUsageBucket>>( std::make_unique<std::vector<data_reduction_proxy::DataUsageBucket>>(
kNumExpectedBuckets); kNumExpectedBuckets);
DataUsageLoadVerifier verifier2(std::move(expected_data_usage)); DataUsageLoadVerifier verifier2(std::move(expected_data_usage));
LoadHistoricalDataUsage(base::Bind(&DataUsageLoadVerifier::OnLoadDataUsage, LoadHistoricalDataUsage(base::BindOnce(
base::Unretained(&verifier2))); &DataUsageLoadVerifier::OnLoadDataUsage, base::Unretained(&verifier2)));
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
} }
...@@ -965,7 +965,7 @@ TEST_F(DataReductionProxyCompressionStatsTest, ClearDataSavingStatistics) { ...@@ -965,7 +965,7 @@ TEST_F(DataReductionProxyCompressionStatsTest, ClearDataSavingStatistics) {
kNumExpectedBuckets); kNumExpectedBuckets);
DataUsageLoadVerifier verifier(std::move(expected_data_usage)); DataUsageLoadVerifier verifier(std::move(expected_data_usage));
GetHistoricalDataUsage(base::Bind(&DataUsageLoadVerifier::OnLoadDataUsage, GetHistoricalDataUsage(base::BindOnce(&DataUsageLoadVerifier::OnLoadDataUsage,
base::Unretained(&verifier)), base::Unretained(&verifier)),
now); now);
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
......
...@@ -347,8 +347,8 @@ void DataReductionProxyConfig::SetProxyConfig(bool enabled, bool at_startup) { ...@@ -347,8 +347,8 @@ void DataReductionProxyConfig::SetProxyConfig(bool enabled, bool at_startup) {
// It is safe to use base::Unretained here, since it gets executed // It is safe to use base::Unretained here, since it gets executed
// synchronously on the IO thread, and |this| outlives // synchronously on the IO thread, and |this| outlives
// |secure_proxy_checker_|. // |secure_proxy_checker_|.
SecureProxyCheck( SecureProxyCheck(base::BindRepeating(
base::Bind(&DataReductionProxyConfig::HandleSecureProxyCheckResponse, &DataReductionProxyConfig::HandleSecureProxyCheckResponse,
base::Unretained(this))); base::Unretained(this)));
} }
network_properties_manager_->ResetWarmupURLFetchMetrics(); network_properties_manager_->ResetWarmupURLFetchMetrics();
...@@ -601,8 +601,8 @@ void DataReductionProxyConfig::ContinueNetworkChanged( ...@@ -601,8 +601,8 @@ void DataReductionProxyConfig::ContinueNetworkChanged(
// It is safe to use base::Unretained here, since it gets executed // It is safe to use base::Unretained here, since it gets executed
// synchronously on the IO thread, and |this| outlives // synchronously on the IO thread, and |this| outlives
// |secure_proxy_checker_|. // |secure_proxy_checker_|.
SecureProxyCheck( SecureProxyCheck(base::BindRepeating(
base::Bind(&DataReductionProxyConfig::HandleSecureProxyCheckResponse, &DataReductionProxyConfig::HandleSecureProxyCheckResponse,
base::Unretained(this))); base::Unretained(this)));
} }
} }
......
...@@ -44,7 +44,7 @@ class DataReductionProxyService; ...@@ -44,7 +44,7 @@ class DataReductionProxyService;
class DataReductionProxyMutableConfigValues; class DataReductionProxyMutableConfigValues;
class DataReductionProxyRequestOptions; class DataReductionProxyRequestOptions;
typedef base::Callback<void(const std::string&)> ConfigStorer; using ConfigStorer = base::RepeatingCallback<void(const std::string&)>;
// Retrieves the default net::BackoffEntry::Policy for the Data Reduction Proxy // Retrieves the default net::BackoffEntry::Policy for the Data Reduction Proxy
// configuration service client. // configuration service client.
......
...@@ -321,7 +321,7 @@ void DataReductionProxyService::AddCustomProxyConfigClient( ...@@ -321,7 +321,7 @@ void DataReductionProxyService::AddCustomProxyConfigClient(
} }
void DataReductionProxyService::LoadHistoricalDataUsage( void DataReductionProxyService::LoadHistoricalDataUsage(
const HistoricalDataUsageCallback& load_data_usage_callback) { HistoricalDataUsageCallback load_data_usage_callback) {
std::unique_ptr<std::vector<DataUsageBucket>> data_usage( std::unique_ptr<std::vector<DataUsageBucket>> data_usage(
new std::vector<DataUsageBucket>()); new std::vector<DataUsageBucket>());
std::vector<DataUsageBucket>* data_usage_ptr = data_usage.get(); std::vector<DataUsageBucket>* data_usage_ptr = data_usage.get();
...@@ -330,11 +330,12 @@ void DataReductionProxyService::LoadHistoricalDataUsage( ...@@ -330,11 +330,12 @@ void DataReductionProxyService::LoadHistoricalDataUsage(
base::BindOnce(&DBDataOwner::LoadHistoricalDataUsage, base::BindOnce(&DBDataOwner::LoadHistoricalDataUsage,
db_data_owner_->GetWeakPtr(), db_data_owner_->GetWeakPtr(),
base::Unretained(data_usage_ptr)), base::Unretained(data_usage_ptr)),
base::BindOnce(load_data_usage_callback, std::move(data_usage))); base::BindOnce(std::move(load_data_usage_callback),
std::move(data_usage)));
} }
void DataReductionProxyService::LoadCurrentDataUsageBucket( void DataReductionProxyService::LoadCurrentDataUsageBucket(
const LoadCurrentDataUsageCallback& load_current_data_usage_callback) { LoadCurrentDataUsageCallback load_current_data_usage_callback) {
std::unique_ptr<DataUsageBucket> bucket(new DataUsageBucket()); std::unique_ptr<DataUsageBucket> bucket(new DataUsageBucket());
DataUsageBucket* bucket_ptr = bucket.get(); DataUsageBucket* bucket_ptr = bucket.get();
db_task_runner_->PostTaskAndReply( db_task_runner_->PostTaskAndReply(
...@@ -342,7 +343,8 @@ void DataReductionProxyService::LoadCurrentDataUsageBucket( ...@@ -342,7 +343,8 @@ void DataReductionProxyService::LoadCurrentDataUsageBucket(
base::BindOnce(&DBDataOwner::LoadCurrentDataUsageBucket, base::BindOnce(&DBDataOwner::LoadCurrentDataUsageBucket,
db_data_owner_->GetWeakPtr(), db_data_owner_->GetWeakPtr(),
base::Unretained(bucket_ptr)), base::Unretained(bucket_ptr)),
base::BindOnce(load_current_data_usage_callback, std::move(bucket))); base::BindOnce(std::move(load_current_data_usage_callback),
std::move(bucket)));
} }
void DataReductionProxyService::StoreCurrentDataUsageBucket( void DataReductionProxyService::StoreCurrentDataUsageBucket(
......
...@@ -119,9 +119,9 @@ class DataReductionProxyService ...@@ -119,9 +119,9 @@ class DataReductionProxyService
virtual void SetProxyPrefs(bool enabled, bool at_startup); virtual void SetProxyPrefs(bool enabled, bool at_startup);
void LoadHistoricalDataUsage( void LoadHistoricalDataUsage(
const HistoricalDataUsageCallback& load_data_usage_callback); HistoricalDataUsageCallback load_data_usage_callback);
void LoadCurrentDataUsageBucket( void LoadCurrentDataUsageBucket(
const LoadCurrentDataUsageCallback& load_current_data_usage_callback); LoadCurrentDataUsageCallback load_current_data_usage_callback);
void StoreCurrentDataUsageBucket(std::unique_ptr<DataUsageBucket> current); void StoreCurrentDataUsageBucket(std::unique_ptr<DataUsageBucket> current);
void DeleteHistoricalDataUsage(); void DeleteHistoricalDataUsage();
void DeleteBrowsingHistory(const base::Time& start, const base::Time& end); void DeleteBrowsingHistory(const base::Time& start, const base::Time& end);
......
...@@ -80,7 +80,7 @@ class DataReductionProxySettingsObserver { ...@@ -80,7 +80,7 @@ class DataReductionProxySettingsObserver {
class DataReductionProxySettings { class DataReductionProxySettings {
public: public:
using SyntheticFieldTrialRegistrationCallback = using SyntheticFieldTrialRegistrationCallback =
base::Callback<bool(base::StringPiece, base::StringPiece)>; base::RepeatingCallback<bool(base::StringPiece, base::StringPiece)>;
explicit DataReductionProxySettings(bool is_off_the_record_profile); explicit DataReductionProxySettings(bool is_off_the_record_profile);
virtual ~DataReductionProxySettings(); virtual ~DataReductionProxySettings();
......
...@@ -126,7 +126,7 @@ void DataReductionProxySettingsTestBase::InitDataReductionProxy( ...@@ -126,7 +126,7 @@ void DataReductionProxySettingsTestBase::InitDataReductionProxy(
settings_->InitDataReductionProxySettings( settings_->InitDataReductionProxySettings(
test_context_->pref_service(), test_context_->pref_service(),
std::move(settings_->data_reduction_proxy_service_)); std::move(settings_->data_reduction_proxy_service_));
settings_->SetCallbackToRegisterSyntheticFieldTrial(base::Bind( settings_->SetCallbackToRegisterSyntheticFieldTrial(base::BindRepeating(
&DataReductionProxySettingsTestBase::OnSyntheticFieldTrialRegistration, &DataReductionProxySettingsTestBase::OnSyntheticFieldTrialRegistration,
base::Unretained(this))); base::Unretained(this)));
......
...@@ -468,7 +468,7 @@ DataReductionProxyTestContext::Builder::Build() { ...@@ -468,7 +468,7 @@ DataReductionProxyTestContext::Builder::Build() {
config_client.reset(new DataReductionProxyConfigServiceClient( config_client.reset(new DataReductionProxyConfigServiceClient(
GetBackoffPolicy(), request_options.get(), raw_mutable_config, GetBackoffPolicy(), request_options.get(), raw_mutable_config,
config.get(), service.get(), test_network_connection_tracker, config.get(), service.get(), test_network_connection_tracker,
base::Bind(&TestConfigStorer::StoreSerializedConfig, base::BindRepeating(&TestConfigStorer::StoreSerializedConfig,
base::Unretained(config_storer.get())))); base::Unretained(config_storer.get()))));
} }
......
...@@ -19,12 +19,12 @@ class DataUsageBucket; ...@@ -19,12 +19,12 @@ class DataUsageBucket;
class DataUsageStore; class DataUsageStore;
// Callback for loading the historical data usage. // Callback for loading the historical data usage.
typedef base::Callback<void(std::unique_ptr<std::vector<DataUsageBucket>>)> using HistoricalDataUsageCallback =
HistoricalDataUsageCallback; base::OnceCallback<void(std::unique_ptr<std::vector<DataUsageBucket>>)>;
// Callback for loading data usage for the current bucket. // Callback for loading data usage for the current bucket.
typedef base::Callback<void(std::unique_ptr<DataUsageBucket>)> using LoadCurrentDataUsageCallback =
LoadCurrentDataUsageCallback; base::OnceCallback<void(std::unique_ptr<DataUsageBucket>)>;
// Contains and initializes all Data Reduction Proxy objects that have a // Contains and initializes all Data Reduction Proxy objects that have a
// lifetime based on the DB task runner. // lifetime based on the DB task runner.
......
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