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

Side by Side Diff: chrome/browser/component_updater/component_patcher_operation.cc

Issue 19052005: Move PathIsWritable, DirectoryExists, ContentsEqual, and TextContentsEqual to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 return ComponentUnpacker::kDeltaBadCommands; 65 return ComponentUnpacker::kDeltaBadCommands;
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 (!file_util::DirectoryExists(parent)) { 75 if (!base::DirectoryExists(parent)) {
76 if (!file_util::CreateDirectory(parent)) 76 if (!file_util::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 }
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698