| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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.h" | 5 #include "content/renderer/browser_plugin/browser_plugin.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 return; | 180 return; |
| 181 | 181 |
| 182 BrowserPluginMsg_CompositorFrameSwapped::Param param; | 182 BrowserPluginMsg_CompositorFrameSwapped::Param param; |
| 183 if (!BrowserPluginMsg_CompositorFrameSwapped::Read(&message, ¶m)) | 183 if (!BrowserPluginMsg_CompositorFrameSwapped::Read(&message, ¶m)) |
| 184 return; | 184 return; |
| 185 // Note that there is no need to send ACK for this message. | 185 // Note that there is no need to send ACK for this message. |
| 186 // If the guest has updated pixels then it is no longer crashed. | 186 // If the guest has updated pixels then it is no longer crashed. |
| 187 guest_crashed_ = false; | 187 guest_crashed_ = false; |
| 188 | 188 |
| 189 scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); | 189 scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); |
| 190 param.b.frame.AssignTo(frame.get()); | 190 get<1>(param).frame.AssignTo(frame.get()); |
| 191 | 191 |
| 192 EnableCompositing(true); | 192 EnableCompositing(true); |
| 193 compositing_helper_->OnCompositorFrameSwapped(frame.Pass(), | 193 compositing_helper_->OnCompositorFrameSwapped( |
| 194 param.b.producing_route_id, | 194 frame.Pass(), |
| 195 param.b.output_surface_id, | 195 get<1>(param).producing_route_id, |
| 196 param.b.producing_host_id, | 196 get<1>(param).output_surface_id, |
| 197 param.b.shared_memory_handle); | 197 get<1>(param).producing_host_id, |
| 198 get<1>(param).shared_memory_handle); |
| 198 } | 199 } |
| 199 | 200 |
| 200 void BrowserPlugin::OnGuestGone(int browser_plugin_instance_id) { | 201 void BrowserPlugin::OnGuestGone(int browser_plugin_instance_id) { |
| 201 guest_crashed_ = true; | 202 guest_crashed_ = true; |
| 202 | 203 |
| 203 // Turn off compositing so we can display the sad graphic. Changes to | 204 // Turn off compositing so we can display the sad graphic. Changes to |
| 204 // compositing state will show up at a later time after a layout and commit. | 205 // compositing state will show up at a later time after a layout and commit. |
| 205 EnableCompositing(false); | 206 EnableCompositing(false); |
| 206 | 207 |
| 207 // Queue up showing the sad graphic to give content embedders an opportunity | 208 // Queue up showing the sad graphic to give content embedders an opportunity |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 const blink::WebMouseEvent& event) { | 662 const blink::WebMouseEvent& event) { |
| 662 BrowserPluginManager::Get()->Send( | 663 BrowserPluginManager::Get()->Send( |
| 663 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, | 664 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, |
| 664 browser_plugin_instance_id_, | 665 browser_plugin_instance_id_, |
| 665 plugin_rect_, | 666 plugin_rect_, |
| 666 &event)); | 667 &event)); |
| 667 return true; | 668 return true; |
| 668 } | 669 } |
| 669 | 670 |
| 670 } // namespace content | 671 } // namespace content |
| OLD | NEW |