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

Unified Diff: content/browser/renderer_host/render_message_filter.cc

Issue 7980011: Convert the PluginService interface to be an async wrapper around PluginList. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ready for review Created 9 years, 3 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: 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..60bf9f6dc324f080521186303705f4ec4bc26501 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"
@@ -338,7 +337,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 +512,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 +525,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::OnGetPluginsSendReply, this, reply_msg));
+}
+
+void RenderMessageFilter::OnGetPluginsSendReply(
+ IPC::Message* reply_msg,
+ std::vector<webkit::WebPluginInfo> plugins) {
+ ViewHostMsg_GetPlugins::WriteReplyParams(reply_msg, plugins);
+ Send(reply_msg);
}
void RenderMessageFilter::OnGetPluginInfo(

Powered by Google App Engine
This is Rietveld 408576698