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

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

Issue 11967013: Fixes issues when switching between software and compositing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 11 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_impl.h" 5 #include "content/renderer/browser_plugin/browser_plugin_manager_impl.h"
6 6
7 #include "content/common/browser_plugin_messages.h" 7 #include "content/common/browser_plugin_messages.h"
8 #include "content/renderer/browser_plugin/browser_plugin.h" 8 #include "content/renderer/browser_plugin/browser_plugin.h"
9 #include "content/renderer/render_thread_impl.h" 9 #include "content/renderer/render_thread_impl.h"
10 #include "ui/gfx/point.h" 10 #include "ui/gfx/point.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 PickleIterator iter(message); 42 PickleIterator iter(message);
43 bool success = iter.ReadInt(&instance_id); 43 bool success = iter.ReadInt(&instance_id);
44 DCHECK(success); 44 DCHECK(success);
45 BrowserPlugin* plugin = GetBrowserPlugin(instance_id); 45 BrowserPlugin* plugin = GetBrowserPlugin(instance_id);
46 if (plugin && plugin->OnMessageReceived(message)) 46 if (plugin && plugin->OnMessageReceived(message))
47 return true; 47 return true;
48 } 48 }
49 49
50 bool handled = true; 50 bool handled = true;
51 IPC_BEGIN_MESSAGE_MAP(BrowserPluginManagerImpl, message) 51 IPC_BEGIN_MESSAGE_MAP(BrowserPluginManagerImpl, message)
52 IPC_MESSAGE_HANDLER(BrowserPluginMsg_BuffersSwapped,
53 OnUnhandledSwap);
52 IPC_MESSAGE_HANDLER(BrowserPluginMsg_PluginAtPositionRequest, 54 IPC_MESSAGE_HANDLER(BrowserPluginMsg_PluginAtPositionRequest,
53 OnPluginAtPositionRequest); 55 OnPluginAtPositionRequest);
54 IPC_MESSAGE_UNHANDLED(handled = false) 56 IPC_MESSAGE_UNHANDLED(handled = false)
55 IPC_END_MESSAGE_MAP() 57 IPC_END_MESSAGE_MAP()
56 return handled; 58 return handled;
57 } 59 }
58 60
59 void BrowserPluginManagerImpl::OnPluginAtPositionRequest( 61 void BrowserPluginManagerImpl::OnPluginAtPositionRequest(
60 const IPC::Message& message, 62 const IPC::Message& message,
61 int request_id, 63 int request_id,
(...skipping 15 matching lines...) Expand all
77 it.Advance(); 79 it.Advance();
78 } 80 }
79 81
80 Send(new BrowserPluginHostMsg_PluginAtPositionResponse( 82 Send(new BrowserPluginHostMsg_PluginAtPositionResponse(
81 source_routing_id, 83 source_routing_id,
82 instance_id, 84 instance_id,
83 request_id, 85 request_id,
84 local_position)); 86 local_position));
85 } 87 }
86 88
89 void BrowserPluginManagerImpl::OnUnhandledSwap(const IPC::Message& message,
90 int instance_id,
91 const gfx::Size& size,
92 std::string mailbox_name,
93 int gpu_route_id,
94 int gpu_host_id) {
95 Send(new BrowserPluginHostMsg_BuffersSwappedACK(
Fady Samuel 2013/01/16 16:22:22 Why is this in BrowserPluginManager and not in Bro
alexst (slow to review) 2013/01/16 16:58:21 Because the browser plugin is already gone at this
96 message.routing_id(),
97 gpu_route_id,
98 gpu_host_id,
99 mailbox_name,
100 0));
101 }
102
87 // static 103 // static
88 bool BrowserPluginManagerImpl::ShouldForwardToBrowserPlugin( 104 bool BrowserPluginManagerImpl::ShouldForwardToBrowserPlugin(
89 const IPC::Message& message) { 105 const IPC::Message& message) {
90 switch (message.type()) { 106 switch (message.type()) {
91 case BrowserPluginMsg_AdvanceFocus::ID: 107 case BrowserPluginMsg_AdvanceFocus::ID:
92 case BrowserPluginMsg_GuestContentWindowReady::ID: 108 case BrowserPluginMsg_GuestContentWindowReady::ID:
93 case BrowserPluginMsg_GuestGone::ID: 109 case BrowserPluginMsg_GuestGone::ID:
94 case BrowserPluginMsg_GuestResponsive::ID: 110 case BrowserPluginMsg_GuestResponsive::ID:
95 case BrowserPluginMsg_GuestUnresponsive::ID: 111 case BrowserPluginMsg_GuestUnresponsive::ID:
96 case BrowserPluginMsg_LoadAbort::ID: 112 case BrowserPluginMsg_LoadAbort::ID:
97 case BrowserPluginMsg_LoadCommit::ID: 113 case BrowserPluginMsg_LoadCommit::ID:
98 case BrowserPluginMsg_LoadRedirect::ID: 114 case BrowserPluginMsg_LoadRedirect::ID:
99 case BrowserPluginMsg_LoadStart::ID: 115 case BrowserPluginMsg_LoadStart::ID:
100 case BrowserPluginMsg_LoadStop::ID: 116 case BrowserPluginMsg_LoadStop::ID:
101 case BrowserPluginMsg_SetCursor::ID: 117 case BrowserPluginMsg_SetCursor::ID:
102 case BrowserPluginMsg_ShouldAcceptTouchEvents::ID: 118 case BrowserPluginMsg_ShouldAcceptTouchEvents::ID:
103 case BrowserPluginMsg_UpdatedName::ID: 119 case BrowserPluginMsg_UpdatedName::ID:
104 case BrowserPluginMsg_UpdateRect::ID: 120 case BrowserPluginMsg_UpdateRect::ID:
105 case BrowserPluginMsg_BuffersSwapped::ID: 121 case BrowserPluginMsg_BuffersSwapped::ID:
106 return true; 122 return true;
107 default: 123 default:
108 break; 124 break;
109 } 125 }
110 return false; 126 return false;
111 } 127 }
112 128
113 } // namespace content 129 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698