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

Side by Side Diff: net/proxy/dhcp_proxy_script_adapter_fetcher_win.h

Issue 7189016: Do GetAdaptersAddresses on a worker thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix handling of cancellation. Add regression test. Created 9 years, 6 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 | « no previous file | net/proxy/dhcp_proxy_script_fetcher_win.h » ('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 #ifndef NET_PROXY_DHCP_SCRIPT_ADAPTER_FETCHER_WIN_H_ 5 #ifndef NET_PROXY_DHCP_SCRIPT_ADAPTER_FETCHER_WIN_H_
6 #define NET_PROXY_DHCP_SCRIPT_ADAPTER_FETCHER_WIN_H_ 6 #define NET_PROXY_DHCP_SCRIPT_ADAPTER_FETCHER_WIN_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 STATE_FINISH, 104 STATE_FINISH,
105 STATE_CANCEL, 105 STATE_CANCEL,
106 }; 106 };
107 107
108 State state() const; 108 State state() const;
109 109
110 // This inner class is used to encapsulate the worker thread, which has 110 // This inner class is used to encapsulate the worker thread, which has
111 // only a weak reference back to the main object, so that the main object 111 // only a weak reference back to the main object, so that the main object
112 // can be destroyed before the thread ends. This also keeps the main 112 // can be destroyed before the thread ends. This also keeps the main
113 // object completely thread safe and allows it to be non-refcounted. 113 // object completely thread safe and allows it to be non-refcounted.
114 //
115 // TODO(joi): Replace with PostTaskAndReply once http://crbug.com/86301
116 // has been implemented.
114 class NET_TEST WorkerThread 117 class NET_TEST WorkerThread
115 : public base::RefCountedThreadSafe<WorkerThread> { 118 : public base::RefCountedThreadSafe<WorkerThread> {
116 public: 119 public:
117 // Creates and initializes (but does not start) the worker thread. 120 // Creates and initializes (but does not start) the worker thread.
118 explicit WorkerThread( 121 explicit WorkerThread(
119 const base::WeakPtr<DhcpProxyScriptAdapterFetcher>& owner); 122 const base::WeakPtr<DhcpProxyScriptAdapterFetcher>& owner);
120 virtual ~WorkerThread(); 123 virtual ~WorkerThread();
121 124
122 // Starts the worker thread, fetching information for |adapter_name| using 125 // Starts the worker thread, fetching information for |adapter_name| using
123 // |get_pac_from_url_func|. 126 // |get_pac_from_url_func|.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 base::OneShotTimer<DhcpProxyScriptAdapterFetcher> wait_timer_; 197 base::OneShotTimer<DhcpProxyScriptAdapterFetcher> wait_timer_;
195 198
196 scoped_refptr<URLRequestContext> url_request_context_; 199 scoped_refptr<URLRequestContext> url_request_context_;
197 200
198 DISALLOW_IMPLICIT_CONSTRUCTORS(DhcpProxyScriptAdapterFetcher); 201 DISALLOW_IMPLICIT_CONSTRUCTORS(DhcpProxyScriptAdapterFetcher);
199 }; 202 };
200 203
201 } // namespace net 204 } // namespace net
202 205
203 #endif // NET_PROXY_DHCP_SCRIPT_ADAPTER_FETCHER_WIN_H_ 206 #endif // NET_PROXY_DHCP_SCRIPT_ADAPTER_FETCHER_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | net/proxy/dhcp_proxy_script_fetcher_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698