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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 VLOG(1) << "Notify ExternalCache delegate about cache update"; | 215 VLOG(1) << "Notify ExternalCache delegate about cache update"; |
216 if (delegate_) | 216 if (delegate_) |
217 delegate_->OnExtensionListsUpdated(cached_extensions_.get()); | 217 delegate_->OnExtensionListsUpdated(cached_extensions_.get()); |
218 } | 218 } |
219 | 219 |
220 void ExternalCache::CheckCache() { | 220 void ExternalCache::CheckCache() { |
221 if (local_cache_.is_shutdown()) | 221 if (local_cache_.is_shutdown()) |
222 return; | 222 return; |
223 | 223 |
224 // If request_context_ is missing we can't download anything. | 224 // If request_context_ is missing we can't download anything. |
225 if (!downloader_ && request_context_) { | 225 if (!downloader_ && request_context_.get()) { |
226 downloader_.reset( | 226 downloader_.reset( |
227 new extensions::ExtensionDownloader(this, request_context_)); | 227 new extensions::ExtensionDownloader(this, request_context_.get())); |
228 } | 228 } |
229 | 229 |
230 cached_extensions_->Clear(); | 230 cached_extensions_->Clear(); |
231 for (base::DictionaryValue::Iterator it(*extensions_.get()); | 231 for (base::DictionaryValue::Iterator it(*extensions_.get()); |
232 !it.IsAtEnd(); it.Advance()) { | 232 !it.IsAtEnd(); it.Advance()) { |
233 const base::DictionaryValue* entry = NULL; | 233 const base::DictionaryValue* entry = NULL; |
234 if (!it.value().GetAsDictionary(&entry)) { | 234 if (!it.value().GetAsDictionary(&entry)) { |
235 LOG(ERROR) << "ExternalCache found bad entry with type " | 235 LOG(ERROR) << "ExternalCache found bad entry with type " |
236 << it.value().GetType(); | 236 << it.value().GetType(); |
237 continue; | 237 continue; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 OnPutExtension(id, file_path, file_ownership_passed); | 344 OnPutExtension(id, file_path, file_ownership_passed); |
345 callback.Run(id, !file_ownership_passed); | 345 callback.Run(id, !file_ownership_passed); |
346 } | 346 } |
347 | 347 |
348 std::string ExternalCache::Delegate::GetInstalledExtensionVersion( | 348 std::string ExternalCache::Delegate::GetInstalledExtensionVersion( |
349 const std::string& id) { | 349 const std::string& id) { |
350 return std::string(); | 350 return std::string(); |
351 } | 351 } |
352 | 352 |
353 } // namespace chromeos | 353 } // namespace chromeos |
OLD | NEW |