Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Side by Side Diff: net/proxy/polling_proxy_config_service.cc

Issue 7583053: Add MessageLoopProxy::current (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No need for MessageLoopProxy destruction observer. Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/proxy/network_delegate_error_observer_unittest.cc ('k') | net/proxy/proxy_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/proxy/network_delegate_error_observer_unittest.cc ('k') | net/proxy/proxy_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698