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

Unified Diff: chrome/utility/image_writer/image_writer_handler.h

Issue 2663603002: Convert utility process ImageWriter IPC to mojo (Closed)
Patch Set: Use https: in bug references, minor comment fixes. Created 3 years, 10 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/utility/image_writer/image_writer_handler.h
diff --git a/chrome/utility/image_writer/image_writer_handler.h b/chrome/utility/image_writer/image_writer_handler.h
index 4543dec832950ac2a87f552ae74a4bba667eaed9..d61fc91b5dccd592b38dd45a7bbb26b07f9fed28 100644
--- a/chrome/utility/image_writer/image_writer_handler.h
+++ b/chrome/utility/image_writer/image_writer_handler.h
@@ -10,9 +10,8 @@
#include <memory>
#include <string>
+#include "chrome/common/extensions/removable_storage_writer.mojom.h"
#include "chrome/utility/image_writer/image_writer.h"
-#include "chrome/utility/utility_message_handler.h"
-#include "ipc/ipc_message.h"
namespace base {
class FilePath;
@@ -20,31 +19,29 @@ class FilePath;
namespace image_writer {
-// A handler for messages related to writing images. This class is added as a
-// handler in ChromeContentUtilityClient.
-class ImageWriterHandler : public UtilityMessageHandler {
+class ImageWriterHandler {
public:
ImageWriterHandler();
- ~ImageWriterHandler() override;
+ ~ImageWriterHandler();
- // Methods for sending the different messages back to the browser process.
- // Generally should be called by chrome::image_writer::ImageWriter.
- virtual void SendSucceeded();
- virtual void SendCancelled();
- virtual void SendFailed(const std::string& message);
+ void Write(const base::FilePath& image,
+ const base::FilePath& device,
+ extensions::mojom::RemovableStorageWriterClientPtr client);
+ void Verify(const base::FilePath& image,
+ const base::FilePath& device,
+ extensions::mojom::RemovableStorageWriterClientPtr client);
+
+ // Methods for sending the different messages back to the |client_|.
+ // Generally should be called by image_writer::ImageWriter.
virtual void SendProgress(int64_t progress);
+ virtual void SendSucceeded();
+ virtual void SendFailed(const std::string& error);
+ virtual void SendCancelled() {}
private:
- bool OnMessageReceived(const IPC::Message& message) override;
-
- // Small wrapper for sending on the UtilityProcess.
- void Send(IPC::Message* msg);
-
- // Message handlers.
- void OnWriteStart(const base::FilePath& image, const base::FilePath& device);
- void OnVerifyStart(const base::FilePath& image, const base::FilePath& device);
- void OnCancel();
+ void Cancel();
+ extensions::mojom::RemovableStorageWriterClientPtr client_;
std::unique_ptr<ImageWriter> image_writer_;
};
« no previous file with comments | « chrome/utility/extensions/extensions_handler.cc ('k') | chrome/utility/image_writer/image_writer_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698