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_STATUS_UPLOADER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_STATUS_UPLOADER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_STATUS_UPLOADER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_STATUS_UPLOADER_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include "base/cancelable_callback.h" | 10 #include "base/cancelable_callback.h" |
| 11 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
11 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
12 #include "base/time/time.h" | 15 #include "base/time/time.h" |
13 #include "chrome/browser/chromeos/settings/cros_settings.h" | 16 #include "chrome/browser/chromeos/settings/cros_settings.h" |
14 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 17 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
15 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 18 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
16 #include "policy/proto/device_management_backend.pb.h" | 19 #include "policy/proto/device_management_backend.pb.h" |
17 | 20 |
18 namespace base { | 21 namespace base { |
19 class SequencedTaskRunner; | 22 class SequencedTaskRunner; |
20 } | 23 } |
21 | 24 |
22 namespace policy { | 25 namespace policy { |
23 | 26 |
24 class CloudPolicyClient; | 27 class CloudPolicyClient; |
25 class DeviceStatusCollector; | 28 class DeviceStatusCollector; |
26 | 29 |
27 // Class responsible for periodically uploading device status from the | 30 // Class responsible for periodically uploading device status from the |
28 // passed DeviceStatusCollector. | 31 // passed DeviceStatusCollector. |
29 class StatusUploader : public MediaCaptureDevicesDispatcher::Observer { | 32 class StatusUploader : public MediaCaptureDevicesDispatcher::Observer { |
30 public: | 33 public: |
31 // Refresh constants. | 34 // Refresh constants. |
32 static const int64 kDefaultUploadDelayMs; | 35 static const int64_t kDefaultUploadDelayMs; |
33 | 36 |
34 // Constructor. |client| must be registered and must stay | 37 // Constructor. |client| must be registered and must stay |
35 // valid and registered through the lifetime of this StatusUploader | 38 // valid and registered through the lifetime of this StatusUploader |
36 // object. | 39 // object. |
37 StatusUploader( | 40 StatusUploader( |
38 CloudPolicyClient* client, | 41 CloudPolicyClient* client, |
39 scoped_ptr<DeviceStatusCollector> collector, | 42 scoped_ptr<DeviceStatusCollector> collector, |
40 const scoped_refptr<base::SequencedTaskRunner>& task_runner); | 43 const scoped_refptr<base::SequencedTaskRunner>& task_runner); |
41 | 44 |
42 ~StatusUploader() override; | 45 ~StatusUploader() override; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // Note: This should remain the last member so it'll be destroyed and | 103 // Note: This should remain the last member so it'll be destroyed and |
101 // invalidate the weak pointers before any other members are destroyed. | 104 // invalidate the weak pointers before any other members are destroyed. |
102 base::WeakPtrFactory<StatusUploader> weak_factory_; | 105 base::WeakPtrFactory<StatusUploader> weak_factory_; |
103 | 106 |
104 DISALLOW_COPY_AND_ASSIGN(StatusUploader); | 107 DISALLOW_COPY_AND_ASSIGN(StatusUploader); |
105 }; | 108 }; |
106 | 109 |
107 } // namespace policy | 110 } // namespace policy |
108 | 111 |
109 #endif // CHROME_BROWSER_CHROMEOS_POLICY_STATUS_UPLOADER_H_ | 112 #endif // CHROME_BROWSER_CHROMEOS_POLICY_STATUS_UPLOADER_H_ |
OLD | NEW |