summaryrefslogtreecommitdiffstats
path: root/net/base/host_resolver.cc
diff options
context:
space:
mode:
authorericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-17 02:11:03 +0000
committerericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-17 02:11:03 +0000
commiteb255d3bd77fa891cd909d5779763a3e028759d2 (patch)
treed20650c59eb2150f73f27173e0325a05fa288836 /net/base/host_resolver.cc
parentc8220644056dfdb2d48f5d00578888a00ca02fe7 (diff)
downloadchromium_src-eb255d3bd77fa891cd909d5779763a3e028759d2.zip
chromium_src-eb255d3bd77fa891cd909d5779763a3e028759d2.tar.gz
chromium_src-eb255d3bd77fa891cd909d5779763a3e028759d2.tar.bz2
Re-land another subset of r18520.
This particular subset should be a no-op: It adds an unused interface method (OnResolutionCancelled), and an unused test (CancelObserver), and lastly renames Cancel --> MarkAsCanceled(). The code in "dns_global.cc" is also unused since it is unreachable. The original code review that this belongs to is:<http://codereview.chromium.org/125171>. (BUG=14138) The original was backed out because of a valgrind linux error (BUG=14218), so I am now re-landing in smaller chunks to identify where the problem resides. Review URL: http://codereview.chromium.org/126253 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18581 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/host_resolver.cc')
-rw-r--r--net/base/host_resolver.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/net/base/host_resolver.cc b/net/base/host_resolver.cc
index dd1ffcc..14ad212 100644
--- a/net/base/host_resolver.cc
+++ b/net/base/host_resolver.cc
@@ -184,7 +184,7 @@ class HostResolver::Request {
addresses_(addresses) {}
// Mark the request as cancelled.
- void Cancel() {
+ void MarkAsCancelled() {
job_ = NULL;
callback_ = NULL;
addresses_ = NULL;
@@ -291,8 +291,12 @@ class HostResolver::Job : public base::RefCountedThreadSafe<HostResolver::Job> {
void Cancel() {
resolver_ = NULL;
- AutoLock locked(origin_loop_lock_);
- origin_loop_ = NULL;
+ // Mark the job as cancelled, so when worker thread completes it will
+ // not try to post completion to origin loop.
+ {
+ AutoLock locked(origin_loop_lock_);
+ origin_loop_ = NULL;
+ }
}
// Called from origin thread.
@@ -483,7 +487,7 @@ void HostResolver::CancelRequest(Request* req) {
DCHECK(req);
DCHECK(req->job());
// NULL out the fields of req, to mark it as cancelled.
- req->Cancel();
+ req->MarkAsCancelled();
}
void HostResolver::AddObserver(Observer* observer) {