| Index: content/browser/renderer_host/render_message_filter.cc
|
| diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc
|
| index d64b464b87c0e5fb32db95a8823c6b00b9df33cd..50227da70017424143f04dfee90c4d5ee9f84aea 100644
|
| --- a/content/browser/renderer_host/render_message_filter.cc
|
| +++ b/content/browser/renderer_host/render_message_filter.cc
|
| @@ -51,7 +51,6 @@
|
| #include "webkit/glue/webcookie.h"
|
| #include "webkit/glue/webkit_glue.h"
|
| #include "webkit/plugins/npapi/plugin_group.h"
|
| -#include "webkit/plugins/npapi/plugin_list.h"
|
| #include "webkit/plugins/npapi/webplugin.h"
|
| #include "webkit/plugins/webplugininfo.h"
|
|
|
| @@ -295,8 +294,6 @@ void RenderMessageFilter::OnChannelError() {
|
| void RenderMessageFilter::OverrideThreadForMessage(const IPC::Message& message,
|
| BrowserThread::ID* thread) {
|
| switch (message.type()) {
|
| - // Can't load plugins on IO thread.
|
| - case ViewHostMsg_GetPlugins::ID:
|
| // The PluginService::GetPluginInfo may need to load the plugins. Don't do
|
| // it on the IO thread.
|
| case ViewHostMsg_GetPluginInfo::ID:
|
| @@ -338,7 +335,7 @@ bool RenderMessageFilter::OnMessageReceived(const IPC::Message& message,
|
| #if defined(OS_MACOSX)
|
| IPC_MESSAGE_HANDLER(ViewHostMsg_LoadFont, OnLoadFont)
|
| #endif
|
| - IPC_MESSAGE_HANDLER(ViewHostMsg_GetPlugins, OnGetPlugins)
|
| + IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_GetPlugins, OnGetPlugins)
|
| IPC_MESSAGE_HANDLER(ViewHostMsg_GetPluginInfo, OnGetPluginInfo)
|
| IPC_MESSAGE_HANDLER(ViewHostMsg_DownloadUrl, OnDownloadUrl)
|
| IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_OpenChannelToPlugin,
|
| @@ -513,7 +510,7 @@ void RenderMessageFilter::OnReleaseCachedFonts() {
|
|
|
| void RenderMessageFilter::OnGetPlugins(
|
| bool refresh,
|
| - std::vector<webkit::WebPluginInfo>* plugins) {
|
| + IPC::Message* reply_msg) {
|
| // Don't refresh if the specified threshold has not been passed. Note that
|
| // this check is performed before off-loading to the file thread. The reason
|
| // we do this is that some pages tend to request that the list of plugins be
|
| @@ -526,13 +523,20 @@ void RenderMessageFilter::OnGetPlugins(
|
| const base::TimeTicks now = base::TimeTicks::Now();
|
| if (now - last_plugin_refresh_time_ >= threshold) {
|
| // Only refresh if the threshold hasn't been exceeded yet.
|
| - webkit::npapi::PluginList::Singleton()->RefreshPlugins();
|
| + PluginService::GetInstance()->RefreshPluginList();
|
| last_plugin_refresh_time_ = now;
|
| }
|
| }
|
|
|
| PluginService::GetInstance()->GetPlugins(resource_context_,
|
| - plugins);
|
| + base::Bind(&RenderMessageFilter::OnGetPluginsCallback, this, reply_msg));
|
| +}
|
| +
|
| +void RenderMessageFilter::OnGetPluginsCallback(
|
| + IPC::Message* reply_msg,
|
| + const std::vector<webkit::WebPluginInfo>& plugins) {
|
| + ViewHostMsg_GetPlugins::WriteReplyParams(reply_msg, plugins);
|
| + Send(reply_msg);
|
| }
|
|
|
| void RenderMessageFilter::OnGetPluginInfo(
|
|
|