OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/data_reduction_proxy/browser/data_reduction_proxy_config_se
rvice.h" | 5 #include "components/data_reduction_proxy/browser/data_reduction_proxy_config_se
rvice.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 void DataReductionProxyConfigService::RegisterObserver() { | 111 void DataReductionProxyConfigService::RegisterObserver() { |
112 if (!registered_observer_ && base_service_.get()) { | 112 if (!registered_observer_ && base_service_.get()) { |
113 base_service_->AddObserver(this); | 113 base_service_->AddObserver(this); |
114 registered_observer_ = true; | 114 registered_observer_ = true; |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
118 DataReductionProxyConfigTracker::DataReductionProxyConfigTracker( | 118 DataReductionProxyConfigTracker::DataReductionProxyConfigTracker( |
119 base::Callback<void(bool, const net::ProxyConfig&)> update_proxy_config, | 119 base::Callback<void(bool, const net::ProxyConfig&)> update_proxy_config, |
120 base::TaskRunner* task_runner) | 120 const scoped_refptr<base::TaskRunner>& task_runner) |
121 : update_proxy_config_(update_proxy_config), | 121 : update_proxy_config_(update_proxy_config), |
122 task_runner_(task_runner) { | 122 task_runner_(task_runner) { |
123 } | 123 } |
124 | 124 |
125 DataReductionProxyConfigTracker::~DataReductionProxyConfigTracker() { | 125 DataReductionProxyConfigTracker::~DataReductionProxyConfigTracker() { |
126 } | 126 } |
127 | 127 |
128 void DataReductionProxyConfigTracker::Enable( | 128 void DataReductionProxyConfigTracker::Enable( |
129 bool primary_restricted, | 129 bool primary_restricted, |
130 bool fallback_restricted, | 130 bool fallback_restricted, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 } | 191 } |
192 | 192 |
193 void DataReductionProxyConfigTracker::UpdateProxyConfigOnIOThread( | 193 void DataReductionProxyConfigTracker::UpdateProxyConfigOnIOThread( |
194 bool enabled, | 194 bool enabled, |
195 const net::ProxyConfig& config) { | 195 const net::ProxyConfig& config) { |
196 task_runner_->PostTask( | 196 task_runner_->PostTask( |
197 FROM_HERE, base::Bind(update_proxy_config_, enabled, config)); | 197 FROM_HERE, base::Bind(update_proxy_config_, enabled, config)); |
198 } | 198 } |
199 | 199 |
200 } // namespace data_reduction_proxy | 200 } // namespace data_reduction_proxy |
OLD | NEW |