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

Side by Side Diff: content/browser/plugin_service_impl.h

Issue 645203002: Block NPAPI plugins by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missing test file Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This class responds to requests from renderers for the list of plugins, and 5 // This class responds to requests from renderers for the list of plugins, and
6 // also a proxy object for plugin instances. 6 // also a proxy object for plugin instances.
7 7
8 #ifndef CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ 8 #ifndef CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_
9 #define CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ 9 #define CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_
10 10
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 virtual void RefreshPlugins() override; 101 virtual void RefreshPlugins() override;
102 virtual void AddExtraPluginPath(const base::FilePath& path) override; 102 virtual void AddExtraPluginPath(const base::FilePath& path) override;
103 virtual void RemoveExtraPluginPath(const base::FilePath& path) override; 103 virtual void RemoveExtraPluginPath(const base::FilePath& path) override;
104 virtual void AddExtraPluginDir(const base::FilePath& path) override; 104 virtual void AddExtraPluginDir(const base::FilePath& path) override;
105 virtual void RegisterInternalPlugin( 105 virtual void RegisterInternalPlugin(
106 const WebPluginInfo& info, bool add_at_beginning) override; 106 const WebPluginInfo& info, bool add_at_beginning) override;
107 virtual void UnregisterInternalPlugin(const base::FilePath& path) override; 107 virtual void UnregisterInternalPlugin(const base::FilePath& path) override;
108 virtual void GetInternalPlugins( 108 virtual void GetInternalPlugins(
109 std::vector<WebPluginInfo>* plugins) override; 109 std::vector<WebPluginInfo>* plugins) override;
110 virtual bool NPAPIPluginsSupported() override; 110 virtual bool NPAPIPluginsSupported() override;
111 #if defined(OS_WIN) || defined(OS_MACOSX)
jam 2014/10/16 22:10:57 do we really need these ifdefs everywhere? why not
Will Harris 2014/10/17 18:57:08 Done.
112 virtual void EnableNpapiPluginsForTesting() override;
113 #endif
111 virtual void DisablePluginsDiscoveryForTesting() override; 114 virtual void DisablePluginsDiscoveryForTesting() override;
112 #if defined(OS_MACOSX) 115 #if defined(OS_MACOSX)
113 virtual void AppActivated() override; 116 virtual void AppActivated() override;
114 #elif defined(OS_WIN) 117 #elif defined(OS_WIN)
115 virtual bool GetPluginInfoFromWindow(HWND window, 118 virtual bool GetPluginInfoFromWindow(HWND window,
116 base::string16* plugin_name, 119 base::string16* plugin_name,
117 base::string16* plugin_version) override; 120 base::string16* plugin_version) override;
118 121
119 // Returns true iff the given HWND is a plugin. 122 // Returns true iff the given HWND is a plugin.
120 bool IsPluginWindow(HWND window); 123 bool IsPluginWindow(HWND window);
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 #if defined(OS_WIN) 226 #if defined(OS_WIN)
224 // Registry keys for getting notifications when new plugins are installed. 227 // Registry keys for getting notifications when new plugins are installed.
225 base::win::RegKey hkcu_key_; 228 base::win::RegKey hkcu_key_;
226 base::win::RegKey hklm_key_; 229 base::win::RegKey hklm_key_;
227 scoped_ptr<base::WaitableEvent> hkcu_event_; 230 scoped_ptr<base::WaitableEvent> hkcu_event_;
228 scoped_ptr<base::WaitableEvent> hklm_event_; 231 scoped_ptr<base::WaitableEvent> hklm_event_;
229 base::WaitableEventWatcher hkcu_watcher_; 232 base::WaitableEventWatcher hkcu_watcher_;
230 base::WaitableEventWatcher hklm_watcher_; 233 base::WaitableEventWatcher hklm_watcher_;
231 #endif 234 #endif
232 235
236 #if defined(OS_WIN) || defined(OS_MACOSX)
237 bool npapi_plugins_enabled_;
238 #endif
239
233 #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) 240 #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID)
234 ScopedVector<base::FilePathWatcher> file_watchers_; 241 ScopedVector<base::FilePathWatcher> file_watchers_;
235 #endif 242 #endif
236 243
237 std::vector<PepperPluginInfo> ppapi_plugins_; 244 std::vector<PepperPluginInfo> ppapi_plugins_;
238 245
239 // Weak pointer; outlives us. 246 // Weak pointer; outlives us.
240 PluginServiceFilter* filter_; 247 PluginServiceFilter* filter_;
241 248
242 std::set<PluginProcessHost::Client*> pending_plugin_clients_; 249 std::set<PluginProcessHost::Client*> pending_plugin_clients_;
243 250
244 // Used to sequentialize loading plug-ins from disk. 251 // Used to sequentialize loading plug-ins from disk.
245 base::SequencedWorkerPool::SequenceToken plugin_list_token_; 252 base::SequencedWorkerPool::SequenceToken plugin_list_token_;
246 253
247 #if defined(OS_POSIX) 254 #if defined(OS_POSIX)
248 scoped_refptr<PluginLoaderPosix> plugin_loader_; 255 scoped_refptr<PluginLoaderPosix> plugin_loader_;
249 #endif 256 #endif
250 257
251 // Used to detect if a given plug-in is crashing over and over. 258 // Used to detect if a given plug-in is crashing over and over.
252 std::map<base::FilePath, std::vector<base::Time> > crash_times_; 259 std::map<base::FilePath, std::vector<base::Time> > crash_times_;
253 260
254 DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl); 261 DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl);
255 }; 262 };
256 263
257 } // namespace content 264 } // namespace content
258 265
259 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ 266 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698