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

Side by Side Diff: chrome/browser/chromeos/drive/drive_scheduler.cc

Issue 12229002: Misc cleanups in Drive code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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) 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 "chrome/browser/chromeos/drive/drive_scheduler.h" 5 #include "chrome/browser/chromeos/drive/drive_scheduler.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 Profile* profile, 55 Profile* profile,
56 google_apis::DriveServiceInterface* drive_service, 56 google_apis::DriveServiceInterface* drive_service,
57 google_apis::DriveUploaderInterface* uploader) 57 google_apis::DriveUploaderInterface* uploader)
58 : job_loop_is_running_(false), 58 : job_loop_is_running_(false),
59 next_job_id_(0), 59 next_job_id_(0),
60 throttle_count_(0), 60 throttle_count_(0),
61 disable_throttling_(false), 61 disable_throttling_(false),
62 drive_service_(drive_service), 62 drive_service_(drive_service),
63 uploader_(uploader), 63 uploader_(uploader),
64 profile_(profile), 64 profile_(profile),
65 weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), 65 initialized_(false),
66 initialized_(false) { 66 weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
67 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 67 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
68 } 68 }
69 69
70 DriveScheduler::~DriveScheduler() { 70 DriveScheduler::~DriveScheduler() {
71 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 71 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
72 DCHECK(initialized_); 72 DCHECK(initialized_);
73 STLDeleteElements(&queue_); 73 STLDeleteElements(&queue_);
74 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); 74 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this);
75 } 75 }
76 76
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 678 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
679 679
680 // Resume the job loop if the network is back online. Note that we don't 680 // Resume the job loop if the network is back online. Note that we don't
681 // need to check the type of the network as it will be checked in 681 // need to check the type of the network as it will be checked in
682 // ShouldStopJobLoop() as soon as the loop is resumed. 682 // ShouldStopJobLoop() as soon as the loop is resumed.
683 if (!net::NetworkChangeNotifier::IsOffline()) 683 if (!net::NetworkChangeNotifier::IsOffline())
684 StartJobLoop(); 684 StartJobLoop();
685 } 685 }
686 686
687 } // namespace drive 687 } // namespace drive
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698