summaryrefslogtreecommitdiffstats
path: root/chrome/browser/plugin_updater.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-27 19:25:43 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-27 19:25:43 +0000
commit41a9a3dea5aa4f42d4113faa3cd805b98499ab04 (patch)
tree5eed7081c929fdcc871350aa6d425a11c1d5c066 /chrome/browser/plugin_updater.cc
parent346a7a322b270e535aa5c9b51d9b38f5a0d3333f (diff)
downloadchromium_src-41a9a3dea5aa4f42d4113faa3cd805b98499ab04.zip
chromium_src-41a9a3dea5aa4f42d4113faa3cd805b98499ab04.tar.gz
chromium_src-41a9a3dea5aa4f42d4113faa3cd805b98499ab04.tar.bz2
Don't load the plugins right away when saving the plugin preferences, so that we don't slow down startup.
BUG=60942 Review URL: http://codereview.chromium.org/4145006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64115 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_updater.cc')
-rw-r--r--chrome/browser/plugin_updater.cc16
1 files changed, 12 insertions, 4 deletions
diff --git a/chrome/browser/plugin_updater.cc b/chrome/browser/plugin_updater.cc
index e969da6..d560b3e5 100644
--- a/chrome/browser/plugin_updater.cc
+++ b/chrome/browser/plugin_updater.cc
@@ -24,6 +24,10 @@
#include "chrome/common/pref_names.h"
#include "webkit/glue/plugins/webplugininfo.h"
+// How long to wait to save the plugin enabled information, which might need to
+// go to disk.
+#define kPluginUpdateDelayMs (60 * 1000)
+
PluginUpdater::PluginUpdater()
: enable_internal_pdf_(true),
notify_pending_(false) {
@@ -213,16 +217,20 @@ void PluginUpdater::DisablePluginGroupsFromPrefs(Profile* profile) {
// See http://crbug.com/50105 for background.
EnablePluginGroup(false, ASCIIToUTF16(PluginGroup::kAdobeReader8GroupName));
EnablePluginGroup(false, ASCIIToUTF16(PluginGroup::kAdobeReader9GroupName));
- UpdatePreferences(profile);
+
+ // We want to save this, but doing so requires loading the list of plugins,
+ // so do it after a minute as to not impact startup performance. Note that
+ // plugins are loaded after 30s by the metrics service.
+ UpdatePreferences(profile, kPluginUpdateDelayMs);
}
}
-void PluginUpdater::UpdatePreferences(Profile* profile) {
- BrowserThread::PostTask(
+void PluginUpdater::UpdatePreferences(Profile* profile, int delay_ms) {
+ BrowserThread::PostDelayedTask(
BrowserThread::FILE,
FROM_HERE,
NewRunnableFunction(
- &PluginUpdater::GetPreferencesDataOnFileThread, profile));
+ &PluginUpdater::GetPreferencesDataOnFileThread, profile), delay_ms);
}
void PluginUpdater::GetPreferencesDataOnFileThread(void* profile) {