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

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 10579028: Revert 142427 - Cleaning Up Extensions When Local Content Removed (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_service.cc
===================================================================
--- chrome/browser/extensions/extension_service.cc (revision 143046)
+++ chrome/browser/extensions/extension_service.cc (working copy)
@@ -119,6 +119,7 @@
#include "chrome/browser/chromeos/extensions/input_method_event_router.h"
#include "chrome/browser/chromeos/extensions/media_player_event_router.h"
#include "chrome/browser/chromeos/input_method/input_method_manager.h"
+#include "chrome/browser/extensions/extension_input_ime_api.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_mount_point_provider.h"
#endif
@@ -324,8 +325,6 @@
: profile_(profile),
system_(ExtensionSystem::Get(profile)),
extension_prefs_(extension_prefs),
- extension_garbage_collector_(
- new extensions::ExtensionGarbageCollector(this)),
settings_frontend_(extensions::SettingsFrontend::Create(profile)),
pending_extension_manager_(*ALLOW_THIS_IN_INITIALIZER_LIST(this)),
install_directory_(install_directory),
@@ -1847,8 +1846,24 @@
}
void ExtensionService::GarbageCollectExtensions() {
- extension_garbage_collector_->GarbageCollectExtensions();
+ if (extension_prefs_->pref_service()->ReadOnly())
+ return;
+ scoped_ptr<ExtensionPrefs::ExtensionsInfo> info(
+ extension_prefs_->GetInstalledExtensionsInfo());
+
+ std::map<std::string, FilePath> extension_paths;
+ for (size_t i = 0; i < info->size(); ++i)
+ extension_paths[info->at(i)->extension_id] = info->at(i)->extension_path;
+
+ if (!BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
+ base::Bind(
+ &extension_file_util::GarbageCollectExtensions,
+ install_directory_,
+ extension_paths)))
+ NOTREACHED();
+
// Also garbage-collect themes. We check |profile_| to be
// defensive; in the future, we may call GarbageCollectExtensions()
// from somewhere other than Init() (e.g., in a timer).
@@ -2013,7 +2028,7 @@
// Other than for unpacked extensions, CrxInstaller should have guaranteed
// that we aren't downgrading.
if (extension->location() != Extension::LOAD)
- CHECK_GE(extension->version()->CompareTo(*(old->version())), 0);
+ CHECK(extension->version()->CompareTo(*(old->version())) >= 0);
// Extensions get upgraded if the privileges are allowed to increase or
// the privileges haven't increased.
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698