diff options
author | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-04 23:09:01 +0000 |
---|---|---|
committer | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-04 23:09:01 +0000 |
commit | e1fd94e100fa5e8bf34b8abab59c5bb5668026fa (patch) | |
tree | bf28289f9ffc2c5438ec2a7b9818f8a0b5ff8fd4 /net | |
parent | 4174aac2cfd20bcb9169439a15a0495302b6a862 (diff) | |
download | chromium_src-e1fd94e100fa5e8bf34b8abab59c5bb5668026fa.zip chromium_src-e1fd94e100fa5e8bf34b8abab59c5bb5668026fa.tar.gz chromium_src-e1fd94e100fa5e8bf34b8abab59c5bb5668026fa.tar.bz2 |
Make the comment at the top of the file match the code.
Remove the unused RRResolverJob::Cancel method.
Remove job from inflight_ if worker cannot be started.
R=agl
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/5574008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70460 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/dnsrr_resolver.cc | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/net/base/dnsrr_resolver.cc b/net/base/dnsrr_resolver.cc index 393c213..14b7b93 100644 --- a/net/base/dnsrr_resolver.cc +++ b/net/base/dnsrr_resolver.cc @@ -26,10 +26,10 @@ // | (origin loop) (worker loop) // | // Resolve() -// |---->----<creates> -// | // |---->-------------------<creates> // | +// |---->----<creates> +// | // |---->---------------------------------------------------<creates> // | // |---->--------------------Start @@ -58,11 +58,9 @@ // // A cache hit: // -// DnsRRResolver CacheHitCallbackTask Handle +// DnsRRResolver Handle // | // Resolve() -// |---->----<creates> -// | // |---->------------------------<creates> // | // | @@ -70,9 +68,7 @@ // // (MessageLoop cycles) // -// Run -// | -// |----->-----------Post +// Post @@ -559,7 +555,11 @@ class RRResolverJob { } ~RRResolverJob() { - Cancel(ERR_ABORTED); + if (worker_) { + worker_->Cancel(); + worker_ = NULL; + PostAll(ERR_ABORTED, NULL); + } } void AddHandle(RRResolverHandle* handle) { @@ -571,14 +571,6 @@ class RRResolverJob { PostAll(result, &response); } - void Cancel(int error) { - if (worker_) { - worker_->Cancel(); - worker_ = NULL; - PostAll(error, NULL); - } - } - private: void PostAll(int result, const RRResponse* response) { std::vector<RRResolverHandle*> handles; @@ -669,6 +661,7 @@ intptr_t DnsRRResolver::Resolve(const std::string& name, uint16 rrtype, job = new RRResolverJob(worker); inflight_.insert(make_pair(key, job)); if (!worker->Start()) { + inflight_.erase(key); delete job; delete worker; return kInvalidHandle; |