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/string_util.h" | 9 #include "base/string_util.h" |
10 #include "content/browser/browser_plugin/browser_plugin_embedder.h" | 10 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 // between the embedder and browser processes. | 226 // between the embedder and browser processes. |
227 DCHECK(*static_cast<unsigned int*>(damage_buffer->memory()) == 0xdeadbeef); | 227 DCHECK(*static_cast<unsigned int*>(damage_buffer->memory()) == 0xdeadbeef); |
228 damage_buffer_.reset(damage_buffer); | 228 damage_buffer_.reset(damage_buffer); |
229 #if defined(OS_WIN) | 229 #if defined(OS_WIN) |
230 damage_buffer_size_ = damage_buffer_size; | 230 damage_buffer_size_ = damage_buffer_size; |
231 #endif | 231 #endif |
232 damage_view_size_ = damage_view_size; | 232 damage_view_size_ = damage_view_size; |
233 damage_buffer_scale_factor_ = scale_factor; | 233 damage_buffer_scale_factor_ = scale_factor; |
234 } | 234 } |
235 | 235 |
236 void BrowserPluginGuest::SetCompositingBufferData(int gpu_process_id, | |
rjkroege
2012/11/08 15:08:50
A compromised renderer process could send invalid
alexst (slow to review)
2012/11/08 18:12:17
These are validated later in the TextureImageTrans
| |
237 uint32 client_id, | |
238 uint32 context_id, | |
239 uint32 texture_id_0, | |
240 uint32 texture_id_1, | |
241 uint32 sync_point) { | |
242 // This is the signal for having no context | |
243 if (texture_id_0 == 0) { | |
244 DCHECK(texture_id_1 == 0); | |
245 surface_handle_ = gfx::GLSurfaceHandle(); | |
246 return; | |
247 } | |
248 | |
249 DCHECK(texture_id_1 != 0); | |
250 DCHECK(texture_id_0 != texture_id_1); | |
251 | |
252 surface_handle_ = gfx::GLSurfaceHandle(gfx::kNullPluginWindow, true); | |
253 surface_handle_.parent_gpu_process_id = gpu_process_id; | |
254 surface_handle_.parent_client_id = client_id; | |
255 surface_handle_.parent_context_id = context_id; | |
256 surface_handle_.parent_texture_id[0] = texture_id_0; | |
257 surface_handle_.parent_texture_id[1] = texture_id_1; | |
258 surface_handle_.sync_point = sync_point; | |
259 } | |
260 | |
236 void BrowserPluginGuest::UpdateRect( | 261 void BrowserPluginGuest::UpdateRect( |
237 RenderViewHost* render_view_host, | 262 RenderViewHost* render_view_host, |
238 const ViewHostMsg_UpdateRect_Params& params) { | 263 const ViewHostMsg_UpdateRect_Params& params) { |
239 RenderWidgetHostImpl* render_widget_host = | 264 RenderWidgetHostImpl* render_widget_host = |
240 RenderWidgetHostImpl::From(render_view_host); | 265 RenderWidgetHostImpl::From(render_view_host); |
241 render_widget_host->ResetSizeAndRepaintPendingFlags(); | 266 render_widget_host->ResetSizeAndRepaintPendingFlags(); |
242 // This handler is only of interest to us for the 2D software rendering path. | 267 // This handler is only of interest to us for the 2D software rendering path. |
243 // needs_ack should always be true for the 2D path. | 268 // needs_ack should always be true for the 2D path. |
244 // TODO(fsamuel): Do we need to do something different in the 3D case? | 269 // TODO(fsamuel): Do we need to do something different in the 3D case? |
245 if (!params.needs_ack) | 270 if (!params.needs_ack) |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
506 default: | 531 default: |
507 break; | 532 break; |
508 } | 533 } |
509 } | 534 } |
510 | 535 |
511 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { | 536 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { |
512 embedder_web_contents_->GetRenderProcessHost()->Send(msg); | 537 embedder_web_contents_->GetRenderProcessHost()->Send(msg); |
513 } | 538 } |
514 | 539 |
515 } // namespace content | 540 } // namespace content |
OLD | NEW |