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

Unified Diff: chrome/browser/plugin_service.h

Issue 6259008: When we detect a PDF with an unsupported feature, ask the user if they want t... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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_data_remover.cc ('k') | chrome/browser/plugin_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugin_service.h
===================================================================
--- chrome/browser/plugin_service.h (revision 71882)
+++ chrome/browser/plugin_service.h (working copy)
@@ -16,6 +16,7 @@
#include "base/hash_tables.h"
#include "base/scoped_vector.h"
#include "base/singleton.h"
+#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event_watcher.h"
#include "build/build_config.h"
#include "chrome/browser/plugin_process_host.h"
@@ -23,6 +24,7 @@
#include "chrome/common/notification_registrar.h"
#include "googleurl/src/gurl.h"
#include "ipc/ipc_channel_handle.h"
+#include "webkit/plugins/npapi/webplugininfo.h"
#if defined(OS_WIN)
#include "base/scoped_ptr.h"
@@ -52,18 +54,19 @@
class URLRequestContext;
} // namespace net
-namespace webkit {
-namespace npapi {
-struct WebPluginInfo;
-}
-}
-
// This must be created on the main thread but it's only called on the IO/file
// thread.
class PluginService
: public base::WaitableEventWatcher::Delegate,
public NotificationObserver {
public:
+ struct OverriddenPlugin {
+ int render_process_id;
+ int render_view_id;
+ GURL url;
+ webkit::npapi::WebPluginInfo plugin;
+ };
+
// Initializes the global instance; should be called on startup from the main
// thread.
static void InitGlobalInstance(Profile* profile);
@@ -97,13 +100,17 @@
// Opens a channel to a plugin process for the given mime type, starting
// a new plugin process if necessary. This must be called on the IO thread
// or else a deadlock can occur.
- void OpenChannelToPlugin(const GURL& url,
+ void OpenChannelToPlugin(int render_process_id,
+ int render_view_id,
+ const GURL& url,
const std::string& mime_type,
PluginProcessHost::Client* client);
// Gets the first allowed plugin in the list of plugins that matches
// the given url and mime type. Must be called on the FILE thread.
- bool GetFirstAllowedPluginInfo(const GURL& url,
+ bool GetFirstAllowedPluginInfo(int render_process_id,
+ int render_view_id,
+ const GURL& url,
const std::string& mime_type,
webkit::npapi::WebPluginInfo* info,
std::string* actual_mime_type);
@@ -112,6 +119,9 @@
// the given URL.
bool PrivatePluginAllowedForURL(const FilePath& plugin_path, const GURL& url);
+ // Safe to be called from any thread.
+ void OverridePluginForTab(OverriddenPlugin plugin);
+
// The UI thread's message loop
MessageLoop* main_message_loop() { return main_message_loop_; }
@@ -140,6 +150,8 @@
// Helper so we can do the plugin lookup on the FILE thread.
void GetAllowedPluginForOpenChannelToPlugin(
+ int render_process_id,
+ int render_view_id,
const GURL& url,
const std::string& mime_type,
PluginProcessHost::Client* client);
@@ -203,6 +215,9 @@
// Set to true if chrome plugins are enabled. Defaults to true.
static bool enable_chrome_plugins_;
+ std::vector<OverriddenPlugin> overridden_plugins_;
+ base::Lock overridden_plugins_lock_;
+
DISALLOW_COPY_AND_ASSIGN(PluginService);
};
« no previous file with comments | « chrome/browser/plugin_data_remover.cc ('k') | chrome/browser/plugin_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698