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

Unified Diff: content/browser/plugin_service_impl.cc

Issue 10014013: Add a hang monitor for Pepper plugins (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix leak Created 8 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
Index: content/browser/plugin_service_impl.cc
diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc
index 789d254d9d7ee0af8f02870fe75367c730ba6295..d4d9871cc62eb5bd0e413c7d70c0d597f4a6358e 100644
--- a/content/browser/plugin_service_impl.cc
+++ b/content/browser/plugin_service_impl.cc
@@ -347,7 +347,7 @@ void PluginServiceImpl::OpenChannelToPpapiPlugin(
if (plugin_host)
plugin_host->OpenChannelToPlugin(client);
else // Send error.
- client->OnChannelOpened(base::kNullProcessHandle, IPC::ChannelHandle());
+ client->OnChannelOpened(base::kNullProcessHandle, IPC::ChannelHandle(), 0);
}
void PluginServiceImpl::OpenChannelToPpapiBroker(
@@ -357,7 +357,7 @@ void PluginServiceImpl::OpenChannelToPpapiBroker(
if (plugin_host)
plugin_host->OpenChannelToPlugin(client);
else // Send error.
- client->OnChannelOpened(base::kNullProcessHandle, IPC::ChannelHandle());
+ client->OnChannelOpened(base::kNullProcessHandle, IPC::ChannelHandle(), 0);
}
void PluginServiceImpl::CancelOpenChannelToNpapiPlugin(
@@ -484,6 +484,23 @@ bool PluginServiceImpl::GetPluginInfoByPath(const FilePath& plugin_path,
return false;
}
+string16 PluginServiceImpl::GetPluginDisplayNameByPath(const FilePath& path) {
+ string16 plugin_name = path.LossyDisplayName();
+ webkit::WebPluginInfo info;
+ if (PluginService::GetInstance()->GetPluginInfoByPath(path, &info) &&
+ !info.name.empty()) {
+ plugin_name = info.name;
+#if defined(OS_MACOSX)
+ // Many plugins on the Mac have .plugin in the actual name, which looks
+ // terrible, so look for that and strip it off if present.
+ const std::string kPluginExtension = ".plugin";
+ if (EndsWith(plugin_name, ASCIIToUTF16(kPluginExtension), true))
+ plugin_name.erase(plugin_name.length() - kPluginExtension.length());
+#endif // OS_MACOSX
+ }
+ return plugin_name;
+}
+
void PluginServiceImpl::GetPlugins(const GetPluginsCallback& callback) {
scoped_refptr<base::MessageLoopProxy> target_loop(
MessageLoop::current()->message_loop_proxy());

Powered by Google App Engine
This is Rietveld 408576698