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/update_client/component_patcher.h" | 5 #include "components/update_client/component_patcher.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 PatchNextFile(); | 73 PatchNextFile(); |
74 } | 74 } |
75 } | 75 } |
76 | 76 |
77 void ComponentPatcher::PatchNextFile() { | 77 void ComponentPatcher::PatchNextFile() { |
78 if (next_command_ == commands_->end()) { | 78 if (next_command_ == commands_->end()) { |
79 DonePatching(UnpackerError::kNone, 0); | 79 DonePatching(UnpackerError::kNone, 0); |
80 return; | 80 return; |
81 } | 81 } |
82 const base::DictionaryValue* command_args; | 82 const base::DictionaryValue* command_args; |
83 if (!(*next_command_)->GetAsDictionary(&command_args)) { | 83 if (!next_command_->GetAsDictionary(&command_args)) { |
84 DonePatching(UnpackerError::kDeltaBadCommands, 0); | 84 DonePatching(UnpackerError::kDeltaBadCommands, 0); |
85 return; | 85 return; |
86 } | 86 } |
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 |
(...skipping 18 matching lines...) Expand all Loading... |
112 } | 112 } |
113 | 113 |
114 void ComponentPatcher::DonePatching(UnpackerError error, int extended_error) { | 114 void ComponentPatcher::DonePatching(UnpackerError error, int extended_error) { |
115 current_operation_ = NULL; | 115 current_operation_ = NULL; |
116 task_runner_->PostTask(FROM_HERE, | 116 task_runner_->PostTask(FROM_HERE, |
117 base::Bind(callback_, error, extended_error)); | 117 base::Bind(callback_, error, extended_error)); |
118 callback_.Reset(); | 118 callback_.Reset(); |
119 } | 119 } |
120 | 120 |
121 } // namespace update_client | 121 } // namespace update_client |
OLD | NEW |