| 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/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/bind.h" |
| 11 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 12 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 13 #include "base/json/json_file_value_serializer.h" | 14 #include "base/json/json_file_value_serializer.h" |
| 15 #include "base/location.h" |
| 14 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 15 #include "base/values.h" | 17 #include "base/values.h" |
| 16 #include "chrome/browser/component_updater/component_patcher_operation.h" | 18 #include "chrome/browser/component_updater/component_patcher_operation.h" |
| 17 #include "chrome/browser/component_updater/component_updater_service.h" | 19 #include "chrome/browser/component_updater/component_updater_service.h" |
| 18 #include "content/public/browser/browser_thread.h" | |
| 19 | 20 |
| 20 namespace component_updater { | 21 namespace component_updater { |
| 21 | 22 |
| 22 namespace { | 23 namespace { |
| 23 | 24 |
| 24 // Deserialize the commands file (present in delta update packages). The top | 25 // Deserialize the commands file (present in delta update packages). The top |
| 25 // level must be a list. | 26 // level must be a list. |
| 26 base::ListValue* ReadCommands(const base::FilePath& unpack_path) { | 27 base::ListValue* ReadCommands(const base::FilePath& unpack_path) { |
| 27 const base::FilePath commands = | 28 const base::FilePath commands = |
| 28 unpack_path.Append(FILE_PATH_LITERAL("commands.json")); | 29 unpack_path.Append(FILE_PATH_LITERAL("commands.json")); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 111 |
| 111 void ComponentPatcher::DonePatching(ComponentUnpacker::Error error, | 112 void ComponentPatcher::DonePatching(ComponentUnpacker::Error error, |
| 112 int extended_error) { | 113 int extended_error) { |
| 113 current_operation_ = NULL; | 114 current_operation_ = NULL; |
| 114 task_runner_->PostTask(FROM_HERE, | 115 task_runner_->PostTask(FROM_HERE, |
| 115 base::Bind(callback_, error, extended_error)); | 116 base::Bind(callback_, error, extended_error)); |
| 116 callback_.Reset(); | 117 callback_.Reset(); |
| 117 } | 118 } |
| 118 | 119 |
| 119 } // namespace component_updater | 120 } // namespace component_updater |
| OLD | NEW |