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

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

Issue 1783008: Cleanup: Remove the implicit constructor for BoundNetLog that allowed passing... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Sync Created 10 years, 7 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.h ('k') | net/proxy/init_proxy_resolver_unittest.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/init_proxy_resolver.h" 5 #include "net/proxy/init_proxy_resolver.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/format_macros.h" 8 #include "base/format_macros.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "net/base/net_log.h" 11 #include "net/base/net_log.h"
12 #include "net/base/net_errors.h" 12 #include "net/base/net_errors.h"
13 #include "net/proxy/proxy_config.h" 13 #include "net/proxy/proxy_config.h"
14 #include "net/proxy/proxy_resolver.h" 14 #include "net/proxy/proxy_resolver.h"
15 #include "net/proxy/proxy_script_fetcher.h" 15 #include "net/proxy/proxy_script_fetcher.h"
16 16
17 namespace net { 17 namespace net {
18 18
19 InitProxyResolver::InitProxyResolver(ProxyResolver* resolver, 19 InitProxyResolver::InitProxyResolver(ProxyResolver* resolver,
20 ProxyScriptFetcher* proxy_script_fetcher) 20 ProxyScriptFetcher* proxy_script_fetcher,
21 NetLog* net_log)
21 : resolver_(resolver), 22 : resolver_(resolver),
22 proxy_script_fetcher_(proxy_script_fetcher), 23 proxy_script_fetcher_(proxy_script_fetcher),
23 ALLOW_THIS_IN_INITIALIZER_LIST(io_callback_( 24 ALLOW_THIS_IN_INITIALIZER_LIST(io_callback_(
24 this, &InitProxyResolver::OnIOCompletion)), 25 this, &InitProxyResolver::OnIOCompletion)),
25 user_callback_(NULL), 26 user_callback_(NULL),
26 current_pac_url_index_(0u), 27 current_pac_url_index_(0u),
27 next_state_(STATE_NONE) { 28 next_state_(STATE_NONE),
29 net_log_(BoundNetLog::Make(
30 net_log, NetLog::SOURCE_INIT_PROXY_RESOLVER)) {
28 } 31 }
29 32
30 InitProxyResolver::~InitProxyResolver() { 33 InitProxyResolver::~InitProxyResolver() {
31 if (next_state_ != STATE_NONE) 34 if (next_state_ != STATE_NONE)
32 Cancel(); 35 Cancel();
33 } 36 }
34 37
35 int InitProxyResolver::Init(const ProxyConfig& config, 38 int InitProxyResolver::Init(const ProxyConfig& config,
36 CompletionCallback* callback, 39 CompletionCallback* callback) {
37 const BoundNetLog& net_log) {
38 DCHECK_EQ(STATE_NONE, next_state_); 40 DCHECK_EQ(STATE_NONE, next_state_);
39 DCHECK(callback); 41 DCHECK(callback);
40 DCHECK(config.MayRequirePACResolver()); 42 DCHECK(config.MayRequirePACResolver());
41 DCHECK(!net_log_.net_log());
42
43 net_log_ = net_log;
44 43
45 net_log_.BeginEvent(NetLog::TYPE_INIT_PROXY_RESOLVER, NULL); 44 net_log_.BeginEvent(NetLog::TYPE_INIT_PROXY_RESOLVER, NULL);
46 45
47 pac_urls_ = BuildPacUrlsFallbackList(config); 46 pac_urls_ = BuildPacUrlsFallbackList(config);
48 DCHECK(!pac_urls_.empty()); 47 DCHECK(!pac_urls_.empty());
49 48
50 next_state_ = GetStartState(); 49 next_state_ = GetStartState();
51 50
52 int rv = DoLoop(OK); 51 int rv = DoLoop(OK);
53 if (rv == ERR_IO_PENDING) 52 if (rv == ERR_IO_PENDING)
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 break; 224 break;
226 default: 225 default:
227 NOTREACHED(); 226 NOTREACHED();
228 break; 227 break;
229 } 228 }
230 229
231 DidCompleteInit(); 230 DidCompleteInit();
232 } 231 }
233 232
234 } // namespace net 233 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/init_proxy_resolver.h ('k') | net/proxy/init_proxy_resolver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698