| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "net/proxy/polling_proxy_config_service.h" | 5 #include "net/proxy/polling_proxy_config_service.h" |
| 6 | 6 |
| 7 #include "base/lock.h" | 7 #include "base/lock.h" |
| 8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
| 9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 147 |
| 148 Lock lock_; | 148 Lock lock_; |
| 149 scoped_refptr<base::MessageLoopProxy> origin_loop_proxy_; | 149 scoped_refptr<base::MessageLoopProxy> origin_loop_proxy_; |
| 150 | 150 |
| 151 bool have_initialized_origin_loop_; | 151 bool have_initialized_origin_loop_; |
| 152 bool has_config_; | 152 bool has_config_; |
| 153 bool poll_task_outstanding_; | 153 bool poll_task_outstanding_; |
| 154 bool poll_task_queued_; | 154 bool poll_task_queued_; |
| 155 }; | 155 }; |
| 156 | 156 |
| 157 PollingProxyConfigService::PollingProxyConfigService( | |
| 158 base::TimeDelta poll_interval, | |
| 159 GetConfigFunction get_config_func) | |
| 160 : core_(new Core(poll_interval, get_config_func)) { | |
| 161 } | |
| 162 | |
| 163 PollingProxyConfigService::~PollingProxyConfigService() { | |
| 164 core_->Orphan(); | |
| 165 } | |
| 166 | |
| 167 void PollingProxyConfigService::AddObserver(Observer* observer) { | 157 void PollingProxyConfigService::AddObserver(Observer* observer) { |
| 168 core_->AddObserver(observer); | 158 core_->AddObserver(observer); |
| 169 } | 159 } |
| 170 | 160 |
| 171 void PollingProxyConfigService::RemoveObserver(Observer* observer) { | 161 void PollingProxyConfigService::RemoveObserver(Observer* observer) { |
| 172 core_->RemoveObserver(observer); | 162 core_->RemoveObserver(observer); |
| 173 } | 163 } |
| 174 | 164 |
| 175 bool PollingProxyConfigService::GetLatestProxyConfig(ProxyConfig* config) { | 165 bool PollingProxyConfigService::GetLatestProxyConfig(ProxyConfig* config) { |
| 176 return core_->GetLatestProxyConfig(config); | 166 return core_->GetLatestProxyConfig(config); |
| 177 } | 167 } |
| 178 | 168 |
| 179 void PollingProxyConfigService::OnLazyPoll() { | 169 void PollingProxyConfigService::OnLazyPoll() { |
| 180 core_->OnLazyPoll(); | 170 core_->OnLazyPoll(); |
| 181 } | 171 } |
| 182 | 172 |
| 173 PollingProxyConfigService::PollingProxyConfigService( |
| 174 base::TimeDelta poll_interval, |
| 175 GetConfigFunction get_config_func) |
| 176 : core_(new Core(poll_interval, get_config_func)) { |
| 177 } |
| 178 |
| 179 PollingProxyConfigService::~PollingProxyConfigService() { |
| 180 core_->Orphan(); |
| 181 } |
| 182 |
| 183 void PollingProxyConfigService::CheckForChangesNow() { | 183 void PollingProxyConfigService::CheckForChangesNow() { |
| 184 core_->CheckForChangesNow(); | 184 core_->CheckForChangesNow(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace net | 187 } // namespace net |
| OLD | NEW |