OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_unpacker.h" | 5 #include "chrome/browser/component_updater/component_unpacker.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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 base::DeleteFile(unpack_diff_path_, true); | 233 base::DeleteFile(unpack_diff_path_, true); |
234 unpack_diff_path_.clear(); | 234 unpack_diff_path_.clear(); |
235 } | 235 } |
236 Install(); | 236 Install(); |
237 Finish(); | 237 Finish(); |
238 } | 238 } |
239 | 239 |
240 void ComponentUnpacker::Install() { | 240 void ComponentUnpacker::Install() { |
241 // Write the fingerprint to disk. | 241 // Write the fingerprint to disk. |
242 if (static_cast<int>(fingerprint_.size()) != | 242 if (static_cast<int>(fingerprint_.size()) != |
243 file_util::WriteFile( | 243 base::WriteFile( |
244 unpack_path_.Append(FILE_PATH_LITERAL("manifest.fingerprint")), | 244 unpack_path_.Append(FILE_PATH_LITERAL("manifest.fingerprint")), |
245 fingerprint_.c_str(), | 245 fingerprint_.c_str(), |
246 fingerprint_.size())) { | 246 fingerprint_.size())) { |
247 error_ = kFingerprintWriteFailed; | 247 error_ = kFingerprintWriteFailed; |
248 return; | 248 return; |
249 } | 249 } |
250 scoped_ptr<base::DictionaryValue> manifest(ReadManifest(unpack_path_)); | 250 scoped_ptr<base::DictionaryValue> manifest(ReadManifest(unpack_path_)); |
251 if (!manifest.get()) { | 251 if (!manifest.get()) { |
252 error_ = kBadManifest; | 252 error_ = kBadManifest; |
253 return; | 253 return; |
(...skipping 14 matching lines...) Expand all Loading... |
268 } | 268 } |
269 | 269 |
270 base::WeakPtr<ComponentUnpacker> ComponentUnpacker::GetWeakPtr() { | 270 base::WeakPtr<ComponentUnpacker> ComponentUnpacker::GetWeakPtr() { |
271 return ptr_factory_.GetWeakPtr(); | 271 return ptr_factory_.GetWeakPtr(); |
272 } | 272 } |
273 | 273 |
274 ComponentUnpacker::~ComponentUnpacker() { | 274 ComponentUnpacker::~ComponentUnpacker() { |
275 } | 275 } |
276 | 276 |
277 } // namespace component_updater | 277 } // namespace component_updater |
OLD | NEW |