OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/renderer/webplugin_delegate_proxy.h" | 5 #include "chrome/renderer/webplugin_delegate_proxy.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #if defined(OS_LINUX) | 9 #if defined(OS_LINUX) |
10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
11 #endif | 11 #endif |
12 | 12 |
13 #include "app/gfx/blit.h" | 13 #include "app/gfx/blit.h" |
14 #include "app/gfx/canvas.h" | 14 #include "app/gfx/canvas.h" |
15 #include "app/gfx/native_widget_types.h" | 15 #include "app/gfx/native_widget_types.h" |
16 #include "app/l10n_util.h" | 16 #include "app/l10n_util.h" |
17 #include "app/resource_bundle.h" | 17 #include "app/resource_bundle.h" |
18 #include "base/basictypes.h" | 18 #include "base/basictypes.h" |
19 #include "base/file_util.h" | 19 #include "base/file_util.h" |
20 #include "base/logging.h" | 20 #include "base/logging.h" |
21 #include "base/ref_counted.h" | 21 #include "base/ref_counted.h" |
22 #include "base/string_util.h" | 22 #include "base/string_util.h" |
23 #include "base/gfx/size.h" | 23 #include "base/gfx/size.h" |
24 #include "chrome/common/child_process_logging.h" | 24 #include "chrome/common/child_process_logging.h" |
25 #include "chrome/common/plugin_messages.h" | 25 #include "chrome/common/plugin_messages.h" |
26 #include "chrome/common/render_messages.h" | 26 #include "chrome/common/render_messages.h" |
27 #include "chrome/plugin/npobject_proxy.h" | 27 #include "chrome/plugin/npobject_proxy.h" |
28 #include "chrome/plugin/npobject_stub.h" | 28 #include "chrome/plugin/npobject_stub.h" |
29 #include "chrome/plugin/npobject_util.h" | 29 #include "chrome/plugin/npobject_util.h" |
| 30 #include "chrome/renderer/command_buffer_proxy.h" |
30 #include "chrome/renderer/render_thread.h" | 31 #include "chrome/renderer/render_thread.h" |
31 #include "chrome/renderer/render_view.h" | 32 #include "chrome/renderer/render_view.h" |
32 #include "grit/generated_resources.h" | 33 #include "grit/generated_resources.h" |
33 #include "grit/renderer_resources.h" | 34 #include "grit/renderer_resources.h" |
34 #include "net/base/mime_util.h" | 35 #include "net/base/mime_util.h" |
35 #include "printing/native_metafile.h" | 36 #include "printing/native_metafile.h" |
36 #include "third_party/WebKit/WebKit/chromium/public/WebBindings.h" | 37 #include "third_party/WebKit/WebKit/chromium/public/WebBindings.h" |
37 #include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.h" | 38 #include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.h" |
38 #include "third_party/WebKit/WebKit/chromium/public/WebDragData.h" | 39 #include "third_party/WebKit/WebKit/chromium/public/WebDragData.h" |
39 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" | 40 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" |
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1134 intptr_t notify_data, intptr_t npstream) { | 1135 intptr_t notify_data, intptr_t npstream) { |
1135 if (!channel_host_) | 1136 if (!channel_host_) |
1136 return NULL; | 1137 return NULL; |
1137 | 1138 |
1138 ResourceClientProxy* proxy = new ResourceClientProxy(channel_host_, | 1139 ResourceClientProxy* proxy = new ResourceClientProxy(channel_host_, |
1139 instance_id_); | 1140 instance_id_); |
1140 proxy->Initialize(resource_id, url, notify_needed, notify_data, npstream); | 1141 proxy->Initialize(resource_id, url, notify_needed, notify_data, npstream); |
1141 return proxy; | 1142 return proxy; |
1142 } | 1143 } |
1143 | 1144 |
| 1145 CommandBufferProxy* WebPluginDelegateProxy::CreateCommandBuffer() { |
| 1146 #if defined(ENABLE_GPU) |
| 1147 int command_buffer_id; |
| 1148 if (!Send(new PluginMsg_CreateCommandBuffer(instance_id_, |
| 1149 &command_buffer_id))) { |
| 1150 return NULL; |
| 1151 } |
| 1152 |
| 1153 return new CommandBufferProxy(channel_host_, command_buffer_id); |
| 1154 #else |
| 1155 return NULL; |
| 1156 #endif |
| 1157 } |
| 1158 |
1144 void WebPluginDelegateProxy::OnCancelDocumentLoad() { | 1159 void WebPluginDelegateProxy::OnCancelDocumentLoad() { |
1145 plugin_->CancelDocumentLoad(); | 1160 plugin_->CancelDocumentLoad(); |
1146 } | 1161 } |
1147 | 1162 |
1148 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( | 1163 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( |
1149 const std::string& url, const std::string& range_info, | 1164 const std::string& url, const std::string& range_info, |
1150 intptr_t existing_stream, bool notify_needed, intptr_t notify_data) { | 1165 intptr_t existing_stream, bool notify_needed, intptr_t notify_data) { |
1151 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), | 1166 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), |
1152 existing_stream, notify_needed, | 1167 existing_stream, notify_needed, |
1153 notify_data); | 1168 notify_data); |
(...skipping 17 matching lines...) Expand all Loading... |
1171 // prior to the UpdateGeometry message now being acknowledged are known to | 1186 // prior to the UpdateGeometry message now being acknowledged are known to |
1172 // be no longer needed. Release them, and take the stale entry out of the | 1187 // be no longer needed. Release them, and take the stale entry out of the |
1173 // map. | 1188 // map. |
1174 ReleaseTransportDIB(iterator->second.backing_store.get()); | 1189 ReleaseTransportDIB(iterator->second.backing_store.get()); |
1175 ReleaseTransportDIB(iterator->second.transport_store.get()); | 1190 ReleaseTransportDIB(iterator->second.transport_store.get()); |
1176 ReleaseTransportDIB(iterator->second.background_store.get()); | 1191 ReleaseTransportDIB(iterator->second.background_store.get()); |
1177 | 1192 |
1178 old_transport_dibs_.erase(iterator); | 1193 old_transport_dibs_.erase(iterator); |
1179 } | 1194 } |
1180 #endif | 1195 #endif |
OLD | NEW |