| 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 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 VLOG(1) << "Notify ExternalCache delegate about cache update"; | 222 VLOG(1) << "Notify ExternalCache delegate about cache update"; |
| 223 if (delegate_) | 223 if (delegate_) |
| 224 delegate_->OnExtensionListsUpdated(cached_extensions_.get()); | 224 delegate_->OnExtensionListsUpdated(cached_extensions_.get()); |
| 225 } | 225 } |
| 226 | 226 |
| 227 void ExternalCache::CheckCache() { | 227 void ExternalCache::CheckCache() { |
| 228 if (local_cache_.is_shutdown()) | 228 if (local_cache_.is_shutdown()) |
| 229 return; | 229 return; |
| 230 | 230 |
| 231 // If request_context_ is missing we can't download anything. | 231 // If request_context_ is missing we can't download anything. |
| 232 if (!downloader_ && request_context_.get()) { | 232 if (request_context_.get()) { |
| 233 downloader_ = ChromeExtensionDownloaderFactory::CreateForRequestContext( | 233 downloader_ = ChromeExtensionDownloaderFactory::CreateForRequestContext( |
| 234 request_context_.get(), this); | 234 request_context_.get(), this); |
| 235 } | 235 } |
| 236 | 236 |
| 237 cached_extensions_->Clear(); | 237 cached_extensions_->Clear(); |
| 238 for (base::DictionaryValue::Iterator it(*extensions_.get()); | 238 for (base::DictionaryValue::Iterator it(*extensions_.get()); |
| 239 !it.IsAtEnd(); it.Advance()) { | 239 !it.IsAtEnd(); it.Advance()) { |
| 240 const base::DictionaryValue* entry = NULL; | 240 const base::DictionaryValue* entry = NULL; |
| 241 if (!it.value().GetAsDictionary(&entry)) { | 241 if (!it.value().GetAsDictionary(&entry)) { |
| 242 LOG(ERROR) << "ExternalCache found bad entry with type " | 242 LOG(ERROR) << "ExternalCache found bad entry with type " |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 OnPutExtension(id, file_path, file_ownership_passed); | 358 OnPutExtension(id, file_path, file_ownership_passed); |
| 359 callback.Run(id, !file_ownership_passed); | 359 callback.Run(id, !file_ownership_passed); |
| 360 } | 360 } |
| 361 | 361 |
| 362 std::string ExternalCache::Delegate::GetInstalledExtensionVersion( | 362 std::string ExternalCache::Delegate::GetInstalledExtensionVersion( |
| 363 const std::string& id) { | 363 const std::string& id) { |
| 364 return std::string(); | 364 return std::string(); |
| 365 } | 365 } |
| 366 | 366 |
| 367 } // namespace chromeos | 367 } // namespace chromeos |
| OLD | NEW |