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

Unified Diff: chrome/browser/component_updater/component_patcher.cc

Issue 420503002: Componentize component_updater: Decouple in-process DeltaUpdateOp from out-of-process version. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: run git cl format and git cl lint Created 6 years, 4 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.cc
diff --git a/chrome/browser/component_updater/component_patcher.cc b/chrome/browser/component_updater/component_patcher.cc
index 223bca817f4be9097c6fd7f7818e92d76bf45cdd..fffab9f491a4ff94488d7b2f2e45c603836f649c 100644
--- a/chrome/browser/component_updater/component_patcher.cc
+++ b/chrome/browser/component_updater/component_patcher.cc
@@ -44,12 +44,12 @@ ComponentPatcher::ComponentPatcher(
const base::FilePath& input_dir,
const base::FilePath& unpack_dir,
ComponentInstaller* installer,
- bool in_process,
+ scoped_refptr<OutOfProcessPatcher> out_of_process_patcher,
scoped_refptr<base::SequencedTaskRunner> task_runner)
: input_dir_(input_dir),
unpack_dir_(unpack_dir),
installer_(installer),
- in_process_(in_process),
+ out_of_process_patcher_(out_of_process_patcher),
task_runner_(task_runner) {
}
@@ -84,7 +84,13 @@ void ComponentPatcher::PatchNextFile() {
}
const base::DictionaryValue* command_args =
static_cast<base::DictionaryValue*>(*next_command_);
- current_operation_ = CreateDeltaUpdateOp(*command_args);
+
+ std::string operation;
+ if (command_args->GetString(kOp, &operation)) {
+ current_operation_ =
+ CreateDeltaUpdateOp(operation, out_of_process_patcher_);
+ }
+
if (!current_operation_) {
DonePatching(ComponentUnpacker::kDeltaUnsupportedCommand, 0);
return;
@@ -93,7 +99,6 @@ void ComponentPatcher::PatchNextFile() {
input_dir_,
unpack_dir_,
installer_,
- in_process_,
base::Bind(&ComponentPatcher::DonePatchingFile,
scoped_refptr<ComponentPatcher>(this)),
task_runner_);

Powered by Google App Engine
This is Rietveld 408576698