| 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.h" | 5 #include "chrome/browser/component_updater/component_patcher.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" |
| 11 #include "base/json/json_file_value_serializer.h" | 11 #include "base/json/json_file_value_serializer.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/component_updater/component_patcher_operation.h" | 13 #include "chrome/browser/component_updater/component_patcher_operation.h" |
| 14 #include "chrome/browser/component_updater/component_updater_service.h" | 14 #include "chrome/browser/component_updater/component_updater_service.h" |
| 15 | 15 |
| 16 namespace component_updater { |
| 17 |
| 16 namespace { | 18 namespace { |
| 17 | 19 |
| 18 // Deserialize the commands file (present in delta update packages). The top | 20 // Deserialize the commands file (present in delta update packages). The top |
| 19 // level must be a list. | 21 // level must be a list. |
| 20 base::ListValue* ReadCommands(const base::FilePath& unpack_path) { | 22 base::ListValue* ReadCommands(const base::FilePath& unpack_path) { |
| 21 const base::FilePath commands = | 23 const base::FilePath commands = |
| 22 unpack_path.Append(FILE_PATH_LITERAL("commands.json")); | 24 unpack_path.Append(FILE_PATH_LITERAL("commands.json")); |
| 23 if (!base::PathExists(commands)) | 25 if (!base::PathExists(commands)) |
| 24 return NULL; | 26 return NULL; |
| 25 | 27 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 74 |
| 73 ComponentUnpacker::Error result = operation->Run( | 75 ComponentUnpacker::Error result = operation->Run( |
| 74 command_args, input_dir, unpack_dir, patcher, installer, error); | 76 command_args, input_dir, unpack_dir, patcher, installer, error); |
| 75 if (result != ComponentUnpacker::kNone) | 77 if (result != ComponentUnpacker::kNone) |
| 76 return result; | 78 return result; |
| 77 } | 79 } |
| 78 | 80 |
| 79 return ComponentUnpacker::kNone; | 81 return ComponentUnpacker::kNone; |
| 80 } | 82 } |
| 81 | 83 |
| 84 } // namespace component_updater |
| 85 |
| OLD | NEW |