| 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/browser/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 // TODO(fsamuel): Consider whether we should be clearing | 1150 // TODO(fsamuel): Consider whether we should be clearing |
| 1151 // |permission_request_map_| here. | 1151 // |permission_request_map_| here. |
| 1152 if (delegate_) | 1152 if (delegate_) |
| 1153 delegate_->GuestProcessGone(status); | 1153 delegate_->GuestProcessGone(status); |
| 1154 } | 1154 } |
| 1155 | 1155 |
| 1156 // static | 1156 // static |
| 1157 void BrowserPluginGuest::AcknowledgeBufferPresent( | 1157 void BrowserPluginGuest::AcknowledgeBufferPresent( |
| 1158 int route_id, | 1158 int route_id, |
| 1159 int gpu_host_id, | 1159 int gpu_host_id, |
| 1160 const gpu::Mailbox& mailbox, | 1160 const std::string& mailbox_name, |
| 1161 uint32 sync_point) { | 1161 uint32 sync_point) { |
| 1162 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; | 1162 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; |
| 1163 ack_params.mailbox = mailbox; | 1163 ack_params.mailbox_name = mailbox_name; |
| 1164 ack_params.sync_point = sync_point; | 1164 ack_params.sync_point = sync_point; |
| 1165 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, | 1165 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, |
| 1166 gpu_host_id, | 1166 gpu_host_id, |
| 1167 ack_params); | 1167 ack_params); |
| 1168 } | 1168 } |
| 1169 | 1169 |
| 1170 // static | 1170 // static |
| 1171 bool BrowserPluginGuest::ShouldForwardToBrowserPluginGuest( | 1171 bool BrowserPluginGuest::ShouldForwardToBrowserPluginGuest( |
| 1172 const IPC::Message& message) { | 1172 const IPC::Message& message) { |
| 1173 switch (message.type()) { | 1173 switch (message.type()) { |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1603 if (embedder_visible_ && guest_visible_) | 1603 if (embedder_visible_ && guest_visible_) |
| 1604 GetWebContents()->WasShown(); | 1604 GetWebContents()->WasShown(); |
| 1605 else | 1605 else |
| 1606 GetWebContents()->WasHidden(); | 1606 GetWebContents()->WasHidden(); |
| 1607 } | 1607 } |
| 1608 | 1608 |
| 1609 void BrowserPluginGuest::OnSwapBuffersACK( | 1609 void BrowserPluginGuest::OnSwapBuffersACK( |
| 1610 int instance_id, | 1610 int instance_id, |
| 1611 const FrameHostMsg_BuffersSwappedACK_Params& params) { | 1611 const FrameHostMsg_BuffersSwappedACK_Params& params) { |
| 1612 AcknowledgeBufferPresent(params.gpu_route_id, params.gpu_host_id, | 1612 AcknowledgeBufferPresent(params.gpu_route_id, params.gpu_host_id, |
| 1613 params.mailbox, params.sync_point); | 1613 params.mailbox_name, params.sync_point); |
| 1614 | 1614 |
| 1615 // This is only relevant on MACOSX and WIN when threaded compositing | 1615 // This is only relevant on MACOSX and WIN when threaded compositing |
| 1616 // is not enabled. In threaded mode, above ACK is sufficient. | 1616 // is not enabled. In threaded mode, above ACK is sufficient. |
| 1617 #if defined(OS_MACOSX) || defined(OS_WIN) | 1617 #if defined(OS_MACOSX) || defined(OS_WIN) |
| 1618 RenderWidgetHostImpl* render_widget_host = | 1618 RenderWidgetHostImpl* render_widget_host = |
| 1619 RenderWidgetHostImpl::From(GetWebContents()->GetRenderViewHost()); | 1619 RenderWidgetHostImpl::From(GetWebContents()->GetRenderViewHost()); |
| 1620 render_widget_host->AcknowledgeSwapBuffersToRenderer(); | 1620 render_widget_host->AcknowledgeSwapBuffersToRenderer(); |
| 1621 #endif // defined(OS_MACOSX) || defined(OS_WIN) | 1621 #endif // defined(OS_MACOSX) || defined(OS_WIN) |
| 1622 } | 1622 } |
| 1623 | 1623 |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1899 base::Value::CreateStringValue(request_method)); | 1899 base::Value::CreateStringValue(request_method)); |
| 1900 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url)); | 1900 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url)); |
| 1901 | 1901 |
| 1902 RequestPermission(BROWSER_PLUGIN_PERMISSION_TYPE_DOWNLOAD, | 1902 RequestPermission(BROWSER_PLUGIN_PERMISSION_TYPE_DOWNLOAD, |
| 1903 new DownloadRequest(weak_ptr_factory_.GetWeakPtr(), | 1903 new DownloadRequest(weak_ptr_factory_.GetWeakPtr(), |
| 1904 callback), | 1904 callback), |
| 1905 request_info); | 1905 request_info); |
| 1906 } | 1906 } |
| 1907 | 1907 |
| 1908 } // namespace content | 1908 } // namespace content |
| OLD | NEW |