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

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

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 #include "content/renderer/browser_plugin/browser_plugin_manager.h" 5 #include "content/renderer/browser_plugin/browser_plugin_manager.h"
6 6
7 #include "content/common/browser_plugin_messages.h" 7 #include "content/common/browser_plugin_messages.h"
8 8
9 namespace content { 9 namespace content {
10 namespace browser_plugin { 10 namespace browser_plugin {
(...skipping 22 matching lines...) Expand all
33 } 33 }
34 34
35 void BrowserPluginManager::RemoveBrowserPlugin(int instance_id) { 35 void BrowserPluginManager::RemoveBrowserPlugin(int instance_id) {
36 instances_.Remove(instance_id); 36 instances_.Remove(instance_id);
37 } 37 }
38 38
39 BrowserPlugin* BrowserPluginManager::GetBrowserPlugin(int instance_id) const { 39 BrowserPlugin* BrowserPluginManager::GetBrowserPlugin(int instance_id) const {
40 return instances_.Lookup(instance_id); 40 return instances_.Lookup(instance_id);
41 } 41 }
42 42
43 void BrowserPluginManager::WillInitiatePaint() {
Fady Samuel 2012/07/06 15:14:44 I'm confused, who calls this?
scshunt 2012/07/06 16:39:03 RenderViewImpl.
44 for (IDMap<BrowserPlugin>::iterator it(&instances_);
45 !it.IsAtEnd(); it.Advance()) {
46 BrowserPlugin* plugin = it.GetCurrentValue();
47 DCHECK(plugin);
48 plugin->WillInitiatePaint();
49 }
50 }
51
43 bool BrowserPluginManager::OnControlMessageReceived( 52 bool BrowserPluginManager::OnControlMessageReceived(
44 const IPC::Message& message) { 53 const IPC::Message& message) {
45 bool handled = true; 54 bool handled = true;
46 IPC_BEGIN_MESSAGE_MAP(BrowserPluginManager, message) 55 IPC_BEGIN_MESSAGE_MAP(BrowserPluginManager, message)
47 IPC_MESSAGE_HANDLER(BrowserPluginMsg_UpdateRect, OnUpdateRect) 56 IPC_MESSAGE_HANDLER(BrowserPluginMsg_UpdateRect, OnUpdateRect)
48 IPC_MESSAGE_HANDLER(BrowserPluginMsg_GuestCrashed,OnGuestCrashed) 57 IPC_MESSAGE_HANDLER(BrowserPluginMsg_GuestCrashed,OnGuestCrashed)
49 IPC_MESSAGE_HANDLER(BrowserPluginMsg_UpdateURL, OnUpdateURL) 58 IPC_MESSAGE_HANDLER(BrowserPluginMsg_UpdateURL, OnUpdateURL)
50 IPC_MESSAGE_HANDLER(BrowserPluginMsg_AdvanceFocus, OnAdvanceFocus) 59 IPC_MESSAGE_HANDLER(BrowserPluginMsg_AdvanceFocus, OnAdvanceFocus)
60 IPC_MESSAGE_HANDLER(BrowserPluginMsg_BuffersSwapped, OnBuffersSwapped)
51 IPC_MESSAGE_UNHANDLED(handled = false) 61 IPC_MESSAGE_UNHANDLED(handled = false)
52 IPC_END_MESSAGE_MAP() 62 IPC_END_MESSAGE_MAP()
53 return handled; 63 return handled;
54 } 64 }
55 65
56 void BrowserPluginManager::OnUpdateRect( 66 void BrowserPluginManager::OnUpdateRect(
57 int instance_id, 67 int instance_id,
58 int message_id, 68 int message_id,
59 const BrowserPluginMsg_UpdateRect_Params& params) { 69 const BrowserPluginMsg_UpdateRect_Params& params) {
60 GetBrowserPlugin(instance_id)->UpdateRect(message_id, params); 70 GetBrowserPlugin(instance_id)->UpdateRect(message_id, params);
61 } 71 }
62 72
63 void BrowserPluginManager::OnGuestCrashed(int instance_id) { 73 void BrowserPluginManager::OnGuestCrashed(int instance_id) {
64 GetBrowserPlugin(instance_id)->GuestCrashed(); 74 GetBrowserPlugin(instance_id)->GuestCrashed();
65 } 75 }
66 76
67 void BrowserPluginManager::OnUpdateURL(int instance_id, const GURL& url) { 77 void BrowserPluginManager::OnUpdateURL(int instance_id, const GURL& url) {
68 GetBrowserPlugin(instance_id)->UpdateURL(url); 78 GetBrowserPlugin(instance_id)->UpdateURL(url);
69 } 79 }
70 80
71 void BrowserPluginManager::OnAdvanceFocus(int instance_id, bool reverse) { 81 void BrowserPluginManager::OnAdvanceFocus(int instance_id, bool reverse) {
72 GetBrowserPlugin(instance_id)->AdvanceFocus(reverse); 82 GetBrowserPlugin(instance_id)->AdvanceFocus(reverse);
73 } 83 }
74 84
85 void BrowserPluginManager::OnBuffersSwapped(int instance_id, uint64 surface_hand le, const BrowserPlugin_SwapInfo& info) {
86 GetBrowserPlugin(instance_id)->BuffersSwapped(surface_handle, info);
87 }
88
75 } // namespace browser_plugin 89 } // namespace browser_plugin
76 } // namespace content 90 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698