OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_SYSTEM_LOG_UPLOADER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_SYSTEM_LOG_UPLOADER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_SYSTEM_LOG_UPLOADER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_SYSTEM_LOG_UPLOADER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "chrome/browser/chromeos/policy/system_log_upload_job.h" | 14 #include "chrome/browser/chromeos/policy/system_log_upload_job.h" |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 class SequencedTaskRunner; | 17 class SequencedTaskRunner; |
18 } | 18 } |
19 | 19 |
20 namespace policy { | 20 namespace policy { |
21 | 21 |
22 // Class responsible for periodically uploading system logs. | 22 // Class responsible for periodically uploading system logs. |
23 class SystemLogUploader { | 23 class SystemLogUploader { |
24 public: | 24 public: |
| 25 // Refresh constants. |
| 26 static const int64 kDefaultUploadDelayMs; |
| 27 static const int64 kErrorUploadDelayMs; |
| 28 |
25 explicit SystemLogUploader( | 29 explicit SystemLogUploader( |
26 const scoped_refptr<base::SequencedTaskRunner>& task_runner); | 30 const scoped_refptr<base::SequencedTaskRunner>& task_runner); |
27 | 31 |
28 virtual ~SystemLogUploader(); | 32 virtual ~SystemLogUploader(); |
29 | 33 |
30 // Returns the time of the last upload attempt, or Time(0) if no upload has | 34 // Returns the time of the last upload attempt, or Time(0) if no upload has |
31 // ever happened. | 35 // ever happened. |
32 base::Time last_upload_attempt() const { return last_upload_attempt_; } | 36 base::Time last_upload_attempt() const { return last_upload_attempt_; } |
33 | 37 |
34 private: | 38 private: |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // Note: This should remain the last member so it'll be destroyed and | 73 // Note: This should remain the last member so it'll be destroyed and |
70 // invalidate the weak pointers before any other members are destroyed. | 74 // invalidate the weak pointers before any other members are destroyed. |
71 base::WeakPtrFactory<SystemLogUploader> weak_factory_; | 75 base::WeakPtrFactory<SystemLogUploader> weak_factory_; |
72 | 76 |
73 DISALLOW_COPY_AND_ASSIGN(SystemLogUploader); | 77 DISALLOW_COPY_AND_ASSIGN(SystemLogUploader); |
74 }; | 78 }; |
75 | 79 |
76 } // namespace policy | 80 } // namespace policy |
77 | 81 |
78 #endif // CHROME_BROWSER_CHROMEOS_POLICY_SYSTEM_LOG_UPLOADER_H_ | 82 #endif // CHROME_BROWSER_CHROMEOS_POLICY_SYSTEM_LOG_UPLOADER_H_ |
OLD | NEW |