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

Unified Diff: content/renderer/browser_plugin/browser_plugin_manager.h

Issue 10830072: Browser Plugin: New Implementation (Renderer Side) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed leaky Persistents in BrowserPlugin Created 8 years, 5 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/renderer/browser_plugin/browser_plugin_manager.h
diff --git a/content/renderer/browser_plugin/browser_plugin_manager.h b/content/renderer/browser_plugin/browser_plugin_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..04c1115b30d5df001f21cda14eefd72da589360b
--- /dev/null
+++ b/content/renderer/browser_plugin/browser_plugin_manager.h
@@ -0,0 +1,54 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_
+#define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_
+
+#include "base/id_map.h"
+#include "content/public/renderer/render_process_observer.h"
+#include "ipc/ipc_sender.h"
+
+class RenderViewImpl;
+
+namespace WebKit {
+class WebFrame;
+struct WebPluginParams;
+}
+
+namespace content {
+namespace browser_plugin {
+
+class BrowserPlugin;
+
+// BrowserPluginManager manages the routing of messages to the appropriate
+// BrowserPlugin object based on its instance ID. There is only one
+// BrowserPluginManager per renderer process, and it should only be accessed
+// by the render thread.
Charlie Reis 2012/08/01 23:20:51 Can we enforce this, using something like ThreadCh
Fady Samuel 2012/08/02 18:32:47 Done.
+class CONTENT_EXPORT BrowserPluginManager : public IPC::Sender,
+ public RenderProcessObserver {
+ public:
+ // Returns the one BrowserPluginManager for this process.
+ static BrowserPluginManager* Get();
+
+ BrowserPluginManager();
+ virtual ~BrowserPluginManager();
+
+ virtual BrowserPlugin* CreateBrowserPlugin(
Charlie Reis 2012/08/01 23:20:51 It's not clear from here that the created BrowserP
Fady Samuel 2012/08/02 18:32:47 Done.
+ RenderViewImpl* render_view,
+ WebKit::WebFrame* frame,
+ const WebKit::WebPluginParams& params) = 0;
+
+ void AddBrowserPlugin(int instance_id, BrowserPlugin* browser_plugin);
+ void RemoveBrowserPlugin(int instance_id);
+ BrowserPlugin* GetBrowserPlugin(int instance_id) const;
+
+ protected:
+ IDMap<BrowserPlugin> instances_;
+ int browser_plugin_counter_;
+};
+
+} // namespace browser_plugin
+} // namespace content
+
+#endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698