| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // request while we are busy, we will defer it until the current poll | 84 // request while we are busy, we will defer it until the current poll |
| 85 // completes. | 85 // completes. |
| 86 poll_task_queued_ = true; | 86 poll_task_queued_ = true; |
| 87 return; | 87 return; |
| 88 } | 88 } |
| 89 | 89 |
| 90 last_poll_time_ = base::TimeTicks::Now(); | 90 last_poll_time_ = base::TimeTicks::Now(); |
| 91 poll_task_outstanding_ = true; | 91 poll_task_outstanding_ = true; |
| 92 poll_task_queued_ = false; | 92 poll_task_queued_ = false; |
| 93 base::PostTaskWithTraits( | 93 base::PostTaskWithTraits( |
| 94 FROM_HERE, base::TaskTraits().MayBlock().WithShutdownBehavior( | 94 FROM_HERE, |
| 95 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN), | 95 {base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, |
| 96 base::Bind(&Core::PollAsync, this, get_config_func_)); | 96 base::Bind(&Core::PollAsync, this, get_config_func_)); |
| 97 } | 97 } |
| 98 | 98 |
| 99 private: | 99 private: |
| 100 friend class base::RefCountedThreadSafe<Core>; | 100 friend class base::RefCountedThreadSafe<Core>; |
| 101 ~Core() {} | 101 ~Core() {} |
| 102 | 102 |
| 103 void PollAsync(GetConfigFunction func) { | 103 void PollAsync(GetConfigFunction func) { |
| 104 ProxyConfig config; | 104 ProxyConfig config; |
| 105 func(&config); | 105 func(&config); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 PollingProxyConfigService::~PollingProxyConfigService() { | 185 PollingProxyConfigService::~PollingProxyConfigService() { |
| 186 core_->Orphan(); | 186 core_->Orphan(); |
| 187 } | 187 } |
| 188 | 188 |
| 189 void PollingProxyConfigService::CheckForChangesNow() { | 189 void PollingProxyConfigService::CheckForChangesNow() { |
| 190 core_->CheckForChangesNow(); | 190 core_->CheckForChangesNow(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 } // namespace net | 193 } // namespace net |
| OLD | NEW |