Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Side by Side Diff: chrome/browser/chromeos/extensions/external_cache.cc

Issue 2650653009: Reset extension downloader when updating external extension cache (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698