| 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/rand_util.h" | 10 #include "base/rand_util.h" |
| 11 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" | 11 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" |
| 12 #include "chrome/browser/chromeos/drive/file_system/remove_operation.h" | 12 #include "chrome/browser/chromeos/drive/file_system/remove_operation.h" |
| 13 #include "chrome/browser/prefs/pref_service.h" | 13 #include "chrome/browser/prefs/pref_service.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
| 16 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 17 | 17 |
| 18 using content::BrowserThread; | 18 using content::BrowserThread; |
| 19 | 19 |
| 20 namespace gdata { | 20 namespace drive { |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 const int kMaxThrottleCount = 5; | 23 const int kMaxThrottleCount = 5; |
| 24 } | 24 } |
| 25 | 25 |
| 26 DriveScheduler::JobInfo::JobInfo(JobType in_job_type, FilePath in_file_path) | 26 DriveScheduler::JobInfo::JobInfo(JobType in_job_type, FilePath in_file_path) |
| 27 : job_type(in_job_type), | 27 : job_type(in_job_type), |
| 28 job_id(-1), | 28 job_id(-1), |
| 29 completed_bytes(0), | 29 completed_bytes(0), |
| 30 total_bytes(0), | 30 total_bytes(0), |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 net::NetworkChangeNotifier::ConnectionType type) { | 226 net::NetworkChangeNotifier::ConnectionType type) { |
| 227 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 227 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 228 | 228 |
| 229 // Resume the job loop if the network is back online. Note that we don't | 229 // Resume the job loop if the network is back online. Note that we don't |
| 230 // need to check the type of the network as it will be checked in | 230 // need to check the type of the network as it will be checked in |
| 231 // ShouldStopJobLoop() as soon as the loop is resumed. | 231 // ShouldStopJobLoop() as soon as the loop is resumed. |
| 232 if (!net::NetworkChangeNotifier::IsOffline()) | 232 if (!net::NetworkChangeNotifier::IsOffline()) |
| 233 StartJobLoop(); | 233 StartJobLoop(); |
| 234 } | 234 } |
| 235 | 235 |
| 236 } // namespace gdata | 236 } // namespace drive |
| OLD | NEW |