| 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/json/json_string_value_serializer.h" | 8 #include "base/json/json_string_value_serializer.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 if (!params.storage_partition_id.empty()) { | 425 if (!params.storage_partition_id.empty()) { |
| 426 std::string partition_name = | 426 std::string partition_name = |
| 427 (params.persist_storage ? browser_plugin::kPersistPrefix : "") + | 427 (params.persist_storage ? browser_plugin::kPersistPrefix : "") + |
| 428 params.storage_partition_id; | 428 params.storage_partition_id; |
| 429 UpdateDOMAttribute(browser_plugin::kAttributePartition, partition_name); | 429 UpdateDOMAttribute(browser_plugin::kAttributePartition, partition_name); |
| 430 } | 430 } |
| 431 attached_ = true; | 431 attached_ = true; |
| 432 } | 432 } |
| 433 | 433 |
| 434 void BrowserPlugin::OnBuffersSwapped( | 434 void BrowserPlugin::OnBuffersSwapped( |
| 435 int guest_instance_id, | 435 int instance_id, |
| 436 const BrowserPluginMsg_BuffersSwapped_Params& params) { | 436 const FrameMsg_BuffersSwapped_Params& params) { |
| 437 DCHECK(guest_instance_id == guest_instance_id_); | |
| 438 EnableCompositing(true); | 437 EnableCompositing(true); |
| 439 | 438 |
| 440 compositing_helper_->OnBuffersSwapped(params.size, | 439 compositing_helper_->OnBuffersSwapped(params.size, |
| 441 params.mailbox_name, | 440 params.mailbox_name, |
| 442 params.route_id, | 441 params.gpu_route_id, |
| 443 params.host_id, | 442 params.gpu_host_id, |
| 444 GetDeviceScaleFactor()); | 443 GetDeviceScaleFactor()); |
| 445 } | 444 } |
| 446 | 445 |
| 447 void BrowserPlugin::OnCompositorFrameSwapped(const IPC::Message& message) { | 446 void BrowserPlugin::OnCompositorFrameSwapped(const IPC::Message& message) { |
| 448 BrowserPluginMsg_CompositorFrameSwapped::Param param; | 447 BrowserPluginMsg_CompositorFrameSwapped::Param param; |
| 449 if (!BrowserPluginMsg_CompositorFrameSwapped::Read(&message, ¶m)) | 448 if (!BrowserPluginMsg_CompositorFrameSwapped::Read(&message, ¶m)) |
| 450 return; | 449 return; |
| 451 scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); | 450 scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); |
| 452 param.b.AssignTo(frame.get()); | 451 param.b.frame.AssignTo(frame.get()); |
| 453 | 452 |
| 454 EnableCompositing(true); | 453 EnableCompositing(true); |
| 455 compositing_helper_->OnCompositorFrameSwapped(frame.Pass(), | 454 compositing_helper_->OnCompositorFrameSwapped(frame.Pass(), |
| 456 param.c /* route_id */, | 455 param.b.producing_route_id, |
| 457 param.d /* output_surface_id */, | 456 param.b.output_surface_id, |
| 458 param.e /* host_id */); | 457 param.b.producing_host_id); |
| 459 } | 458 } |
| 460 | 459 |
| 461 void BrowserPlugin::OnCopyFromCompositingSurface(int guest_instance_id, | 460 void BrowserPlugin::OnCopyFromCompositingSurface(int guest_instance_id, |
| 462 int request_id, | 461 int request_id, |
| 463 gfx::Rect source_rect, | 462 gfx::Rect source_rect, |
| 464 gfx::Size dest_size) { | 463 gfx::Size dest_size) { |
| 465 if (!compositing_enabled_) { | 464 if (!compositing_enabled_) { |
| 466 browser_plugin_manager()->Send( | 465 browser_plugin_manager()->Send( |
| 467 new BrowserPluginHostMsg_CopyFromCompositingSurfaceAck( | 466 new BrowserPluginHostMsg_CopyFromCompositingSurfaceAck( |
| 468 render_view_routing_id_, | 467 render_view_routing_id_, |
| (...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 const blink::WebMouseEvent& event) { | 1407 const blink::WebMouseEvent& event) { |
| 1409 browser_plugin_manager()->Send( | 1408 browser_plugin_manager()->Send( |
| 1410 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, | 1409 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, |
| 1411 guest_instance_id_, | 1410 guest_instance_id_, |
| 1412 plugin_rect_, | 1411 plugin_rect_, |
| 1413 &event)); | 1412 &event)); |
| 1414 return true; | 1413 return true; |
| 1415 } | 1414 } |
| 1416 | 1415 |
| 1417 } // namespace content | 1416 } // namespace content |
| OLD | NEW |