diff options
-rw-r--r-- | net/base/host_resolver_impl.cc | 13 | ||||
-rw-r--r-- | net/base/load_log.h | 5 |
2 files changed, 8 insertions, 10 deletions
diff --git a/net/base/host_resolver_impl.cc b/net/base/host_resolver_impl.cc index 47b2aa3..557d42a 100644 --- a/net/base/host_resolver_impl.cc +++ b/net/base/host_resolver_impl.cc @@ -75,9 +75,6 @@ class HostResolverImpl::Request { job_ = NULL; callback_ = NULL; addresses_ = NULL; - // Clear the LoadLog to make sure it won't be released later on the - // worker thread. See http://crbug.com/22272 - load_log_ = NULL; } bool was_cancelled() const { @@ -193,7 +190,7 @@ class HostResolverImpl::Job } // We will call HostResolverImpl::CancelRequest(Request*) on each one - // in order to notify any observers, and also clear the LoadLog. + // in order to notify any observers. for (RequestsList::const_iterator it = requests_.begin(); it != requests_.end(); ++it) { HostResolverImpl::Request* req = *it; @@ -410,11 +407,9 @@ void HostResolverImpl::CancelRequest(RequestHandle req_handle) { Request* req = reinterpret_cast<Request*>(req_handle); DCHECK(req); DCHECK(req->job()); - // Hold a reference to the request's load log as we are about to clear it. - scoped_refptr<LoadLog> load_log(req->load_log()); // NULL out the fields of req, to mark it as cancelled. req->MarkAsCancelled(); - OnCancelRequest(load_log, req->id(), req->info()); + OnCancelRequest(req->load_log(), req->id(), req->info()); } void HostResolverImpl::AddObserver(Observer* observer) { @@ -465,8 +460,8 @@ void HostResolverImpl::RemoveOutstandingJob(Job* job) { } void HostResolverImpl::OnJobComplete(Job* job, - int error, - const AddressList& addrlist) { + int error, + const AddressList& addrlist) { RemoveOutstandingJob(job); // Write result to the cache. diff --git a/net/base/load_log.h b/net/base/load_log.h index 52c16da..46f5530 100644 --- a/net/base/load_log.h +++ b/net/base/load_log.h @@ -14,7 +14,10 @@ namespace net { // LoadLog stores profiling information on where time was spent while servicing // a request (waiting in queues, resolving hosts, resolving proxy, etc...). -class LoadLog : public base::RefCounted<LoadLog> { +// +// Note that LoadLog is NOT THREADSAFE, however it is RefCountedThreadSafe so +// that it can be AddRef() / Release() across threads. +class LoadLog : public base::RefCountedThreadSafe<LoadLog> { public: enum EventType { |