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

Unified Diff: chrome/browser/plugin_service.cc

Issue 88020: Allow Flash (and other plugins) to be installed without restarting the browse... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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
« no previous file with comments | « chrome/browser/plugin_service.h ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugin_service.cc
===================================================================
--- chrome/browser/plugin_service.cc (revision 14070)
+++ chrome/browser/plugin_service.cc (working copy)
@@ -8,15 +8,17 @@
#include "base/command_line.h"
#include "base/thread.h"
+#include "base/waitable_event.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_plugin_host.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/plugin_process_host.h"
#include "chrome/browser/renderer_host/render_process_host.h"
-#include "chrome/browser/renderer_host/resource_message_filter.h"
#include "chrome/common/chrome_plugin_lib.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/logging_chrome.h"
+#include "chrome/common/render_messages.h"
+#include "webkit/glue/plugins/plugin_constants_win.h"
#include "webkit/glue/plugins/plugin_list.h"
// static
@@ -35,9 +37,32 @@
std::wstring path = command_line->GetSwitchValue(switches::kLoadPlugin);
if (!path.empty())
NPAPI::PluginList::AddExtraPluginPath(FilePath::FromWStringHack(path));
+
+#if defined(OS_WIN)
+ hkcu_key_.Create(
+ HKEY_CURRENT_USER, kRegistryMozillaPlugins, KEY_NOTIFY);
+ hklm_key_.Create(
+ HKEY_LOCAL_MACHINE, kRegistryMozillaPlugins, KEY_NOTIFY);
+ if (hkcu_key_.StartWatching()) {
+ hkcu_event_.reset(new base::WaitableEvent(hkcu_key_.watch_event()));
+ hkcu_watcher_.StartWatching(hkcu_event_.get(), this);
+ }
+
+ if (hklm_key_.StartWatching()) {
+ hklm_event_.reset(new base::WaitableEvent(hklm_key_.watch_event()));
+ hklm_watcher_.StartWatching(hklm_event_.get(), this);
+ }
+#endif
}
PluginService::~PluginService() {
+#if defined(OS_WIN)
+ // Release the events since they're owned by RegKey, not WaitableEvent.
+ hkcu_watcher_.StopWatching();
+ hklm_watcher_.StopWatching();
+ hkcu_event_->Release();
+ hklm_event_->Release();
+#endif
}
void PluginService::GetPlugins(bool refresh,
@@ -171,3 +196,21 @@
allow_wildcard, &info,
NULL);
}
+
+void PluginService::OnWaitableEventSignaled(base::WaitableEvent* waitable_event) {
+#if defined(OS_WIN)
+ if (waitable_event == hkcu_event_.get()) {
+ hkcu_key_.StartWatching();
+ } else {
+ hklm_key_.StartWatching();
+ }
+
+ AutoLock lock(lock_);
+ NPAPI::PluginList::ResetPluginsLoaded();
+
+ for (RenderProcessHost::iterator it = RenderProcessHost::begin();
+ it != RenderProcessHost::end(); ++it) {
+ it->second->Send(new ViewMsg_PurgePluginListCache());
+ }
+#endif
+}
« no previous file with comments | « chrome/browser/plugin_service.h ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698