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

Unified Diff: chrome/browser/renderer_host/resource_message_filter.cc

Issue 164305: Ensure we don't load plugins on the IO thread (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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/renderer_host/resource_message_filter.h ('k') | chrome/common/chrome_plugin_lib.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/resource_message_filter.cc
===================================================================
--- chrome/browser/renderer_host/resource_message_filter.cc (revision 23449)
+++ chrome/browser/renderer_host/resource_message_filter.cc (working copy)
@@ -44,6 +44,7 @@
#include "net/http/http_cache.h"
#include "net/http/http_transaction_factory.h"
#include "net/url_request/url_request_context.h"
+#include "webkit/glue/plugins/plugin_list.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webplugin.h"
@@ -282,13 +283,12 @@
IPC_MESSAGE_HANDLER(ViewHostMsg_CreateWidget, OnMsgCreateWidget)
IPC_MESSAGE_HANDLER(ViewHostMsg_SetCookie, OnSetCookie)
IPC_MESSAGE_HANDLER(ViewHostMsg_GetCookies, OnGetCookies)
- IPC_MESSAGE_HANDLER(ViewHostMsg_GetDataDir, OnGetDataDir)
IPC_MESSAGE_HANDLER(ViewHostMsg_PluginMessage, OnPluginMessage)
IPC_MESSAGE_HANDLER(ViewHostMsg_PluginSyncMessage, OnPluginSyncMessage)
#if defined(OS_WIN) // This hack is Windows-specific.
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_GetPluginPath, OnGetPluginPath)
IPC_MESSAGE_HANDLER(ViewHostMsg_DownloadUrl, OnDownloadUrl)
IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_ContextMenu,
@@ -463,10 +463,6 @@
*cookies = context->cookie_store()->GetCookies(url);
}
-void ResourceMessageFilter::OnGetDataDir(std::wstring* data_dir) {
- *data_dir = plugin_service_->GetChromePluginDataDir().ToWStringHack();
-}
-
void ResourceMessageFilter::OnPluginMessage(const FilePath& plugin_path,
const std::vector<uint8>& data) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
@@ -545,10 +541,22 @@
#endif
void ResourceMessageFilter::OnGetPlugins(bool refresh,
- std::vector<WebPluginInfo>* plugins) {
- plugin_service_->GetPlugins(refresh, plugins);
+ IPC::Message* reply_msg) {
+ ChromeThread::GetMessageLoop(ChromeThread::FILE)->PostTask(FROM_HERE,
+ NewRunnableMethod(this, &ResourceMessageFilter::OnGetPluginsOnFileThread,
+ refresh, reply_msg));
}
+void ResourceMessageFilter::OnGetPluginsOnFileThread(bool refresh,
+ IPC::Message* reply_msg) {
+ std::vector<WebPluginInfo> plugins;
+ NPAPI::PluginList::Singleton()->GetPlugins(refresh, &plugins);
+
+ ViewHostMsg_GetPlugins::WriteReplyParams(reply_msg, plugins);
+ ChromeThread::GetMessageLoop(ChromeThread::IO)->PostTask(FROM_HERE,
+ NewRunnableMethod(this, &ResourceMessageFilter::Send, reply_msg));
+}
+
void ResourceMessageFilter::OnGetPluginPath(const GURL& url,
const GURL& policy_url,
const std::string& mime_type,
« no previous file with comments | « chrome/browser/renderer_host/resource_message_filter.h ('k') | chrome/common/chrome_plugin_lib.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698