Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Unified Diff: chrome/browser/chromeos/policy/status_uploader.h

Issue 2765463002: Remote fetch device status (attributes and logs) command (Closed)
Patch Set: Addressed Drew's comments, treating StatusUploader and SystemLogUploader as one Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/policy/status_uploader.h
diff --git a/chrome/browser/chromeos/policy/status_uploader.h b/chrome/browser/chromeos/policy/status_uploader.h
index 9cbefceca217e5b9a282147b1a661e5f803b4a5b..af976519994865bcf421f9613f58808cd4bc17d7 100644
--- a/chrome/browser/chromeos/policy/status_uploader.h
+++ b/chrome/browser/chromeos/policy/status_uploader.h
@@ -59,6 +59,8 @@ class StatusUploader : public MediaCaptureDevicesDispatcher::Observer {
content::MediaStreamType stream_type,
const content::MediaRequestState state) override;
+ void ScheduleNextStatusUploadImmediately();
+
private:
// Callback invoked periodically to upload the device status from the
// DeviceStatusCollector.
@@ -76,7 +78,7 @@ class StatusUploader : public MediaCaptureDevicesDispatcher::Observer {
// Helper method that figures out when the next status upload should
// be scheduled.
- void ScheduleNextStatusUpload();
+ void ScheduleNextStatusUpload(bool immediately = false);
// Updates the upload frequency from settings and schedules a new upload
// if appropriate.
@@ -107,6 +109,10 @@ class StatusUploader : public MediaCaptureDevicesDispatcher::Observer {
// True if there has been any captured media in this session.
bool has_captured_media_;
+ // Used to prevent a race condition where two status uploads are being
+ // executed in parallel.
+ bool status_upload_in_progress_ = false;
+
// Note: This should remain the last member so it'll be destroyed and
// invalidate the weak pointers before any other members are destroyed.
base::WeakPtrFactory<StatusUploader> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698