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/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 } | 331 } |
332 | 332 |
333 base::DictionaryValue* cached_entry = NULL; | 333 base::DictionaryValue* cached_entry = NULL; |
334 if (prefs->GetDictionary(it.key(), &cached_entry)) { | 334 if (prefs->GetDictionary(it.key(), &cached_entry)) { |
335 std::string crx_path; | 335 std::string crx_path; |
336 if (!downloader_ || | 336 if (!downloader_ || |
337 cached_entry->GetString( | 337 cached_entry->GetString( |
338 extensions::ExternalProviderImpl::kExternalCrx, &crx_path) || | 338 extensions::ExternalProviderImpl::kExternalCrx, &crx_path) || |
339 cached_entry->HasKey( | 339 cached_entry->HasKey( |
340 extensions::ExternalProviderImpl::kKeepIfPresent)) { | 340 extensions::ExternalProviderImpl::kKeepIfPresent)) { |
341 base::Value* value = NULL; | 341 scoped_ptr<base::Value> value; |
342 prefs->Remove(it.key(), &value); | 342 prefs->Remove(it.key(), &value); |
343 cached_extensions_->Set(it.key(), value); | 343 cached_extensions_->Set(it.key(), value.release()); |
344 } | 344 } |
345 } | 345 } |
346 } | 346 } |
347 if (downloader_) | 347 if (downloader_) |
348 downloader_->StartAllPending(); | 348 downloader_->StartAllPending(); |
349 | 349 |
350 VLOG(1) << "Updated ExternalCache, there are " | 350 VLOG(1) << "Updated ExternalCache, there are " |
351 << cached_extensions_->size() << " extensions cached"; | 351 << cached_extensions_->size() << " extensions cached"; |
352 | 352 |
353 UpdateExtensionLoader(); | 353 UpdateExtensionLoader(); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 | 431 |
432 void ExternalCache::PostBlockingTask(const tracked_objects::Location& location, | 432 void ExternalCache::PostBlockingTask(const tracked_objects::Location& location, |
433 const base::Closure& task) { | 433 const base::Closure& task) { |
434 content::BrowserThread::GetBlockingPool()-> | 434 content::BrowserThread::GetBlockingPool()-> |
435 PostSequencedWorkerTaskWithShutdownBehavior( | 435 PostSequencedWorkerTaskWithShutdownBehavior( |
436 worker_pool_token_, location, task, | 436 worker_pool_token_, location, task, |
437 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); | 437 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); |
438 } | 438 } |
439 | 439 |
440 } // namespace chromeos | 440 } // namespace chromeos |
OLD | NEW |