| 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/job_scheduler.h" | 5 #include "chrome/browser/chromeos/drive/job_scheduler.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "chrome/browser/chromeos/drive/file_system_util.h" | 12 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 13 #include "chrome/browser/chromeos/drive/logging.h" | 13 #include "chrome/browser/chromeos/drive/logging.h" |
| 14 #include "chrome/browser/google_apis/drive_api_parser.h" | |
| 15 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
| 16 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 16 #include "google_apis/drive/drive_api_parser.h" |
| 17 | 17 |
| 18 using content::BrowserThread; | 18 using content::BrowserThread; |
| 19 | 19 |
| 20 namespace drive { | 20 namespace drive { |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 // All jobs are retried at maximum of kMaxRetryCount when they fail due to | 24 // All jobs are retried at maximum of kMaxRetryCount when they fail due to |
| 25 // throttling or server error. The delay before retrying a job is shared among | 25 // throttling or server error. The delay before retrying a job is shared among |
| 26 // jobs. It doubles in length on each failure, upto 2^kMaxThrottleCount seconds. | 26 // jobs. It doubles in length on each failure, upto 2^kMaxThrottleCount seconds. |
| (...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1234 case FILE_QUEUE: | 1234 case FILE_QUEUE: |
| 1235 return "FILE_QUEUE"; | 1235 return "FILE_QUEUE"; |
| 1236 case NUM_QUEUES: | 1236 case NUM_QUEUES: |
| 1237 break; // This value is just a sentinel. Should never be used. | 1237 break; // This value is just a sentinel. Should never be used. |
| 1238 } | 1238 } |
| 1239 NOTREACHED(); | 1239 NOTREACHED(); |
| 1240 return ""; | 1240 return ""; |
| 1241 } | 1241 } |
| 1242 | 1242 |
| 1243 } // namespace drive | 1243 } // namespace drive |
| OLD | NEW |