OLD | NEW |
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 | 51 |
52 bool DriveScheduler::QueueEntry::Compare( | 52 bool DriveScheduler::QueueEntry::Compare( |
53 const DriveScheduler::QueueEntry* left, | 53 const DriveScheduler::QueueEntry* left, |
54 const DriveScheduler::QueueEntry* right) { | 54 const DriveScheduler::QueueEntry* right) { |
55 return (left->context.type < right->context.type); | 55 return (left->context.type < right->context.type); |
56 } | 56 } |
57 | 57 |
58 DriveScheduler::DriveScheduler( | 58 DriveScheduler::DriveScheduler( |
59 Profile* profile, | 59 Profile* profile, |
60 google_apis::DriveServiceInterface* drive_service, | 60 google_apis::DriveServiceInterface* drive_service) |
61 google_apis::DriveUploaderInterface* uploader) | |
62 : next_job_id_(0), | 61 : next_job_id_(0), |
63 throttle_count_(0), | 62 throttle_count_(0), |
64 disable_throttling_(false), | 63 disable_throttling_(false), |
65 drive_service_(drive_service), | 64 drive_service_(drive_service), |
66 uploader_(uploader), | 65 uploader_(new google_apis::DriveUploader(drive_service)), |
67 profile_(profile), | 66 profile_(profile), |
68 initialized_(false), | 67 initialized_(false), |
69 weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 68 weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
70 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 69 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
71 for (int i = 0; i < NUM_QUEUES; ++i) { | 70 for (int i = 0; i < NUM_QUEUES; ++i) { |
72 jobs_running_[i] = 0; | 71 jobs_running_[i] = 0; |
73 } | 72 } |
74 } | 73 } |
75 | 74 |
76 DriveScheduler::~DriveScheduler() { | 75 DriveScheduler::~DriveScheduler() { |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 case TYPE_DOWNLOAD_FILE: | 809 case TYPE_DOWNLOAD_FILE: |
811 case TYPE_UPLOAD_NEW_FILE: | 810 case TYPE_UPLOAD_NEW_FILE: |
812 case TYPE_UPLOAD_EXISTING_FILE: | 811 case TYPE_UPLOAD_EXISTING_FILE: |
813 return FILE_QUEUE; | 812 return FILE_QUEUE; |
814 } | 813 } |
815 NOTREACHED(); | 814 NOTREACHED(); |
816 return FILE_QUEUE; | 815 return FILE_QUEUE; |
817 } | 816 } |
818 | 817 |
819 } // namespace drive | 818 } // namespace drive |
OLD | NEW |