| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_IMAGE_WRITER_UTILITY_
CLIENT_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_IMAGE_WRITER_UTILITY_
CLIENT_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_IMAGE_WRITER_UTILITY_
CLIENT_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_IMAGE_WRITER_UTILITY_
CLIENT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
| 15 #include "chrome/common/extensions/removable_storage_writer.mojom.h" | 15 #include "chrome/common/extensions/removable_storage_writer.mojom.h" |
| 16 #include "content/public/browser/utility_process_mojo_client.h" | 16 #include "content/public/browser/utility_process_mojo_client.h" |
| 17 | 17 |
| 18 // Writes a disk image to a device inside the utility process. | 18 // Writes a disk image to a device inside the utility process. This |
| 19 // class lives on the FILE thread. |
| 19 class ImageWriterUtilityClient | 20 class ImageWriterUtilityClient |
| 20 : public base::RefCountedThreadSafe<ImageWriterUtilityClient> { | 21 : public base::RefCountedThreadSafe<ImageWriterUtilityClient> { |
| 21 public: | 22 public: |
| 22 typedef base::Callback<void()> CancelCallback; | 23 typedef base::Callback<void()> CancelCallback; |
| 23 typedef base::Callback<void()> SuccessCallback; | 24 typedef base::Callback<void()> SuccessCallback; |
| 24 typedef base::Callback<void(int64_t)> ProgressCallback; | 25 typedef base::Callback<void(int64_t)> ProgressCallback; |
| 25 typedef base::Callback<void(const std::string&)> ErrorCallback; | 26 typedef base::Callback<void(const std::string&)> ErrorCallback; |
| 26 | 27 |
| 27 ImageWriterUtilityClient(); | 28 ImageWriterUtilityClient(); |
| 28 | 29 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 void OperationProgress(int64_t progress); | 72 void OperationProgress(int64_t progress); |
| 72 void OperationSucceeded(); | 73 void OperationSucceeded(); |
| 73 void OperationFailed(const std::string& error); | 74 void OperationFailed(const std::string& error); |
| 74 | 75 |
| 75 void ResetRequest(); | 76 void ResetRequest(); |
| 76 | 77 |
| 77 ProgressCallback progress_callback_; | 78 ProgressCallback progress_callback_; |
| 78 SuccessCallback success_callback_; | 79 SuccessCallback success_callback_; |
| 79 ErrorCallback error_callback_; | 80 ErrorCallback error_callback_; |
| 80 | 81 |
| 81 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | |
| 82 | |
| 83 std::unique_ptr<content::UtilityProcessMojoClient< | 82 std::unique_ptr<content::UtilityProcessMojoClient< |
| 84 extensions::mojom::RemovableStorageWriter>> | 83 extensions::mojom::RemovableStorageWriter>> |
| 85 utility_process_mojo_client_; | 84 utility_process_mojo_client_; |
| 86 | 85 |
| 87 std::unique_ptr<RemovableStorageWriterClientImpl> | 86 std::unique_ptr<RemovableStorageWriterClientImpl> |
| 88 removable_storage_writer_client_; | 87 removable_storage_writer_client_; |
| 89 | 88 |
| 90 DISALLOW_COPY_AND_ASSIGN(ImageWriterUtilityClient); | 89 DISALLOW_COPY_AND_ASSIGN(ImageWriterUtilityClient); |
| 91 }; | 90 }; |
| 92 | 91 |
| 93 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_IMAGE_WRITER_UTILI
TY_CLIENT_H_ | 92 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_IMAGE_WRITER_UTILI
TY_CLIENT_H_ |
| OLD | NEW |