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

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

Issue 4192012: Convert implicit scoped_refptr constructor calls to explicit ones, part 1 (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: fix presubmit Created 10 years, 1 month 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/http/http_transaction_unittest.cc ('k') | net/proxy/proxy_script_fetcher_impl_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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/multi_threaded_proxy_resolver.h" 5 #include "net/proxy/multi_threaded_proxy_resolver.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/thread.h" 10 #include "base/thread.h"
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 int MultiThreadedProxyResolver::GetProxyForURL(const GURL& url, 403 int MultiThreadedProxyResolver::GetProxyForURL(const GURL& url,
404 ProxyInfo* results, 404 ProxyInfo* results,
405 CompletionCallback* callback, 405 CompletionCallback* callback,
406 RequestHandle* request, 406 RequestHandle* request,
407 const BoundNetLog& net_log) { 407 const BoundNetLog& net_log) {
408 DCHECK(CalledOnValidThread()); 408 DCHECK(CalledOnValidThread());
409 DCHECK(callback); 409 DCHECK(callback);
410 DCHECK(current_script_data_.get()) 410 DCHECK(current_script_data_.get())
411 << "Resolver is un-initialized. Must call SetPacScript() first!"; 411 << "Resolver is un-initialized. Must call SetPacScript() first!";
412 412
413 scoped_refptr<GetProxyForURLJob> job = 413 scoped_refptr<GetProxyForURLJob> job(
414 new GetProxyForURLJob(url, results, callback, net_log); 414 new GetProxyForURLJob(url, results, callback, net_log));
415 415
416 // Completion will be notified through |callback|, unless the caller cancels 416 // Completion will be notified through |callback|, unless the caller cancels
417 // the request using |request|. 417 // the request using |request|.
418 if (request) 418 if (request)
419 *request = reinterpret_cast<RequestHandle>(job.get()); 419 *request = reinterpret_cast<RequestHandle>(job.get());
420 420
421 // If there is an executor that is ready to run this request, submit it! 421 // If there is an executor that is ready to run this request, submit it!
422 Executor* executor = FindIdleExecutor(); 422 Executor* executor = FindIdleExecutor();
423 if (executor) { 423 if (executor) {
424 DCHECK_EQ(0u, pending_jobs_.size()); 424 DCHECK_EQ(0u, pending_jobs_.size());
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 return; 567 return;
568 568
569 // Get the next job to process (FIFO). Transfer it from the pending queue 569 // Get the next job to process (FIFO). Transfer it from the pending queue
570 // to the executor. 570 // to the executor.
571 scoped_refptr<Job> job = pending_jobs_.front(); 571 scoped_refptr<Job> job = pending_jobs_.front();
572 pending_jobs_.pop_front(); 572 pending_jobs_.pop_front();
573 executor->StartJob(job); 573 executor->StartJob(job);
574 } 574 }
575 575
576 } // namespace net 576 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_transaction_unittest.cc ('k') | net/proxy/proxy_script_fetcher_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698