OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/chromeos/extensions/external_cache.h" | 5 #include "chrome/browser/chromeos/extensions/external_cache.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> |
8 | 9 |
9 #include "base/bind.h" | 10 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
11 #include "base/callback.h" | 12 #include "base/callback.h" |
12 #include "base/files/file_enumerator.h" | 13 #include "base/files/file_enumerator.h" |
13 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
14 #include "base/location.h" | 15 #include "base/location.h" |
15 #include "base/logging.h" | 16 #include "base/logging.h" |
16 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
17 #include "base/values.h" | 18 #include "base/values.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 64 |
64 ExternalCache::~ExternalCache() { | 65 ExternalCache::~ExternalCache() { |
65 } | 66 } |
66 | 67 |
67 void ExternalCache::Shutdown(const base::Closure& callback) { | 68 void ExternalCache::Shutdown(const base::Closure& callback) { |
68 local_cache_.Shutdown(callback); | 69 local_cache_.Shutdown(callback); |
69 } | 70 } |
70 | 71 |
71 void ExternalCache::UpdateExtensionsList( | 72 void ExternalCache::UpdateExtensionsList( |
72 scoped_ptr<base::DictionaryValue> prefs) { | 73 scoped_ptr<base::DictionaryValue> prefs) { |
73 extensions_ = prefs.Pass(); | 74 extensions_ = std::move(prefs); |
74 | 75 |
75 if (extensions_->empty()) { | 76 if (extensions_->empty()) { |
76 // If list of know extensions is empty, don't init cache on disk. It is | 77 // If list of know extensions is empty, don't init cache on disk. It is |
77 // important shortcut for test to don't wait forever for cache dir | 78 // important shortcut for test to don't wait forever for cache dir |
78 // initialization that should happen outside of Chrome on real device. | 79 // initialization that should happen outside of Chrome on real device. |
79 cached_extensions_->Clear(); | 80 cached_extensions_->Clear(); |
80 UpdateExtensionLoader(); | 81 UpdateExtensionLoader(); |
81 return; | 82 return; |
82 } | 83 } |
83 | 84 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 OnPutExtension(id, file_path, file_ownership_passed); | 364 OnPutExtension(id, file_path, file_ownership_passed); |
364 callback.Run(id, !file_ownership_passed); | 365 callback.Run(id, !file_ownership_passed); |
365 } | 366 } |
366 | 367 |
367 std::string ExternalCache::Delegate::GetInstalledExtensionVersion( | 368 std::string ExternalCache::Delegate::GetInstalledExtensionVersion( |
368 const std::string& id) { | 369 const std::string& id) { |
369 return std::string(); | 370 return std::string(); |
370 } | 371 } |
371 | 372 |
372 } // namespace chromeos | 373 } // namespace chromeos |
OLD | NEW |