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

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

Issue 25883006: Support asynchronous patching operations in the component updater. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tests
Patch Set: sorin@, cpu@ review Created 7 years, 1 month 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.cc
diff --git a/chrome/browser/component_updater/component_patcher_operation.cc b/chrome/browser/component_updater/component_patcher_operation.cc
index 3f5f46a61354476cc3787cfd3c6d590709643d9f..a19f20efdf078a5e89348bfc0b2eebdb49ea512c 100644
--- a/chrome/browser/component_updater/component_patcher_operation.cc
+++ b/chrome/browser/component_updater/component_patcher_operation.cc
@@ -34,6 +34,8 @@ const char kSha256[] = "sha256";
} // namespace
+namespace component_updater {
+
DeltaUpdateOp* CreateDeltaUpdateOp(base::DictionaryValue* command) {
std::string operation;
if (!command->GetString(kOp, &operation))
@@ -53,12 +55,13 @@ DeltaUpdateOp::DeltaUpdateOp() {}
DeltaUpdateOp::~DeltaUpdateOp() {}
-ComponentUnpacker::Error DeltaUpdateOp::Run(base::DictionaryValue* command_args,
- const base::FilePath& input_dir,
- const base::FilePath& unpack_dir,
- ComponentPatcher* patcher,
- ComponentInstaller* installer,
- int* error) {
+ComponentUnpacker::Error DeltaUpdateOp::Run(
+ base::DictionaryValue* command_args,
+ const base::FilePath& input_dir,
+ const base::FilePath& unpack_dir,
+ ComponentPatcher* patcher,
+ ComponentInstaller* installer,
+ int* error) {
std::string output_rel_path;
if (!command_args->GetString(kOutput, &output_rel_path) ||
!command_args->GetString(kSha256, &output_sha256_))
@@ -77,7 +80,8 @@ ComponentUnpacker::Error DeltaUpdateOp::Run(base::DictionaryValue* command_args,
return ComponentUnpacker::kIoError;
}
- ComponentUnpacker::Error run_result = DoRun(patcher, error);
+ ComponentUnpacker::Error run_result = DoRun(
+ patcher, error);
if (run_result != ComponentUnpacker::kNone)
return run_result;
@@ -122,8 +126,9 @@ ComponentUnpacker::Error DeltaUpdateOpCopy::DoParseArguments(
return ComponentUnpacker::kNone;
}
-ComponentUnpacker::Error DeltaUpdateOpCopy::DoRun(ComponentPatcher*,
- int* error) {
+ComponentUnpacker::Error DeltaUpdateOpCopy::DoRun(
+ ComponentPatcher*,
+ int* error) {
*error = 0;
if (!base::CopyFile(input_abs_path_, output_abs_path_))
return ComponentUnpacker::kDeltaOperationFailure;
@@ -220,3 +225,4 @@ ComponentUnpacker::Error DeltaUpdateOpPatchCourgette::DoRun(
error);
}
+} // namespace component_updater

Powered by Google App Engine
This is Rietveld 408576698