| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.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/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 if (poll_task_queued_) | 129 if (poll_task_queued_) |
| 130 CheckForChangesNow(); | 130 CheckForChangesNow(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void LazyInitializeOriginLoop() { | 133 void LazyInitializeOriginLoop() { |
| 134 // TODO(eroman): Really this should be done in the constructor, but right | 134 // TODO(eroman): Really this should be done in the constructor, but right |
| 135 // now chrome is constructing the ProxyConfigService on the | 135 // now chrome is constructing the ProxyConfigService on the |
| 136 // UI thread so we can't cache the IO thread for the purpose | 136 // UI thread so we can't cache the IO thread for the purpose |
| 137 // of DCHECKs until the first call is made. | 137 // of DCHECKs until the first call is made. |
| 138 if (!have_initialized_origin_loop_) { | 138 if (!have_initialized_origin_loop_) { |
| 139 origin_loop_proxy_ = base::MessageLoopProxy::CreateForCurrentThread(); | 139 origin_loop_proxy_ = base::MessageLoopProxy::current(); |
| 140 have_initialized_origin_loop_ = true; | 140 have_initialized_origin_loop_ = true; |
| 141 } | 141 } |
| 142 } | 142 } |
| 143 | 143 |
| 144 GetConfigFunction get_config_func_; | 144 GetConfigFunction get_config_func_; |
| 145 ObserverList<Observer> observers_; | 145 ObserverList<Observer> observers_; |
| 146 ProxyConfig last_config_; | 146 ProxyConfig last_config_; |
| 147 base::TimeTicks last_poll_time_; | 147 base::TimeTicks last_poll_time_; |
| 148 base::TimeDelta poll_interval_; | 148 base::TimeDelta poll_interval_; |
| 149 | 149 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 181 |
| 182 PollingProxyConfigService::~PollingProxyConfigService() { | 182 PollingProxyConfigService::~PollingProxyConfigService() { |
| 183 core_->Orphan(); | 183 core_->Orphan(); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void PollingProxyConfigService::CheckForChangesNow() { | 186 void PollingProxyConfigService::CheckForChangesNow() { |
| 187 core_->CheckForChangesNow(); | 187 core_->CheckForChangesNow(); |
| 188 } | 188 } |
| 189 | 189 |
| 190 } // namespace net | 190 } // namespace net |
| OLD | NEW |