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

Side by Side Diff: content/renderer/browser_plugin/browser_plugin_manager.h

Issue 10735010: 3D Compositing in <browser>, first draft. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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 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 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_ 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_
6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_ 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/id_map.h" 9 #include "base/id_map.h"
10 #include "content/public/renderer/render_process_observer.h" 10 #include "content/public/renderer/render_process_observer.h"
11 #include "content/renderer/browser_plugin/browser_plugin.h" 11 #include "content/renderer/browser_plugin/browser_plugin.h"
12 12
13 struct BrowserPlugin_SwapInfo;
13 struct BrowserPluginMsg_UpdateRect_Params; 14 struct BrowserPluginMsg_UpdateRect_Params;
14 15
15 namespace WebKit { 16 namespace WebKit {
16 class WebPluginParams; 17 struct WebPluginParams;
17 } 18 }
18 19
19 namespace content { 20 namespace content {
20 namespace browser_plugin { 21 namespace browser_plugin {
21 22
22 // BrowserPluginManager manages the routing of messages to the appropriate 23 // BrowserPluginManager manages the routing of messages to the appropriate
23 // BrowserPlugin object. 24 // BrowserPlugin object.
24 class BrowserPluginManager 25 class BrowserPluginManager
25 : public RenderProcessObserver { 26 : public RenderProcessObserver {
26 public: 27 public:
27 BrowserPluginManager(); 28 BrowserPluginManager();
28 29
29 virtual ~BrowserPluginManager(); 30 virtual ~BrowserPluginManager();
30 31
31 BrowserPlugin* CreateBrowserPlugin(RenderViewImpl* render_view, 32 BrowserPlugin* CreateBrowserPlugin(RenderViewImpl* render_view,
32 WebKit::WebFrame* frame, 33 WebKit::WebFrame* frame,
33 const WebKit::WebPluginParams& params); 34 const WebKit::WebPluginParams& params);
34 35
35 void AddBrowserPlugin(int instance_id, BrowserPlugin* browser_plugin); 36 void AddBrowserPlugin(int instance_id, BrowserPlugin* browser_plugin);
36 void RemoveBrowserPlugin(int instance_id); 37 void RemoveBrowserPlugin(int instance_id);
37 BrowserPlugin* GetBrowserPlugin(int instance_id) const; 38 BrowserPlugin* GetBrowserPlugin(int instance_id) const;
38 39
40 void WillInitiatePaint();
41
39 private: 42 private:
40 int browser_plugin_counter_; 43 int browser_plugin_counter_;
41 IDMap<BrowserPlugin> instances_; 44 IDMap<BrowserPlugin> instances_;
42 45
43 void OnUpdateRect(int instance_id, 46 void OnUpdateRect(int instance_id,
44 int message_id, 47 int message_id,
45 const BrowserPluginMsg_UpdateRect_Params& params); 48 const BrowserPluginMsg_UpdateRect_Params& params);
46 void OnGuestCrashed(int instance_id); 49 void OnGuestCrashed(int instance_id);
47 void OnUpdateURL(int instance_id, const GURL& url); 50 void OnUpdateURL(int instance_id, const GURL& url);
48 void OnAdvanceFocus(int instance_id, bool reverse); 51 void OnAdvanceFocus(int instance_id, bool reverse);
52 void OnBuffersSwapped(int instance_id, uint64 surface_handle, const BrowserPlu gin_SwapInfo& info);
49 53
50 // RenderProcessObserver override. Call on render thread. 54 // RenderProcessObserver override. Call on render thread.
51 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; 55 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
52 56
53 DISALLOW_COPY_AND_ASSIGN(BrowserPluginManager); 57 DISALLOW_COPY_AND_ASSIGN(BrowserPluginManager);
54 }; 58 };
55 59
56 } // namespace browser_plugin 60 } // namespace browser_plugin
57 } // namespace content 61 } // namespace content
58 62
59 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_CHANNEL_MANAGER_H_ 63 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_CHANNEL_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698