OLD | NEW |
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" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/process/kill.h" | 13 #include "base/process/kill.h" |
14 #include "base/process/launch.h" | 14 #include "base/process/launch.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "base/win/scoped_handle.h" | 16 #include "base/win/scoped_handle.h" |
17 #include "chrome/installer/util/util_constants.h" | 17 #include "chrome/installer/util/util_constants.h" |
18 | 18 |
| 19 namespace component_updater { |
| 20 |
19 namespace { | 21 namespace { |
20 | 22 |
21 std::string PatchTypeToCommandLineSwitch( | 23 std::string PatchTypeToCommandLineSwitch( |
22 ComponentPatcher::PatchType patch_type) { | 24 ComponentPatcher::PatchType patch_type) { |
23 if (patch_type == ComponentPatcher::kPatchTypeCourgette) | 25 if (patch_type == ComponentPatcher::kPatchTypeCourgette) |
24 return std::string(installer::kCourgette); | 26 return std::string(installer::kCourgette); |
25 else if (patch_type == ComponentPatcher::kPatchTypeBsdiff) | 27 else if (patch_type == ComponentPatcher::kPatchTypeBsdiff) |
26 return std::string(installer::kBsdiff); | 28 return std::string(installer::kBsdiff); |
27 else | 29 else |
28 return std::string(); | 30 return std::string(); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 !base::WaitForExitCode(ph, &exit_code)) { | 107 !base::WaitForExitCode(ph, &exit_code)) { |
106 *error = GetLastError(); | 108 *error = GetLastError(); |
107 return ComponentUnpacker::kDeltaPatchProcessFailure; | 109 return ComponentUnpacker::kDeltaPatchProcessFailure; |
108 } | 110 } |
109 | 111 |
110 *error = exit_code; | 112 *error = exit_code; |
111 return *error ? ComponentUnpacker::kDeltaOperationFailure : | 113 return *error ? ComponentUnpacker::kDeltaOperationFailure : |
112 ComponentUnpacker::kNone; | 114 ComponentUnpacker::kNone; |
113 } | 115 } |
114 | 116 |
| 117 } // namespace component_updater |
| 118 |
OLD | NEW |