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..bd3cbe4bd628bedd3d7ec2b22a5cf0fc16255d85 100644 |
--- a/chrome/browser/component_updater/component_patcher_operation.cc |
+++ b/chrome/browser/component_updater/component_patcher_operation.cc |
@@ -53,7 +53,7 @@ DeltaUpdateOp::DeltaUpdateOp() {} |
DeltaUpdateOp::~DeltaUpdateOp() {} |
-ComponentUnpacker::Error DeltaUpdateOp::Run(base::DictionaryValue* command_args, |
+component_updater::Error DeltaUpdateOp::Run(base::DictionaryValue* command_args, |
const base::FilePath& input_dir, |
const base::FilePath& unpack_dir, |
ComponentPatcher* patcher, |
@@ -62,23 +62,23 @@ ComponentUnpacker::Error DeltaUpdateOp::Run(base::DictionaryValue* command_args, |
std::string output_rel_path; |
if (!command_args->GetString(kOutput, &output_rel_path) || |
!command_args->GetString(kSha256, &output_sha256_)) |
- return ComponentUnpacker::kDeltaBadCommands; |
+ return component_updater::kDeltaBadCommands; |
output_abs_path_ = unpack_dir.Append( |
base::FilePath::FromUTF8Unsafe(output_rel_path)); |
- ComponentUnpacker::Error parse_result = DoParseArguments( |
+ component_updater::Error parse_result = DoParseArguments( |
command_args, input_dir, installer); |
- if (parse_result != ComponentUnpacker::kNone) |
+ if (parse_result != component_updater::kNone) |
return parse_result; |
const base::FilePath parent = output_abs_path_.DirName(); |
if (!base::DirectoryExists(parent)) { |
if (!file_util::CreateDirectory(parent)) |
- return ComponentUnpacker::kIoError; |
+ return component_updater::kIoError; |
} |
- ComponentUnpacker::Error run_result = DoRun(patcher, error); |
- if (run_result != ComponentUnpacker::kNone) |
+ component_updater::Error run_result = DoRun(patcher, error); |
+ if (run_result != component_updater::kNone) |
return run_result; |
return CheckHash(); |
@@ -86,79 +86,79 @@ ComponentUnpacker::Error DeltaUpdateOp::Run(base::DictionaryValue* command_args, |
// Uses the hash as a checksum to confirm that the file now residing in the |
// output directory probably has the contents it should. |
-ComponentUnpacker::Error DeltaUpdateOp::CheckHash() { |
+component_updater::Error DeltaUpdateOp::CheckHash() { |
std::vector<uint8> expected_hash; |
if (!base::HexStringToBytes(output_sha256_, &expected_hash) || |
expected_hash.size() != crypto::kSHA256Length) |
- return ComponentUnpacker::kDeltaVerificationFailure; |
+ return component_updater::kDeltaVerificationFailure; |
base::MemoryMappedFile output_file_mmapped; |
if (!output_file_mmapped.Initialize(output_abs_path_)) |
- return ComponentUnpacker::kDeltaVerificationFailure; |
+ return component_updater::kDeltaVerificationFailure; |
uint8 actual_hash[crypto::kSHA256Length] = {0}; |
const scoped_ptr<SecureHash> hasher(SecureHash::Create(SecureHash::SHA256)); |
hasher->Update(output_file_mmapped.data(), output_file_mmapped.length()); |
hasher->Finish(actual_hash, sizeof(actual_hash)); |
if (memcmp(actual_hash, &expected_hash[0], sizeof(actual_hash))) |
- return ComponentUnpacker::kDeltaVerificationFailure; |
+ return component_updater::kDeltaVerificationFailure; |
- return ComponentUnpacker::kNone; |
+ return component_updater::kNone; |
} |
DeltaUpdateOpCopy::DeltaUpdateOpCopy() {} |
-ComponentUnpacker::Error DeltaUpdateOpCopy::DoParseArguments( |
+component_updater::Error DeltaUpdateOpCopy::DoParseArguments( |
base::DictionaryValue* command_args, |
const base::FilePath& input_dir, |
ComponentInstaller* installer) { |
std::string input_rel_path; |
if (!command_args->GetString(kInput, &input_rel_path)) |
- return ComponentUnpacker::kDeltaBadCommands; |
+ return component_updater::kDeltaBadCommands; |
if (!installer->GetInstalledFile(input_rel_path, &input_abs_path_)) |
- return ComponentUnpacker::kDeltaMissingExistingFile; |
+ return component_updater::kDeltaMissingExistingFile; |
- return ComponentUnpacker::kNone; |
+ return component_updater::kNone; |
} |
-ComponentUnpacker::Error DeltaUpdateOpCopy::DoRun(ComponentPatcher*, |
+component_updater::Error DeltaUpdateOpCopy::DoRun(ComponentPatcher*, |
int* error) { |
*error = 0; |
if (!base::CopyFile(input_abs_path_, output_abs_path_)) |
- return ComponentUnpacker::kDeltaOperationFailure; |
+ return component_updater::kDeltaOperationFailure; |
- return ComponentUnpacker::kNone; |
+ return component_updater::kNone; |
} |
DeltaUpdateOpCreate::DeltaUpdateOpCreate() {} |
-ComponentUnpacker::Error DeltaUpdateOpCreate::DoParseArguments( |
+component_updater::Error DeltaUpdateOpCreate::DoParseArguments( |
base::DictionaryValue* command_args, |
const base::FilePath& input_dir, |
ComponentInstaller* installer) { |
std::string patch_rel_path; |
if (!command_args->GetString(kPatch, &patch_rel_path)) |
- return ComponentUnpacker::kDeltaBadCommands; |
+ return component_updater::kDeltaBadCommands; |
patch_abs_path_ = input_dir.Append( |
base::FilePath::FromUTF8Unsafe(patch_rel_path)); |
- return ComponentUnpacker::kNone; |
+ return component_updater::kNone; |
} |
-ComponentUnpacker::Error DeltaUpdateOpCreate::DoRun(ComponentPatcher*, |
+component_updater::Error DeltaUpdateOpCreate::DoRun(ComponentPatcher*, |
int* error) { |
*error = 0; |
if (!base::Move(patch_abs_path_, output_abs_path_)) |
- return ComponentUnpacker::kDeltaOperationFailure; |
+ return component_updater::kDeltaOperationFailure; |
- return ComponentUnpacker::kNone; |
+ return component_updater::kNone; |
} |
DeltaUpdateOpPatchBsdiff::DeltaUpdateOpPatchBsdiff() {} |
-ComponentUnpacker::Error DeltaUpdateOpPatchBsdiff::DoParseArguments( |
+component_updater::Error DeltaUpdateOpPatchBsdiff::DoParseArguments( |
base::DictionaryValue* command_args, |
const base::FilePath& input_dir, |
ComponentInstaller* installer) { |
@@ -166,18 +166,18 @@ ComponentUnpacker::Error DeltaUpdateOpPatchBsdiff::DoParseArguments( |
std::string input_rel_path; |
if (!command_args->GetString(kPatch, &patch_rel_path) || |
!command_args->GetString(kInput, &input_rel_path)) |
- return ComponentUnpacker::kDeltaBadCommands; |
+ return component_updater::kDeltaBadCommands; |
if (!installer->GetInstalledFile(input_rel_path, &input_abs_path_)) |
- return ComponentUnpacker::kDeltaMissingExistingFile; |
+ return component_updater::kDeltaMissingExistingFile; |
patch_abs_path_ = input_dir.Append( |
base::FilePath::FromUTF8Unsafe(patch_rel_path)); |
- return ComponentUnpacker::kNone; |
+ return component_updater::kNone; |
} |
-ComponentUnpacker::Error DeltaUpdateOpPatchBsdiff::DoRun( |
+component_updater::Error DeltaUpdateOpPatchBsdiff::DoRun( |
ComponentPatcher* patcher, |
int* error) { |
*error = 0; |
@@ -190,7 +190,7 @@ ComponentUnpacker::Error DeltaUpdateOpPatchBsdiff::DoRun( |
DeltaUpdateOpPatchCourgette::DeltaUpdateOpPatchCourgette() {} |
-ComponentUnpacker::Error DeltaUpdateOpPatchCourgette::DoParseArguments( |
+component_updater::Error DeltaUpdateOpPatchCourgette::DoParseArguments( |
base::DictionaryValue* command_args, |
const base::FilePath& input_dir, |
ComponentInstaller* installer) { |
@@ -198,18 +198,18 @@ ComponentUnpacker::Error DeltaUpdateOpPatchCourgette::DoParseArguments( |
std::string input_rel_path; |
if (!command_args->GetString(kPatch, &patch_rel_path) || |
!command_args->GetString(kInput, &input_rel_path)) |
- return ComponentUnpacker::kDeltaBadCommands; |
+ return component_updater::kDeltaBadCommands; |
if (!installer->GetInstalledFile(input_rel_path, &input_abs_path_)) |
- return ComponentUnpacker::kDeltaMissingExistingFile; |
+ return component_updater::kDeltaMissingExistingFile; |
patch_abs_path_ = input_dir.Append( |
base::FilePath::FromUTF8Unsafe(patch_rel_path)); |
- return ComponentUnpacker::kNone; |
+ return component_updater::kNone; |
} |
-ComponentUnpacker::Error DeltaUpdateOpPatchCourgette::DoRun( |
+component_updater::Error DeltaUpdateOpPatchCourgette::DoRun( |
ComponentPatcher* patcher, |
int* error) { |
*error = 0; |