| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/component_updater/component_patcher.h" | 5 #include "components/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" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 } | 84 } |
| 85 const base::DictionaryValue* command_args = | 85 const base::DictionaryValue* command_args = |
| 86 static_cast<base::DictionaryValue*>(*next_command_); | 86 static_cast<base::DictionaryValue*>(*next_command_); |
| 87 | 87 |
| 88 std::string operation; | 88 std::string operation; |
| 89 if (command_args->GetString(kOp, &operation)) { | 89 if (command_args->GetString(kOp, &operation)) { |
| 90 current_operation_ = | 90 current_operation_ = |
| 91 CreateDeltaUpdateOp(operation, out_of_process_patcher_); | 91 CreateDeltaUpdateOp(operation, out_of_process_patcher_); |
| 92 } | 92 } |
| 93 | 93 |
| 94 if (!current_operation_) { | 94 if (!current_operation_.get()) { |
| 95 DonePatching(ComponentUnpacker::kDeltaUnsupportedCommand, 0); | 95 DonePatching(ComponentUnpacker::kDeltaUnsupportedCommand, 0); |
| 96 return; | 96 return; |
| 97 } | 97 } |
| 98 current_operation_->Run(command_args, | 98 current_operation_->Run(command_args, |
| 99 input_dir_, | 99 input_dir_, |
| 100 unpack_dir_, | 100 unpack_dir_, |
| 101 installer_, | 101 installer_, |
| 102 base::Bind(&ComponentPatcher::DonePatchingFile, | 102 base::Bind(&ComponentPatcher::DonePatchingFile, |
| 103 scoped_refptr<ComponentPatcher>(this)), | 103 scoped_refptr<ComponentPatcher>(this)), |
| 104 task_runner_); | 104 task_runner_); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 116 | 116 |
| 117 void ComponentPatcher::DonePatching(ComponentUnpacker::Error error, | 117 void ComponentPatcher::DonePatching(ComponentUnpacker::Error error, |
| 118 int extended_error) { | 118 int extended_error) { |
| 119 current_operation_ = NULL; | 119 current_operation_ = NULL; |
| 120 task_runner_->PostTask(FROM_HERE, | 120 task_runner_->PostTask(FROM_HERE, |
| 121 base::Bind(callback_, error, extended_error)); | 121 base::Bind(callback_, error, extended_error)); |
| 122 callback_.Reset(); | 122 callback_.Reset(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 } // namespace component_updater | 125 } // namespace component_updater |
| OLD | NEW |