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