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

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

Issue 14299011: Remove all but one use of WeakPtrFactory::DetachFromThread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove checks for death with correct error, which seem to fail on iOS Created 7 years, 7 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
OLDNEW
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/dhcp_proxy_script_adapter_fetcher_win.h" 5 #include "net/proxy/dhcp_proxy_script_adapter_fetcher_win.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
(...skipping 23 matching lines...) Expand all
34 DhcpProxyScriptAdapterFetcher::DhcpProxyScriptAdapterFetcher( 34 DhcpProxyScriptAdapterFetcher::DhcpProxyScriptAdapterFetcher(
35 URLRequestContext* url_request_context) 35 URLRequestContext* url_request_context)
36 : state_(STATE_START), 36 : state_(STATE_START),
37 result_(ERR_IO_PENDING), 37 result_(ERR_IO_PENDING),
38 url_request_context_(url_request_context) { 38 url_request_context_(url_request_context) {
39 DCHECK(url_request_context_); 39 DCHECK(url_request_context_);
40 } 40 }
41 41
42 DhcpProxyScriptAdapterFetcher::~DhcpProxyScriptAdapterFetcher() { 42 DhcpProxyScriptAdapterFetcher::~DhcpProxyScriptAdapterFetcher() {
43 Cancel(); 43 Cancel();
44
45 // The WeakPtr we passed to the worker thread may be destroyed on the
46 // worker thread. This detaches any outstanding WeakPtr state from
47 // the current thread.
48 base::SupportsWeakPtr<DhcpProxyScriptAdapterFetcher>::DetachFromThread();
49 } 44 }
50 45
51 void DhcpProxyScriptAdapterFetcher::Fetch( 46 void DhcpProxyScriptAdapterFetcher::Fetch(
52 const std::string& adapter_name, const CompletionCallback& callback) { 47 const std::string& adapter_name, const CompletionCallback& callback) {
53 DCHECK(CalledOnValidThread()); 48 DCHECK(CalledOnValidThread());
54 DCHECK_EQ(state_, STATE_START); 49 DCHECK_EQ(state_, STATE_START);
55 result_ = ERR_IO_PENDING; 50 result_ = ERR_IO_PENDING;
56 pac_script_ = base::string16(); 51 pac_script_ = base::string16();
57 state_ = STATE_WAIT_DHCP; 52 state_ = STATE_WAIT_DHCP;
58 callback_ = callback; 53 callback_ = callback;
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 // back a buffer with embedded NULLs, something is broken anyway. 279 // back a buffer with embedded NULLs, something is broken anyway.
285 return std::string( 280 return std::string(
286 std::string(reinterpret_cast<const char *>(wpad_params.Data), 281 std::string(reinterpret_cast<const char *>(wpad_params.Data),
287 wpad_params.nBytesData).c_str()); 282 wpad_params.nBytesData).c_str());
288 } 283 }
289 284
290 return ""; 285 return "";
291 } 286 }
292 287
293 } // namespace net 288 } // namespace net
OLDNEW
« no previous file with comments | « chrome/browser/search_engines/search_provider_install_data.cc ('k') | net/proxy/dhcp_proxy_script_fetcher_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698