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

Side by Side Diff: chrome/browser/policy/cloud/external_policy_data_updater.cc

Issue 15987009: Update chrome/ to use WeakPtr<T>::get() instead of implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/policy/cloud/external_policy_data_updater.h" 5 #include "chrome/browser/policy/cloud/external_policy_data_updater.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 delete job->second; 379 delete job->second;
380 job_map_.erase(job); 380 job_map_.erase(job);
381 } 381 }
382 } 382 }
383 383
384 void ExternalPolicyDataUpdater::StartNextJobs() { 384 void ExternalPolicyDataUpdater::StartNextJobs() {
385 if (shutting_down_) 385 if (shutting_down_)
386 return; 386 return;
387 387
388 while (running_jobs_ < max_parallel_jobs_ && !job_queue_.empty()) { 388 while (running_jobs_ < max_parallel_jobs_ && !job_queue_.empty()) {
389 FetchJob* job = job_queue_.front(); 389 FetchJob* job = job_queue_.front().get();
390 job_queue_.pop(); 390 job_queue_.pop();
391 391
392 // Some of the jobs may have been invalidated, and have to be skipped. 392 // Some of the jobs may have been invalidated, and have to be skipped.
393 if (job) { 393 if (job) {
394 ++running_jobs_; 394 ++running_jobs_;
395 // A started job will always call OnJobSucceeded() or OnJobFailed(). 395 // A started job will always call OnJobSucceeded() or OnJobFailed().
396 job->Start(); 396 job->Start();
397 } 397 }
398 } 398 }
399 } 399 }
(...skipping 22 matching lines...) Expand all
422 DCHECK_EQ(job_map_[job->key()], job); 422 DCHECK_EQ(job_map_[job->key()], job);
423 423
424 --running_jobs_; 424 --running_jobs_;
425 425
426 // The job is not deleted when it fails because a retry attempt may have been 426 // The job is not deleted when it fails because a retry attempt may have been
427 // scheduled. 427 // scheduled.
428 StartNextJobs(); 428 StartNextJobs();
429 } 429 }
430 430
431 } // namespace policy 431 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/net/transport_security_persister.cc ('k') | chrome/browser/prerender/prerender_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698