| 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" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 const IPC::Message& message) { | 89 const IPC::Message& message) { |
| 90 if (!BrowserPlugin::ShouldForwardToBrowserPlugin(message) && | 90 if (!BrowserPlugin::ShouldForwardToBrowserPlugin(message) && |
| 91 !content::GetContentClient()->renderer()-> | 91 !content::GetContentClient()->renderer()-> |
| 92 ShouldForwardToGuestContainer(message)) { | 92 ShouldForwardToGuestContainer(message)) { |
| 93 return false; | 93 return false; |
| 94 } | 94 } |
| 95 | 95 |
| 96 int browser_plugin_instance_id = browser_plugin::kInstanceIDNone; | 96 int browser_plugin_instance_id = browser_plugin::kInstanceIDNone; |
| 97 // All allowed messages must have |browser_plugin_instance_id| as their | 97 // All allowed messages must have |browser_plugin_instance_id| as their |
| 98 // first parameter. | 98 // first parameter. |
| 99 PickleIterator iter(message); | 99 base::PickleIterator iter(message); |
| 100 bool success = iter.ReadInt(&browser_plugin_instance_id); | 100 bool success = iter.ReadInt(&browser_plugin_instance_id); |
| 101 DCHECK(success); | 101 DCHECK(success); |
| 102 BrowserPlugin* plugin = GetBrowserPlugin(browser_plugin_instance_id); | 102 BrowserPlugin* plugin = GetBrowserPlugin(browser_plugin_instance_id); |
| 103 if (plugin && plugin->OnMessageReceived(message)) | 103 if (plugin && plugin->OnMessageReceived(message)) |
| 104 return true; | 104 return true; |
| 105 | 105 |
| 106 // TODO(fsamuel): This is probably forcing the compositor to continue working | 106 // TODO(fsamuel): This is probably forcing the compositor to continue working |
| 107 // even on display:none. We should optimize this. | 107 // even on display:none. We should optimize this. |
| 108 if (message.type() == BrowserPluginMsg_CompositorFrameSwapped::ID) { | 108 if (message.type() == BrowserPluginMsg_CompositorFrameSwapped::ID) { |
| 109 OnCompositorFrameSwappedPluginUnavailable(message); | 109 OnCompositorFrameSwappedPluginUnavailable(message); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 125 | 125 |
| 126 FrameHostMsg_CompositorFrameSwappedACK_Params params; | 126 FrameHostMsg_CompositorFrameSwappedACK_Params params; |
| 127 params.producing_host_id = base::get<1>(param).producing_host_id; | 127 params.producing_host_id = base::get<1>(param).producing_host_id; |
| 128 params.producing_route_id = base::get<1>(param).producing_route_id; | 128 params.producing_route_id = base::get<1>(param).producing_route_id; |
| 129 params.output_surface_id = base::get<1>(param).output_surface_id; | 129 params.output_surface_id = base::get<1>(param).output_surface_id; |
| 130 Send(new BrowserPluginHostMsg_CompositorFrameSwappedACK( | 130 Send(new BrowserPluginHostMsg_CompositorFrameSwappedACK( |
| 131 base::get<0>(param), params)); | 131 base::get<0>(param), params)); |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace content | 134 } // namespace content |
| OLD | NEW |