OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_SYSTEM_LOG_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_SYSTEM_LOG_DELEGATE_H_ |
| 7 |
| 8 #include "chrome/browser/chromeos/policy/system_log_upload_job.h" |
| 9 #include "chrome/browser/chromeos/policy/upload_job.h" |
| 10 |
| 11 namespace policy { |
| 12 |
| 13 // An implementation of the |SystemLogUploadJob::Delegate|. |
| 14 class SystemLogDelegate : public SystemLogUploadJob::Delegate { |
| 15 public: |
| 16 SystemLogDelegate(); |
| 17 ~SystemLogDelegate() override; |
| 18 |
| 19 // SystemLogUploadJob::Delegate: |
| 20 void LoadSystemLogs( |
| 21 const SystemLogUploadJob::LogUploadCallback& upload_callback) override; |
| 22 |
| 23 scoped_ptr<UploadJob> CreateUploadJob(const GURL& upload_url, |
| 24 UploadJob::Delegate* delegate) override; |
| 25 |
| 26 private: |
| 27 // Reads the system log files as binary files, stores the files as pairs |
| 28 // (file name, data) in the external structure to pass it to the |
| 29 // |upload_callback|. |
| 30 void ReadFiles(SystemLogUploadJob::SystemLogs* system_logs); |
| 31 |
| 32 base::WeakPtrFactory<SystemLogDelegate> weak_ptr_factory_; |
| 33 |
| 34 DISALLOW_COPY_AND_ASSIGN(SystemLogDelegate); |
| 35 }; |
| 36 |
| 37 } // namespace policy |
| 38 |
| 39 #endif // CHROME_BROWSER_CHROMEOS_POLICY_SYSTEM_LOG_DELEGATE_H_ |
OLD | NEW |