| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // a reference to the arguments. | 156 // a reference to the arguments. |
| 157 PostBlockingTask(FROM_HERE, | 157 PostBlockingTask(FROM_HERE, |
| 158 base::Bind(&ExternalCache::BlockingInstallCacheEntry, | 158 base::Bind(&ExternalCache::BlockingInstallCacheEntry, |
| 159 weak_ptr_factory_.GetWeakPtr(), | 159 weak_ptr_factory_.GetWeakPtr(), |
| 160 std::string(cache_dir_), | 160 std::string(cache_dir_), |
| 161 std::string(id), | 161 std::string(id), |
| 162 base::FilePath(path), | 162 base::FilePath(path), |
| 163 std::string(version))); | 163 std::string(version))); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void ExternalCache::OnBlacklistDownloadFinished( | |
| 167 const std::string& data, | |
| 168 const std::string& package_hash, | |
| 169 const std::string& version, | |
| 170 const extensions::ExtensionDownloaderDelegate::PingResult& ping_result, | |
| 171 const std::set<int>& request_ids) { | |
| 172 NOTREACHED(); | |
| 173 } | |
| 174 | |
| 175 bool ExternalCache::IsExtensionPending(const std::string& id) { | 166 bool ExternalCache::IsExtensionPending(const std::string& id) { |
| 176 // Pending means that there is no installed version yet. | 167 // Pending means that there is no installed version yet. |
| 177 return extensions_->HasKey(id) && !cached_extensions_->HasKey(id); | 168 return extensions_->HasKey(id) && !cached_extensions_->HasKey(id); |
| 178 } | 169 } |
| 179 | 170 |
| 180 bool ExternalCache::GetExtensionExistingVersion(const std::string& id, | 171 bool ExternalCache::GetExtensionExistingVersion(const std::string& id, |
| 181 std::string* version) { | 172 std::string* version) { |
| 182 DictionaryValue* extension_dictionary = NULL; | 173 DictionaryValue* extension_dictionary = NULL; |
| 183 if (cached_extensions_->GetDictionary(id, &extension_dictionary)) { | 174 if (cached_extensions_->GetDictionary(id, &extension_dictionary)) { |
| 184 return extension_dictionary->GetString( | 175 return extension_dictionary->GetString( |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 | 482 |
| 492 void ExternalCache::PostBlockingTask(const tracked_objects::Location& location, | 483 void ExternalCache::PostBlockingTask(const tracked_objects::Location& location, |
| 493 const base::Closure& task) { | 484 const base::Closure& task) { |
| 494 content::BrowserThread::GetBlockingPool()-> | 485 content::BrowserThread::GetBlockingPool()-> |
| 495 PostSequencedWorkerTaskWithShutdownBehavior( | 486 PostSequencedWorkerTaskWithShutdownBehavior( |
| 496 worker_pool_token_, location, task, | 487 worker_pool_token_, location, task, |
| 497 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); | 488 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); |
| 498 } | 489 } |
| 499 | 490 |
| 500 } // namespace chromeos | 491 } // namespace chromeos |
| OLD | NEW |