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

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

Issue 2566053002: Convert utility process out-of-process file patching to mojo (Closed)
Patch Set: Address review comments. Created 4 years 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..92789c18d486354e85bc4abdf816de12a4490fee 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,14 +21,11 @@ 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,
@@ -37,7 +36,16 @@ class ChromeOutOfProcessPatcher : public update_client::OutOfProcessPatcher {
private:
~ChromeOutOfProcessPatcher() override;
- scoped_refptr<PatchHost> host_;
+ // Patch() request operation result.
+ 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 for 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