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

Side by Side Diff: content/browser/browser_plugin/browser_plugin_host_helper.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_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_HOST_HELPER_H__ 5 #ifndef CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_HOST_HELPER_H__
6 #define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_HOST_HELPER_H__ 6 #define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_HOST_HELPER_H__
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "content/common/browser_plugin_info.h"
12 #include "content/public/browser/render_view_host_observer.h" 13 #include "content/public/browser/render_view_host_observer.h"
13 #include "ipc/ipc_channel_handle.h" 14 #include "ipc/ipc_channel_handle.h"
14 #include "ipc/ipc_sync_message.h" 15 #include "ipc/ipc_sync_message.h"
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
16 #include "ui/surface/transport_dib.h" 17 #include "ui/surface/transport_dib.h"
17 18
18 namespace gfx { 19 namespace gfx {
19 class Size; 20 class Size;
20 } 21 }
21 22
23 struct BrowserPlugin_SwapInfo;
22 struct ViewHostMsg_UpdateRect_Params; 24 struct ViewHostMsg_UpdateRect_Params;
23 25
24 namespace content { 26 namespace content {
25 namespace browser_plugin { 27 namespace browser_plugin {
26 28
27 class BrowserPluginHost; 29 class BrowserPluginHost;
28 30
29 // This class acts as a plumber helper for BrowserPluginHost. A lot 31 // This class acts as a plumber helper for BrowserPluginHost. A lot
30 // of messages coming from guests need to know the guest's RenderViewHost. 32 // of messages coming from guests need to know the guest's RenderViewHost.
31 // BrowserPluginHostHelper handles BrowserPluginHost messages and relays 33 // BrowserPluginHostHelper handles BrowserPluginHost messages and relays
32 // them with their associated RenderViewHosts to BrowserPluginHost where they 34 // them with their associated RenderViewHosts to BrowserPluginHost where they
33 // will be handled. 35 // will be handled.
34 class BrowserPluginHostHelper : public RenderViewHostObserver { 36 class BrowserPluginHostHelper : public RenderViewHostObserver {
35 public: 37 public:
36 BrowserPluginHostHelper(BrowserPluginHost* browser_plugin_host, 38 BrowserPluginHostHelper(BrowserPluginHost* browser_plugin_host,
37 RenderViewHost* render_view_host); 39 RenderViewHost* render_view_host,
40 const BrowserPluginHostMsg_Surface_Params& params);
38 virtual ~BrowserPluginHostHelper(); 41 virtual ~BrowserPluginHostHelper();
39 42
40 // Make it public for sync IPCs. 43 // Make it public for sync IPCs.
41 virtual bool Send(IPC::Message* message) OVERRIDE; 44 virtual bool Send(IPC::Message* message) OVERRIDE;
42 private: 45 private:
43 void OnNavigateGuestFromEmbedder(int container_instance_id, 46 void OnNavigateGuestFromEmbedder(int container_instance_id,
44 long long frame_id, 47 long long frame_id,
45 const std::string& src); 48 const std::string& src,
49 const BrowserPluginHostMsg_Surface_Params& pa rams);
46 void OnResizeGuest(int instance_id, 50 void OnResizeGuest(int instance_id,
47 const TransportDIB::Id& damage_buffer_id, 51 const TransportDIB::Id& damage_buffer_id,
48 int width, 52 int width,
49 int height); 53 int height);
50 54
51
52 void OnUpdateRectACK(int instance_id, int message_id); 55 void OnUpdateRectACK(int instance_id, int message_id);
53 56
54 void OnHandleInputEvent(const IPC::SyncMessage& message); 57 void OnHandleInputEvent(const IPC::SyncMessage& message);
55 58
56 void OnSetFocus(int container_instance_id, bool focused); 59 void OnSetFocus(int container_instance_id, bool focused);
57 60
61 void OnSwapBuffersACK(const BrowserPlugin_SwapInfo& info, uint32 sync_point);
62
58 // Intercepted from the guest renderer process. 63 // Intercepted from the guest renderer process.
59 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); 64 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params);
60 void OnHandleInputEventAck(WebKit::WebInputEvent::Type event_type, 65 void OnHandleInputEventAck(WebKit::WebInputEvent::Type event_type,
61 bool processed); 66 bool processed);
62 void OnTakeFocus(bool reverse); 67 void OnTakeFocus(bool reverse);
63 68
64 // RenderViewHostObserver implementation. 69 // RenderViewHostObserver implementation.
65 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 70 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
66 71
67 BrowserPluginHost* browser_plugin_host_; 72 BrowserPluginHost* browser_plugin_host_;
68 73
74 BrowserPluginHostMsg_Surface_Params surface_params_;
75
76 friend class CrappyCompositingDelegate;
77
69 DISALLOW_COPY_AND_ASSIGN(BrowserPluginHostHelper); 78 DISALLOW_COPY_AND_ASSIGN(BrowserPluginHostHelper);
70 }; 79 };
71 80
72 81
73 } // namespace browser_plugin 82 } // namespace browser_plugin
74 } // namespace content 83 } // namespace content
75 84
76 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_OLD_BROWSER_PLUGIN_HOST_HELPER_H__ 85 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_OLD_BROWSER_PLUGIN_HOST_HELPER_H__
77 86
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698