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

Side by Side Diff: net/proxy/proxy_service.cc

Issue 1073033002: Modify instrumentation for various jank bugs, mostly removing outdated sites. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/proxy/proxy_script_decider.cc ('k') | net/url_request/url_fetcher_core.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/proxy/proxy_service.h" 5 #include "net/proxy/proxy_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 // ProxyResolver instance will be created using |proxy_resolver_factory| and 386 // ProxyResolver instance will be created using |proxy_resolver_factory| and
387 // returned via |proxy_resolver| if the final result is OK. 387 // returned via |proxy_resolver| if the final result is OK.
388 int Start(scoped_ptr<ProxyResolver>* proxy_resolver, 388 int Start(scoped_ptr<ProxyResolver>* proxy_resolver,
389 ProxyResolverFactory* proxy_resolver_factory, 389 ProxyResolverFactory* proxy_resolver_factory,
390 ProxyScriptFetcher* proxy_script_fetcher, 390 ProxyScriptFetcher* proxy_script_fetcher,
391 DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher, 391 DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher,
392 NetLog* net_log, 392 NetLog* net_log,
393 const ProxyConfig& config, 393 const ProxyConfig& config,
394 TimeDelta wait_delay, 394 TimeDelta wait_delay,
395 const CompletionCallback& callback) { 395 const CompletionCallback& callback) {
396 // TODO(pkasting): Remove ScopedTracker below once crbug.com/455942 is
397 // fixed.
398 tracked_objects::ScopedTracker tracking_profile(
399 FROM_HERE_WITH_EXPLICIT_FUNCTION(
400 "455942 ProxyService::InitProxyResolver::Start"));
401 DCHECK_EQ(STATE_NONE, next_state_); 396 DCHECK_EQ(STATE_NONE, next_state_);
402 proxy_resolver_ = proxy_resolver; 397 proxy_resolver_ = proxy_resolver;
403 proxy_resolver_factory_ = proxy_resolver_factory; 398 proxy_resolver_factory_ = proxy_resolver_factory;
404 399
405 decider_.reset(new ProxyScriptDecider( 400 decider_.reset(new ProxyScriptDecider(
406 proxy_script_fetcher, dhcp_proxy_script_fetcher, net_log)); 401 proxy_script_fetcher, dhcp_proxy_script_fetcher, net_log));
407 decider_->set_quick_check_enabled(quick_check_enabled_); 402 decider_->set_quick_check_enabled(quick_check_enabled_);
408 config_ = config; 403 config_ = config;
409 wait_delay_ = wait_delay; 404 wait_delay_ = wait_delay;
410 callback_ = callback; 405 callback_ = callback;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 default: 493 default:
499 NOTREACHED() << "bad state: " << state; 494 NOTREACHED() << "bad state: " << state;
500 rv = ERR_UNEXPECTED; 495 rv = ERR_UNEXPECTED;
501 break; 496 break;
502 } 497 }
503 } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE); 498 } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE);
504 return rv; 499 return rv;
505 } 500 }
506 501
507 int DoDecideProxyScript() { 502 int DoDecideProxyScript() {
508 // TODO(pkasting): Remove ScopedTracker below once crbug.com/455942 is 503 // TODO(eroman): Remove ScopedTracker below once crbug.com/455942 is fixed.
509 // fixed.
510 tracked_objects::ScopedTracker tracking_profile( 504 tracked_objects::ScopedTracker tracking_profile(
511 FROM_HERE_WITH_EXPLICIT_FUNCTION( 505 FROM_HERE_WITH_EXPLICIT_FUNCTION(
512 "455942 ProxyService::InitProxyResolver::DoDecideProxyScript")); 506 "455942 ProxyService::InitProxyResolver::DoDecideProxyScript"));
513 next_state_ = STATE_DECIDE_PROXY_SCRIPT_COMPLETE; 507 next_state_ = STATE_DECIDE_PROXY_SCRIPT_COMPLETE;
514 508
515 return decider_->Start( 509 return decider_->Start(
516 config_, wait_delay_, 510 config_, wait_delay_,
517 proxy_resolver_factory_->resolvers_expect_pac_bytes(), 511 proxy_resolver_factory_->resolvers_expect_pac_bytes(),
518 base::Bind(&InitProxyResolver::OnIOCompletion, base::Unretained(this))); 512 base::Bind(&InitProxyResolver::OnIOCompletion, base::Unretained(this)));
519 } 513 }
520 514
521 int DoDecideProxyScriptComplete(int result) { 515 int DoDecideProxyScriptComplete(int result) {
522 // TODO(pkasting): Remove ScopedTracker below once crbug.com/455942 is
523 // fixed.
524 tracked_objects::ScopedTracker tracking_profile(
525 FROM_HERE_WITH_EXPLICIT_FUNCTION(
526 "455942 "
527 "ProxyService::InitProxyResolver::DoDecideProxyScriptComplete"));
528 if (result != OK) 516 if (result != OK)
529 return result; 517 return result;
530 518
531 effective_config_ = decider_->effective_config(); 519 effective_config_ = decider_->effective_config();
532 script_data_ = decider_->script_data(); 520 script_data_ = decider_->script_data();
533 521
534 next_state_ = STATE_SET_PAC_SCRIPT; 522 next_state_ = STATE_SET_PAC_SCRIPT;
535 return OK; 523 return OK;
536 } 524 }
537 525
538 int DoSetPacScript() { 526 int DoSetPacScript() {
539 // TODO(pkasting): Remove ScopedTracker below once crbug.com/455942 is
540 // fixed.
541 tracked_objects::ScopedTracker tracking_profile(
542 FROM_HERE_WITH_EXPLICIT_FUNCTION(
543 "455942 ProxyService::InitProxyResolver::DoSetPacScript"));
544 DCHECK(script_data_.get()); 527 DCHECK(script_data_.get());
545 // TODO(eroman): Should log this latency to the NetLog. 528 // TODO(eroman): Should log this latency to the NetLog.
546 next_state_ = STATE_SET_PAC_SCRIPT_COMPLETE; 529 next_state_ = STATE_SET_PAC_SCRIPT_COMPLETE;
547 *proxy_resolver_ = proxy_resolver_factory_->CreateProxyResolver(); 530 *proxy_resolver_ = proxy_resolver_factory_->CreateProxyResolver();
548 DCHECK(*proxy_resolver_); 531 DCHECK(*proxy_resolver_);
549 return (*proxy_resolver_) 532 return (*proxy_resolver_)
550 ->SetPacScript(script_data_, 533 ->SetPacScript(script_data_,
551 base::Bind(&InitProxyResolver::OnIOCompletion, 534 base::Bind(&InitProxyResolver::OnIOCompletion,
552 base::Unretained(this))); 535 base::Unretained(this)));
553 } 536 }
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after
1644 State previous_state = ResetProxyConfig(false); 1627 State previous_state = ResetProxyConfig(false);
1645 if (previous_state != STATE_NONE) 1628 if (previous_state != STATE_NONE)
1646 ApplyProxyConfigIfAvailable(); 1629 ApplyProxyConfigIfAvailable();
1647 } 1630 }
1648 1631
1649 void ProxyService::OnDNSChanged() { 1632 void ProxyService::OnDNSChanged() {
1650 OnIPAddressChanged(); 1633 OnIPAddressChanged();
1651 } 1634 }
1652 1635
1653 } // namespace net 1636 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_script_decider.cc ('k') | net/url_request/url_fetcher_core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698