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

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

Issue 165430: Reference count ProxyService.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Sync Created 11 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/proxy_service.h ('k') | net/proxy/proxy_service_unittest.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/proxy_service.h" 5 #include "net/proxy/proxy_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 // Remove this completed PacRequest from the service's pending list. 179 // Remove this completed PacRequest from the service's pending list.
180 /// (which will probably cause deletion of |this|). 180 /// (which will probably cause deletion of |this|).
181 CompletionCallback* callback = user_callback_; 181 CompletionCallback* callback = user_callback_;
182 service_->RemovePendingRequest(this); 182 service_->RemovePendingRequest(this);
183 183
184 callback->Run(result_code); 184 callback->Run(result_code);
185 } 185 }
186 186
187 ProxyResolver* resolver() const { return service_->resolver_.get(); } 187 ProxyResolver* resolver() const { return service_->resolver_.get(); }
188 188
189 // Note that we don't hold a reference to the ProxyService. Outstanding
190 // requests are cancelled during ~ProxyService, so this is guaranteed
191 // to be valid throughout our lifetime.
189 ProxyService* service_; 192 ProxyService* service_;
190 CompletionCallback* user_callback_; 193 CompletionCallback* user_callback_;
191 CompletionCallbackImpl<PacRequest> io_callback_; 194 CompletionCallbackImpl<PacRequest> io_callback_;
192 ProxyInfo* results_; 195 ProxyInfo* results_;
193 GURL url_; 196 GURL url_;
194 ProxyResolver::RequestHandle resolve_job_; 197 ProxyResolver::RequestHandle resolve_job_;
195 ProxyConfig::ID config_id_; // The config id when the resolve was started. 198 ProxyConfig::ID config_id_; // The config id when the resolve was started.
196 scoped_refptr<LoadLog> load_log_; 199 scoped_refptr<LoadLog> load_log_;
197 }; 200 };
198 201
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 OnCompletion(result_); 789 OnCompletion(result_);
787 } 790 }
788 } 791 }
789 792
790 void SyncProxyServiceHelper::OnCompletion(int rv) { 793 void SyncProxyServiceHelper::OnCompletion(int rv) {
791 result_ = rv; 794 result_ = rv;
792 event_.Signal(); 795 event_.Signal();
793 } 796 }
794 797
795 } // namespace net 798 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_service.h ('k') | net/proxy/proxy_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698