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

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

Issue 18286004: Move PathExists to 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_win.h" 5 #include "chrome/browser/component_updater/component_patcher_win.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 24 matching lines...) Expand all
35 base::FilePath exe_dir; 35 base::FilePath exe_dir;
36 if (!PathService::Get(base::DIR_MODULE, &exe_dir)) 36 if (!PathService::Get(base::DIR_MODULE, &exe_dir))
37 return base::FilePath(); 37 return base::FilePath();
38 38
39 const std::string installer_dir(WideToASCII(installer::kInstallerDir)); 39 const std::string installer_dir(WideToASCII(installer::kInstallerDir));
40 const std::string setup_exe(WideToASCII(installer::kSetupExe)); 40 const std::string setup_exe(WideToASCII(installer::kSetupExe));
41 41
42 base::FilePath setup_path = exe_dir; 42 base::FilePath setup_path = exe_dir;
43 setup_path = setup_path.AppendASCII(installer_dir); 43 setup_path = setup_path.AppendASCII(installer_dir);
44 setup_path = setup_path.AppendASCII(setup_exe); 44 setup_path = setup_path.AppendASCII(setup_exe);
45 if (file_util::PathExists(setup_path)) 45 if (base::PathExists(setup_path))
46 return setup_path; 46 return setup_path;
47 47
48 setup_path = exe_dir; 48 setup_path = exe_dir;
49 setup_path = setup_path.AppendASCII(setup_exe); 49 setup_path = setup_path.AppendASCII(setup_exe);
50 if (file_util::PathExists(setup_path)) 50 if (base::PathExists(setup_path))
51 return setup_path; 51 return setup_path;
52 52
53 return base::FilePath(); 53 return base::FilePath();
54 } 54 }
55 55
56 } // namespace 56 } // namespace
57 57
58 // Applies the patch to the input file. Returns kNone if the patch was 58 // Applies the patch to the input file. Returns kNone if the patch was
59 // successfully applied, kDeltaOperationFailure if the patch operation 59 // successfully applied, kDeltaOperationFailure if the patch operation
60 // encountered errors, and kDeltaPatchProcessFailure if there was an error 60 // encountered errors, and kDeltaPatchProcessFailure if there was an error
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 !base::WaitForExitCode(ph, &exit_code)) { 103 !base::WaitForExitCode(ph, &exit_code)) {
104 *error = GetLastError(); 104 *error = GetLastError();
105 return ComponentUnpacker::kDeltaPatchProcessFailure; 105 return ComponentUnpacker::kDeltaPatchProcessFailure;
106 } 106 }
107 107
108 *error = exit_code; 108 *error = exit_code;
109 return *error ? ComponentUnpacker::kDeltaOperationFailure : 109 return *error ? ComponentUnpacker::kDeltaOperationFailure :
110 ComponentUnpacker::kNone; 110 ComponentUnpacker::kNone;
111 } 111 }
112 112
OLDNEW
« no previous file with comments | « chrome/browser/component_updater/component_patcher.cc ('k') | chrome/browser/component_updater/component_unpacker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698