| OLD | NEW |
| 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 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "content/common/browser_plugin/browser_plugin_constants.h" | 7 #include "content/common/browser_plugin/browser_plugin_constants.h" |
| 8 #include "content/common/browser_plugin/browser_plugin_messages.h" | 8 #include "content/common/browser_plugin/browser_plugin_messages.h" |
| 9 #include "content/common/frame_messages.h" | 9 #include "content/common/frame_messages.h" |
| 10 #include "content/public/renderer/browser_plugin_delegate.h" | 10 #include "content/public/renderer/browser_plugin_delegate.h" |
| 11 #include "content/public/renderer/content_renderer_client.h" | |
| 12 #include "content/renderer/browser_plugin/browser_plugin.h" | 11 #include "content/renderer/browser_plugin/browser_plugin.h" |
| 13 #include "content/renderer/render_thread_impl.h" | 12 #include "content/renderer/render_thread_impl.h" |
| 14 #include "ipc/ipc_message_macros.h" | 13 #include "ipc/ipc_message_macros.h" |
| 15 | 14 |
| 16 namespace content { | 15 namespace content { |
| 17 | 16 |
| 18 // static | 17 // static |
| 19 BrowserPluginManager* BrowserPluginManager::Get() { | 18 BrowserPluginManager* BrowserPluginManager::Get() { |
| 20 if (!RenderThreadImpl::current()) | 19 if (!RenderThreadImpl::current()) |
| 21 return nullptr; | 20 return nullptr; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 if (iter.GetCurrentValue()->render_frame_routing_id() == | 79 if (iter.GetCurrentValue()->render_frame_routing_id() == |
| 81 render_frame_routing_id) { | 80 render_frame_routing_id) { |
| 82 iter.GetCurrentValue()->DidCommitCompositorFrame(); | 81 iter.GetCurrentValue()->DidCommitCompositorFrame(); |
| 83 } | 82 } |
| 84 iter.Advance(); | 83 iter.Advance(); |
| 85 } | 84 } |
| 86 } | 85 } |
| 87 | 86 |
| 88 bool BrowserPluginManager::OnControlMessageReceived( | 87 bool BrowserPluginManager::OnControlMessageReceived( |
| 89 const IPC::Message& message) { | 88 const IPC::Message& message) { |
| 90 if (!BrowserPlugin::ShouldForwardToBrowserPlugin(message) && | 89 if (!BrowserPlugin::ShouldForwardToBrowserPlugin(message)) |
| 91 !content::GetContentClient()->renderer()-> | |
| 92 ShouldForwardToGuestContainer(message)) { | |
| 93 return false; | 90 return false; |
| 94 } | |
| 95 | 91 |
| 96 int browser_plugin_instance_id = browser_plugin::kInstanceIDNone; | 92 int browser_plugin_instance_id = browser_plugin::kInstanceIDNone; |
| 97 // All allowed messages must have |browser_plugin_instance_id| as their | 93 // All allowed messages must have |browser_plugin_instance_id| as their |
| 98 // first parameter. | 94 // first parameter. |
| 99 PickleIterator iter(message); | 95 PickleIterator iter(message); |
| 100 bool success = iter.ReadInt(&browser_plugin_instance_id); | 96 bool success = iter.ReadInt(&browser_plugin_instance_id); |
| 101 DCHECK(success); | 97 DCHECK(success); |
| 102 BrowserPlugin* plugin = GetBrowserPlugin(browser_plugin_instance_id); | 98 BrowserPlugin* plugin = GetBrowserPlugin(browser_plugin_instance_id); |
| 103 if (plugin && plugin->OnMessageReceived(message)) | 99 if (plugin && plugin->OnMessageReceived(message)) |
| 104 return true; | 100 return true; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 125 | 121 |
| 126 FrameHostMsg_CompositorFrameSwappedACK_Params params; | 122 FrameHostMsg_CompositorFrameSwappedACK_Params params; |
| 127 params.producing_host_id = base::get<1>(param).producing_host_id; | 123 params.producing_host_id = base::get<1>(param).producing_host_id; |
| 128 params.producing_route_id = base::get<1>(param).producing_route_id; | 124 params.producing_route_id = base::get<1>(param).producing_route_id; |
| 129 params.output_surface_id = base::get<1>(param).output_surface_id; | 125 params.output_surface_id = base::get<1>(param).output_surface_id; |
| 130 Send(new BrowserPluginHostMsg_CompositorFrameSwappedACK( | 126 Send(new BrowserPluginHostMsg_CompositorFrameSwappedACK( |
| 131 base::get<0>(param), params)); | 127 base::get<0>(param), params)); |
| 132 } | 128 } |
| 133 | 129 |
| 134 } // namespace content | 130 } // namespace content |
| OLD | NEW |