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

Side by Side Diff: net/dns/single_request_host_resolver.cc

Issue 1062413002: Remove unnecessary instrumentation for several jank bugs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile fixes Created 5 years, 8 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 | « net/dns/host_resolver_impl.cc ('k') | net/ftp/ftp_network_transaction.cc » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "net/dns/single_request_host_resolver.h" 5 #include "net/dns/single_request_host_resolver.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/profiler/scoped_tracker.h"
12 #include "net/base/net_errors.h" 11 #include "net/base/net_errors.h"
13 12
14 namespace net { 13 namespace net {
15 14
16 SingleRequestHostResolver::SingleRequestHostResolver(HostResolver* resolver) 15 SingleRequestHostResolver::SingleRequestHostResolver(HostResolver* resolver)
17 : resolver_(resolver), 16 : resolver_(resolver),
18 cur_request_(NULL), 17 cur_request_(NULL),
19 callback_( 18 callback_(
20 base::Bind(&SingleRequestHostResolver::OnResolveCompletion, 19 base::Bind(&SingleRequestHostResolver::OnResolveCompletion,
21 base::Unretained(this))) { 20 base::Unretained(this))) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 56
58 void SingleRequestHostResolver::Cancel() { 57 void SingleRequestHostResolver::Cancel() {
59 if (!cur_request_callback_.is_null()) { 58 if (!cur_request_callback_.is_null()) {
60 resolver_->CancelRequest(cur_request_); 59 resolver_->CancelRequest(cur_request_);
61 cur_request_ = NULL; 60 cur_request_ = NULL;
62 cur_request_callback_.Reset(); 61 cur_request_callback_.Reset();
63 } 62 }
64 } 63 }
65 64
66 void SingleRequestHostResolver::OnResolveCompletion(int result) { 65 void SingleRequestHostResolver::OnResolveCompletion(int result) {
67 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436634 is fixed.
68 tracked_objects::ScopedTracker tracking_profile(
69 FROM_HERE_WITH_EXPLICIT_FUNCTION(
70 "436634 SingleRequestHostResolver::OnResolveCompletion"));
71
72 DCHECK(cur_request_); 66 DCHECK(cur_request_);
73 DCHECK_EQ(false, cur_request_callback_.is_null()); 67 DCHECK_EQ(false, cur_request_callback_.is_null());
74 68
75 CompletionCallback callback = cur_request_callback_; 69 CompletionCallback callback = cur_request_callback_;
76 70
77 // Clear the outstanding request information. 71 // Clear the outstanding request information.
78 cur_request_ = NULL; 72 cur_request_ = NULL;
79 cur_request_callback_.Reset(); 73 cur_request_callback_.Reset();
80 74
81 // Call the user's original callback. 75 // Call the user's original callback.
82 callback.Run(result); 76 callback.Run(result);
83 } 77 }
84 78
85 } // namespace net 79 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/host_resolver_impl.cc ('k') | net/ftp/ftp_network_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698