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

Unified Diff: chrome/browser/component_updater/component_patcher_operation_out_of_process.h

Issue 2632143002: Convert utility process out-of-process file patching IPC to mojo (Closed)
Patch Set: Reupload to sync to tip. Try landing again. Created 3 years, 11 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/component_updater/component_patcher_operation_out_of_process.h
diff --git a/chrome/browser/component_updater/component_patcher_operation_out_of_process.h b/chrome/browser/component_updater/component_patcher_operation_out_of_process.h
index 5500193755977eef8dd9ce86014157fa0d933552..8424a01a6a192b1b66add65249e9dd6c4ca1c455 100644
--- a/chrome/browser/component_updater/component_patcher_operation_out_of_process.h
+++ b/chrome/browser/component_updater/component_patcher_operation_out_of_process.h
@@ -10,7 +10,9 @@
#include "base/callback_forward.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "chrome/common/file_patcher.mojom.h"
#include "components/update_client/component_patcher_operation.h"
+#include "content/public/browser/utility_process_mojo_client.h"
namespace base {
class FilePath;
@@ -19,25 +21,37 @@ class SequencedTaskRunner;
namespace component_updater {
-class PatchHost;
-
-// Implements the DeltaUpdateOpPatch out-of-process patching.
class ChromeOutOfProcessPatcher : public update_client::OutOfProcessPatcher {
public:
ChromeOutOfProcessPatcher();
- // DeltaUpdateOpPatch::OutOfProcessPatcher implementation.
+ // update_client::OutOfProcessPatcher:
void Patch(const std::string& operation,
scoped_refptr<base::SequencedTaskRunner> task_runner,
- const base::FilePath& input_abs_path,
- const base::FilePath& patch_abs_path,
- const base::FilePath& output_abs_path,
+ const base::FilePath& input_path,
+ const base::FilePath& patch_path,
+ const base::FilePath& output_path,
base::Callback<void(int result)> callback) override;
private:
~ChromeOutOfProcessPatcher() override;
- scoped_refptr<PatchHost> host_;
+ // Perform a patch operation using chrome::mojom::FilePatcher.
+ void PatchOnIOThread(const std::string& operation,
+ base::File input_file,
+ base::File patch_file,
+ base::File output_file);
+
+ // Patch operation result handler.
+ void PatchDone(int result);
+
+ // Used to signal the operation result back to the Patch() requester.
+ scoped_refptr<base::SequencedTaskRunner> task_runner_;
+ base::Callback<void(int result)> callback_;
+
+ // Utility process used to perform out-of-process file patching.
+ std::unique_ptr<content::UtilityProcessMojoClient<chrome::mojom::FilePatcher>>
+ utility_process_mojo_client_;
DISALLOW_COPY_AND_ASSIGN(ChromeOutOfProcessPatcher);
};

Powered by Google App Engine
This is Rietveld 408576698