| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/browser/browser_plugin/browser_plugin_guest_manager.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest_manager.h" |
| 6 | 6 |
| 7 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 7 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 8 #include "content/browser/browser_plugin/browser_plugin_host_factory.h" | 8 #include "content/browser/browser_plugin/browser_plugin_host_factory.h" |
| 9 #include "content/browser/renderer_host/render_view_host_impl.h" | 9 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 if (it->second->GetSiteInstance()->GetSiteURL() == guest_site) | 210 if (it->second->GetSiteInstance()->GetSiteURL() == guest_site) |
| 211 return it->second->GetSiteInstance(); | 211 return it->second->GetSiteInstance(); |
| 212 } | 212 } |
| 213 return NULL; | 213 return NULL; |
| 214 } | 214 } |
| 215 | 215 |
| 216 // We only get here during teardown if we have one last buffer pending, | 216 // We only get here during teardown if we have one last buffer pending, |
| 217 // otherwise the ACK is handled by the guest. | 217 // otherwise the ACK is handled by the guest. |
| 218 void BrowserPluginGuestManager::OnUnhandledSwapBuffersACK( | 218 void BrowserPluginGuestManager::OnUnhandledSwapBuffersACK( |
| 219 int instance_id, | 219 int instance_id, |
| 220 int route_id, | 220 const FrameHostMsg_BuffersSwappedACK_Params& params) { |
| 221 int gpu_host_id, | 221 BrowserPluginGuest::AcknowledgeBufferPresent(params.gpu_route_id, |
| 222 const std::string& mailbox_name, | 222 params.gpu_host_id, |
| 223 uint32 sync_point) { | 223 params.mailbox_name, |
| 224 BrowserPluginGuest::AcknowledgeBufferPresent(route_id, | 224 params.sync_point); |
| 225 gpu_host_id, | |
| 226 mailbox_name, | |
| 227 sync_point); | |
| 228 } | 225 } |
| 229 | 226 |
| 230 void BrowserPluginGuestManager::DidSendScreenRects( | 227 void BrowserPluginGuestManager::DidSendScreenRects( |
| 231 WebContentsImpl* embedder_web_contents) { | 228 WebContentsImpl* embedder_web_contents) { |
| 232 // TODO(lazyboy): Generalize iterating over guest instances and performing | 229 // TODO(lazyboy): Generalize iterating over guest instances and performing |
| 233 // actions on the guests. | 230 // actions on the guests. |
| 234 for (GuestInstanceMap::iterator it = | 231 for (GuestInstanceMap::iterator it = |
| 235 guest_web_contents_by_instance_id_.begin(); | 232 guest_web_contents_by_instance_id_.begin(); |
| 236 it != guest_web_contents_by_instance_id_.end(); ++it) { | 233 it != guest_web_contents_by_instance_id_.end(); ++it) { |
| 237 BrowserPluginGuest* guest = it->second->GetBrowserPluginGuest(); | 234 BrowserPluginGuest* guest = it->second->GetBrowserPluginGuest(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 259 BrowserPluginGuest* guest = it->second->GetBrowserPluginGuest(); | 256 BrowserPluginGuest* guest = it->second->GetBrowserPluginGuest(); |
| 260 if (embedder_web_contents == guest->embedder_web_contents()) { | 257 if (embedder_web_contents == guest->embedder_web_contents()) { |
| 261 if (guest->UnlockMouseIfNecessary(event)) | 258 if (guest->UnlockMouseIfNecessary(event)) |
| 262 return true; | 259 return true; |
| 263 } | 260 } |
| 264 } | 261 } |
| 265 return false; | 262 return false; |
| 266 } | 263 } |
| 267 | 264 |
| 268 } // namespace content | 265 } // namespace content |
| OLD | NEW |