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

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

Issue 1193333017: Added system log uploader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added FileReader - helper class that reads files thread safely. Created 5 years, 6 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/system_log_delegate.h
diff --git a/chrome/browser/chromeos/policy/system_log_delegate.h b/chrome/browser/chromeos/policy/system_log_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..1b59cb621fd4e965fbbebcd95c49c145c8e548ce
--- /dev/null
+++ b/chrome/browser/chromeos/policy/system_log_delegate.h
@@ -0,0 +1,41 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_POLICY_SYSTEM_LOG_DELEGATE_H_
+#define CHROME_BROWSER_CHROMEOS_POLICY_SYSTEM_LOG_DELEGATE_H_
+
+#include "base/task/cancelable_task_tracker.h"
+#include "chrome/browser/chromeos/policy/system_log_upload_job.h"
+#include "chrome/browser/chromeos/policy/upload_job.h"
+
+namespace policy {
+
+class FileReader;
Andrew T Wilson (Slow) 2015/07/03 15:40:47 Can this be an inner class inside SystemLogDelegat
Polina Bondarenko 2015/07/08 10:07:23 Done.
+
+// An implementation of the |SystemLogUploadJob::Delegate|.
+class SystemLogDelegate : public SystemLogUploadJob::Delegate {
+ public:
+ SystemLogDelegate();
+ ~SystemLogDelegate() override;
+
+ // SystemLogUploadJob::Delegate:
+ void LoadSystemLogs(
+ const SystemLogUploadJob::LogUploadCallback& upload_callback) override;
+
+ scoped_ptr<UploadJob> CreateUploadJob(const GURL& upload_url,
+ UploadJob::Delegate* delegate) override;
+
+ private:
+ // Used in reading log files.
+ base::CancelableTaskTracker tracker_;
+ scoped_refptr<FileReader> file_reader_;
+
+ base::WeakPtrFactory<SystemLogDelegate> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(SystemLogDelegate);
+};
+
+} // namespace policy
+
+#endif // CHROME_BROWSER_CHROMEOS_POLICY_SYSTEM_LOG_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698