OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/component_updater/component_patcher_operation.h" | 5 #include "chrome/browser/component_updater/component_patcher_operation.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 output_abs_path_ = unpack_dir.Append( | 67 output_abs_path_ = unpack_dir.Append( |
68 base::FilePath::FromUTF8Unsafe(output_rel_path)); | 68 base::FilePath::FromUTF8Unsafe(output_rel_path)); |
69 ComponentUnpacker::Error parse_result = DoParseArguments( | 69 ComponentUnpacker::Error parse_result = DoParseArguments( |
70 command_args, input_dir, installer); | 70 command_args, input_dir, installer); |
71 if (parse_result != ComponentUnpacker::kNone) | 71 if (parse_result != ComponentUnpacker::kNone) |
72 return parse_result; | 72 return parse_result; |
73 | 73 |
74 const base::FilePath parent = output_abs_path_.DirName(); | 74 const base::FilePath parent = output_abs_path_.DirName(); |
75 if (!base::DirectoryExists(parent)) { | 75 if (!base::DirectoryExists(parent)) { |
76 if (!file_util::CreateDirectory(parent)) | 76 if (!base::CreateDirectory(parent)) |
77 return ComponentUnpacker::kIoError; | 77 return ComponentUnpacker::kIoError; |
78 } | 78 } |
79 | 79 |
80 ComponentUnpacker::Error run_result = DoRun(patcher, error); | 80 ComponentUnpacker::Error run_result = DoRun(patcher, error); |
81 if (run_result != ComponentUnpacker::kNone) | 81 if (run_result != ComponentUnpacker::kNone) |
82 return run_result; | 82 return run_result; |
83 | 83 |
84 return CheckHash(); | 84 return CheckHash(); |
85 } | 85 } |
86 | 86 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 ComponentPatcher* patcher, | 213 ComponentPatcher* patcher, |
214 int* error) { | 214 int* error) { |
215 *error = 0; | 215 *error = 0; |
216 return patcher->Patch(ComponentPatcher::kPatchTypeCourgette, | 216 return patcher->Patch(ComponentPatcher::kPatchTypeCourgette, |
217 input_abs_path_, | 217 input_abs_path_, |
218 patch_abs_path_, | 218 patch_abs_path_, |
219 output_abs_path_, | 219 output_abs_path_, |
220 error); | 220 error); |
221 } | 221 } |
222 | 222 |
OLD | NEW |