| 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/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 protected: | 59 protected: |
| 60 // It's a reference-counted object, so destructor is not public. | 60 // It's a reference-counted object, so destructor is not public. |
| 61 ~ImageWriterUtilityClient() override; | 61 ~ImageWriterUtilityClient() override; |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 // Ensures the UtilityProcessHost has been created. | 64 // Ensures the UtilityProcessHost has been created. |
| 65 void StartHost(); | 65 void StartHost(); |
| 66 | 66 |
| 67 // UtilityProcessHostClient implementation. | 67 // UtilityProcessHostClient implementation. |
| 68 void OnProcessCrashed(int exit_code) override; | 68 void OnProcessCrashed(int exit_code) override; |
| 69 void OnProcessLaunchFailed() override; | 69 void OnProcessLaunchFailed(int error_code) override; |
| 70 bool OnMessageReceived(const IPC::Message& message) override; | 70 bool OnMessageReceived(const IPC::Message& message) override; |
| 71 virtual bool Send(IPC::Message* msg); | 71 virtual bool Send(IPC::Message* msg); |
| 72 | 72 |
| 73 // IPC message handlers. | 73 // IPC message handlers. |
| 74 void OnWriteImageSucceeded(); | 74 void OnWriteImageSucceeded(); |
| 75 void OnWriteImageCancelled(); | 75 void OnWriteImageCancelled(); |
| 76 void OnWriteImageFailed(const std::string& message); | 76 void OnWriteImageFailed(const std::string& message); |
| 77 void OnWriteImageProgress(int64_t progress); | 77 void OnWriteImageProgress(int64_t progress); |
| 78 | 78 |
| 79 CancelCallback cancel_callback_; | 79 CancelCallback cancel_callback_; |
| 80 ProgressCallback progress_callback_; | 80 ProgressCallback progress_callback_; |
| 81 SuccessCallback success_callback_; | 81 SuccessCallback success_callback_; |
| 82 ErrorCallback error_callback_; | 82 ErrorCallback error_callback_; |
| 83 | 83 |
| 84 base::WeakPtr<content::UtilityProcessHost> utility_process_host_; | 84 base::WeakPtr<content::UtilityProcessHost> utility_process_host_; |
| 85 | 85 |
| 86 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 86 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 87 | 87 |
| 88 DISALLOW_COPY_AND_ASSIGN(ImageWriterUtilityClient); | 88 DISALLOW_COPY_AND_ASSIGN(ImageWriterUtilityClient); |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_IMAGE_WRITER_UTILI
TY_CLIENT_H_ | 91 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_IMAGE_WRITER_UTILI
TY_CLIENT_H_ |
| OLD | NEW |