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

Side by Side Diff: extensions/browser/api/socket/socket_api.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 | « extensions/browser/api/dns/dns_api.cc ('k') | net/base/net_util_win.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/api/socket/socket_api.h" 5 #include "extensions/browser/api/socket/socket_api.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
11 #include "base/profiler/scoped_tracker.h"
12 #include "content/public/browser/browser_context.h" 11 #include "content/public/browser/browser_context.h"
13 #include "content/public/browser/resource_context.h" 12 #include "content/public/browser/resource_context.h"
14 #include "extensions/browser/api/dns/host_resolver_wrapper.h" 13 #include "extensions/browser/api/dns/host_resolver_wrapper.h"
15 #include "extensions/browser/api/socket/socket.h" 14 #include "extensions/browser/api/socket/socket.h"
16 #include "extensions/browser/api/socket/tcp_socket.h" 15 #include "extensions/browser/api/socket/tcp_socket.h"
17 #include "extensions/browser/api/socket/tls_socket.h" 16 #include "extensions/browser/api/socket/tls_socket.h"
18 #include "extensions/browser/api/socket/udp_socket.h" 17 #include "extensions/browser/api/socket/udp_socket.h"
19 #include "extensions/browser/extension_system.h" 18 #include "extensions/browser/extension_system.h"
20 #include "extensions/common/extension.h" 19 #include "extensions/common/extension.h"
21 #include "extensions/common/permissions/permissions_data.h" 20 #include "extensions/common/permissions/permissions_data.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 addresses_.get(), 205 addresses_.get(),
207 base::Bind(&SocketExtensionWithDnsLookupFunction::OnDnsLookup, this), 206 base::Bind(&SocketExtensionWithDnsLookupFunction::OnDnsLookup, this),
208 request_handle_.get(), 207 request_handle_.get(),
209 net::BoundNetLog()); 208 net::BoundNetLog());
210 209
211 if (resolve_result != net::ERR_IO_PENDING) 210 if (resolve_result != net::ERR_IO_PENDING)
212 OnDnsLookup(resolve_result); 211 OnDnsLookup(resolve_result);
213 } 212 }
214 213
215 void SocketExtensionWithDnsLookupFunction::OnDnsLookup(int resolve_result) { 214 void SocketExtensionWithDnsLookupFunction::OnDnsLookup(int resolve_result) {
216 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436634 is fixed.
217 tracked_objects::ScopedTracker tracking_profile(
218 FROM_HERE_WITH_EXPLICIT_FUNCTION(
219 "436634 SocketExtensionWithDnsLookupFunction::OnDnsLookup"));
220
221 if (resolve_result == net::OK) { 215 if (resolve_result == net::OK) {
222 DCHECK(!addresses_->empty()); 216 DCHECK(!addresses_->empty());
223 resolved_address_ = addresses_->front().ToStringWithoutPort(); 217 resolved_address_ = addresses_->front().ToStringWithoutPort();
224 } else { 218 } else {
225 error_ = kDnsLookupFailedError; 219 error_ = kDnsLookupFailedError;
226 } 220 }
227 AfterDnsLookup(resolve_result); 221 AfterDnsLookup(resolve_result);
228 } 222 }
229 223
230 SocketCreateFunction::SocketCreateFunction() 224 SocketCreateFunction::SocketCreateFunction()
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 } else { 1080 } else {
1087 RemoveSocket(params_->socket_id); 1081 RemoveSocket(params_->socket_id);
1088 error_ = net::ErrorToString(result); 1082 error_ = net::ErrorToString(result);
1089 } 1083 }
1090 1084
1091 results_ = core_api::socket::Secure::Results::Create(result); 1085 results_ = core_api::socket::Secure::Results::Create(result);
1092 AsyncWorkCompleted(); 1086 AsyncWorkCompleted();
1093 } 1087 }
1094 1088
1095 } // namespace extensions 1089 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/dns/dns_api.cc ('k') | net/base/net_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698