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

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

Issue 1716007: Cleanup: Address some of the todos in net_log.h... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Address willchan's comments Created 10 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 | Annotate | Revision Log
« no previous file with comments | « net/proxy/init_proxy_resolver_unittest.cc ('k') | net/socket/client_socket_pool_base.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 pending_requests_.erase(it); 462 pending_requests_.erase(it);
463 } 463 }
464 464
465 int ProxyService::DidFinishResolvingProxy(ProxyInfo* result, 465 int ProxyService::DidFinishResolvingProxy(ProxyInfo* result,
466 int result_code, 466 int result_code,
467 const BoundNetLog& net_log) { 467 const BoundNetLog& net_log) {
468 // Log the result of the proxy resolution. 468 // Log the result of the proxy resolution.
469 if (result_code == OK) { 469 if (result_code == OK) {
470 // When full logging is enabled, dump the proxy list. 470 // When full logging is enabled, dump the proxy list.
471 if (net_log.HasListener()) { 471 if (net_log.HasListener()) {
472 net_log.AddString( 472 net_log.AddEventWithString(
473 std::string("Resolved proxy list: ") + result->ToPacString()); 473 NetLog::TYPE_PROXY_SERVICE_RESOLVED_PROXY_LIST,
474 "pac_string", result->ToPacString());
474 } 475 }
475 result->DeprioritizeBadProxies(proxy_retry_info_); 476 result->DeprioritizeBadProxies(proxy_retry_info_);
476 } else { 477 } else {
477 net_log.AddString(StringPrintf( 478 net_log.AddEventWithInteger(
478 "Got an error from proxy resolver (%d), falling-back to DIRECT.", 479 NetLog::TYPE_PROXY_SERVICE_RESOLVED_PROXY_LIST,
479 result_code)); 480 "net_error", result_code);
480 481
481 // Fall-back to direct when the proxy resolver fails. This corresponds 482 // Fall-back to direct when the proxy resolver fails. This corresponds
482 // with a javascript runtime error in the PAC script. 483 // with a javascript runtime error in the PAC script.
483 // 484 //
484 // This implicit fall-back to direct matches Firefox 3.5 and 485 // This implicit fall-back to direct matches Firefox 3.5 and
485 // Internet Explorer 8. For more information, see: 486 // Internet Explorer 8. For more information, see:
486 // 487 //
487 // http://www.chromium.org/developers/design-documents/proxy-settings-fallba ck 488 // http://www.chromium.org/developers/design-documents/proxy-settings-fallba ck
488 result->UseDirect(); 489 result->UseDirect();
489 result_code = OK; 490 result_code = OK;
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 OnCompletion(result_); 740 OnCompletion(result_);
740 } 741 }
741 } 742 }
742 743
743 void SyncProxyServiceHelper::OnCompletion(int rv) { 744 void SyncProxyServiceHelper::OnCompletion(int rv) {
744 result_ = rv; 745 result_ = rv;
745 event_.Signal(); 746 event_.Signal();
746 } 747 }
747 748
748 } // namespace net 749 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/init_proxy_resolver_unittest.cc ('k') | net/socket/client_socket_pool_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698