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

Side by Side Diff: chrome/browser/net/dns_probe_runner.cc

Issue 575993002: Fix WeakPtrFactory member ordering in chrome/browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « chrome/browser/net/dns_probe_runner.h ('k') | chrome/browser/net/net_error_tab_helper.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/net/dns_probe_runner.h" 5 #include "chrome/browser/net/dns_probe_runner.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "net/base/address_list.h" 9 #include "net/base/address_list.h"
10 #include "net/base/ip_endpoint.h" 10 #include "net/base/ip_endpoint.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 if (result != DnsResponse::DNS_PARSE_OK) 72 if (result != DnsResponse::DNS_PARSE_OK)
73 return DnsProbeRunner::FAILING; 73 return DnsProbeRunner::FAILING;
74 else if (addr_list.empty()) 74 else if (addr_list.empty())
75 return DnsProbeRunner::INCORRECT; 75 return DnsProbeRunner::INCORRECT;
76 else 76 else
77 return DnsProbeRunner::CORRECT; 77 return DnsProbeRunner::CORRECT;
78 } 78 }
79 79
80 } // namespace 80 } // namespace
81 81
82 DnsProbeRunner::DnsProbeRunner() : weak_factory_(this), result_(UNKNOWN) {} 82 DnsProbeRunner::DnsProbeRunner() : result_(UNKNOWN), weak_factory_(this) {}
83 83
84 DnsProbeRunner::~DnsProbeRunner() {} 84 DnsProbeRunner::~DnsProbeRunner() {}
85 85
86 void DnsProbeRunner::SetClient(scoped_ptr<net::DnsClient> client) { 86 void DnsProbeRunner::SetClient(scoped_ptr<net::DnsClient> client) {
87 client_ = client.Pass(); 87 client_ = client.Pass();
88 } 88 }
89 89
90 void DnsProbeRunner::RunProbe(const base::Closure& callback) { 90 void DnsProbeRunner::RunProbe(const base::Closure& callback) {
91 DCHECK(!callback.is_null()); 91 DCHECK(!callback.is_null());
92 DCHECK(client_.get()); 92 DCHECK(client_.get());
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 DCHECK(!callback_.is_null()); 143 DCHECK(!callback_.is_null());
144 DCHECK(!transaction_.get()); 144 DCHECK(!transaction_.get());
145 145
146 // Clear callback in case it starts a new probe immediately. 146 // Clear callback in case it starts a new probe immediately.
147 const base::Closure callback = callback_; 147 const base::Closure callback = callback_;
148 callback_.Reset(); 148 callback_.Reset();
149 callback.Run(); 149 callback.Run();
150 } 150 }
151 151
152 } // namespace chrome_browser_net 152 } // namespace chrome_browser_net
OLDNEW
« no previous file with comments | « chrome/browser/net/dns_probe_runner.h ('k') | chrome/browser/net/net_error_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698