Index: chrome/browser/extensions/updater/extension_cache_impl.cc |
diff --git a/chrome/browser/extensions/updater/extension_cache_impl.cc b/chrome/browser/extensions/updater/extension_cache_impl.cc |
index a6300b8214294a8e46b9c1a1d1160a81b718f698..a9afe4ba9f75b5f40ecc55a2ee84f5fc39bea93c 100644 |
--- a/chrome/browser/extensions/updater/extension_cache_impl.cc |
+++ b/chrome/browser/extensions/updater/extension_cache_impl.cc |
@@ -13,6 +13,7 @@ |
#include "chrome/browser/chrome_notification_types.h" |
#include "chrome/browser/extensions/crx_installer.h" |
#include "chrome/browser/extensions/updater/local_extension_cache.h" |
+#include "chrome/common/extensions/extension_constants.h" |
#include "content/public/browser/browser_thread.h" |
#include "content/public/browser/notification_details.h" |
#include "content/public/browser/notification_service.h" |
@@ -72,13 +73,17 @@ void ExtensionCacheImpl::Shutdown(const base::Closure& callback) { |
} |
void ExtensionCacheImpl::AllowCaching(const std::string& id) { |
+ // Temporary workaround for M41, this extension should not be cached. |
+ // TODO(ginkage): Implement id/hash-based map instead of id/version. |
+ if (id == extension_misc::kHotwordSharedModuleId) |
+ return; |
allowed_extensions_.insert(id); |
} |
bool ExtensionCacheImpl::GetExtension(const std::string& id, |
base::FilePath* file_path, |
std::string* version) { |
- if (cache_) |
+ if (cache_ && CachingAllowed(id)) |
return cache_->GetExtension(id, file_path, version); |
else |
return false; |
@@ -88,12 +93,17 @@ void ExtensionCacheImpl::PutExtension(const std::string& id, |
const base::FilePath& file_path, |
const std::string& version, |
const PutExtensionCallback& callback) { |
- if (cache_ && ContainsKey(allowed_extensions_, id)) |
+ if (cache_ && CachingAllowed(id)) |
cache_->PutExtension(id, file_path, version, callback); |
else |
callback.Run(file_path, true); |
} |
+bool ExtensionCacheImpl::CachingAllowed(const std::string& id) { |
+ return ContainsKey(allowed_extensions_, id) && |
+ id != extension_misc::kHotwordSharedModuleId; |
+} |
+ |
void ExtensionCacheImpl::OnCacheInitialized() { |
for (std::vector<base::Closure>::iterator it = init_callbacks_.begin(); |
it != init_callbacks_.end(); ++it) { |