summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-24 22:12:35 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-24 22:12:35 +0000
commitf353dba90985f6f9314c932c6c0ad016e2701f75 (patch)
tree911553a89b23d67ae1947f89f83312094c7c1cf4 /net
parent483d57876597b92189be4504a1dc90b754c4c2e0 (diff)
downloadchromium_src-f353dba90985f6f9314c932c6c0ad016e2701f75.zip
chromium_src-f353dba90985f6f9314c932c6c0ad016e2701f75.tar.gz
chromium_src-f353dba90985f6f9314c932c6c0ad016e2701f75.tar.bz2
Revert 202038 "Remove all but one use of WeakPtrFactory::DetachF..."
Caused local failures in linux_aura builds. Unsure why this isn't showing up on the bots. > Remove all but one use of WeakPtrFactory::DetachFromThread. > > This CL changes WeakPtr in the following ways: > * Changes thread-bindings semantics so that WeakPtrs only become bound when the first one is dereferenced, or the owning factory invalidates them. > * Removes WeakPtrFactory::DetachFromThread. > * Renames SupportsWeakPtr::DetachFromThread to DetachFromThreadHack. > > Calling code changes to allow this: > * Unnecessary DetachFromThread() calls removed from PluginInfoMessageFilter, DhcpProxyScript[Adapter]FetcherWin and (Chromoting's) PolicyWatcherLinux. > * DetachFromThread() calls rendered unnecessary by change in binding semantics removed from IOThread, SearchProviderInstallData, RuleRegistryWithCache and GLSurfaceGlx. > > WebGraphicsContext3DInProcessCommandBufferImpl uses the re-named DetachFromThreadHack() - bug 234964 tracks work to remove that use. > > Review URL: https://chromiumcodereview.appspot.com/14299011 BUG=232143, 234964, 243914 TBR=wez@chromium.org Review URL: https://codereview.chromium.org/15819004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202193 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc5
-rw-r--r--net/proxy/dhcp_proxy_script_fetcher_win.cc5
2 files changed, 10 insertions, 0 deletions
diff --git a/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc b/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc
index 2b49b94..8a405a7 100644
--- a/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc
+++ b/net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc
@@ -41,6 +41,11 @@ DhcpProxyScriptAdapterFetcher::DhcpProxyScriptAdapterFetcher(
DhcpProxyScriptAdapterFetcher::~DhcpProxyScriptAdapterFetcher() {
Cancel();
+
+ // The WeakPtr we passed to the worker thread may be destroyed on the
+ // worker thread. This detaches any outstanding WeakPtr state from
+ // the current thread.
+ base::SupportsWeakPtr<DhcpProxyScriptAdapterFetcher>::DetachFromThread();
}
void DhcpProxyScriptAdapterFetcher::Fetch(
diff --git a/net/proxy/dhcp_proxy_script_fetcher_win.cc b/net/proxy/dhcp_proxy_script_fetcher_win.cc
index 9e34f51..64f5117 100644
--- a/net/proxy/dhcp_proxy_script_fetcher_win.cc
+++ b/net/proxy/dhcp_proxy_script_fetcher_win.cc
@@ -47,6 +47,11 @@ DhcpProxyScriptFetcherWin::DhcpProxyScriptFetcherWin(
DhcpProxyScriptFetcherWin::~DhcpProxyScriptFetcherWin() {
// Count as user-initiated if we are not yet in STATE_DONE.
Cancel();
+
+ // The WeakPtr we passed to the worker thread may be destroyed on the
+ // worker thread. This detaches any outstanding WeakPtr state from
+ // the current thread.
+ base::SupportsWeakPtr<DhcpProxyScriptFetcherWin>::DetachFromThread();
}
int DhcpProxyScriptFetcherWin::Fetch(base::string16* utf16_text,