Chromium Code Reviews| Index: content/renderer/pepper/ppb_graphics_3d_impl.cc |
| diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.cc b/content/renderer/pepper/ppb_graphics_3d_impl.cc |
| index c999fad4f0bc5da324bd0bdbbd7fe93edd4d3808..8dec9ae2e5b8308e48759ae46b16549ddcf35436 100644 |
| --- a/content/renderer/pepper/ppb_graphics_3d_impl.cc |
| +++ b/content/renderer/pepper/ppb_graphics_3d_impl.cc |
| @@ -21,6 +21,7 @@ |
| #include "content/renderer/render_thread_impl.h" |
| #include "content/renderer/render_view_impl.h" |
| #include "gpu/command_buffer/client/gles2_interface.h" |
| +#include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| #include "ppapi/c/ppp_graphics_3d.h" |
| #include "ppapi/thunk/enter.h" |
| #include "third_party/WebKit/public/platform/WebString.h" |
| @@ -259,6 +260,10 @@ bool PPB_Graphics3D_Impl::InitRaw(PPB_Graphics3D_API* share_context, |
| for (const int32_t* attr = attrib_list; attr[0] != PP_GRAPHICS3DATTRIB_NONE; |
| attr += 2) { |
| switch (attr[0]) { |
| + case gpu::gles2::kContextType: |
| + // kContextType is chromium internal, no caller should set this. |
| + DCHECK(false); |
|
piman
2016/03/16 23:55:04
The attrib list comes from an untrusted side (e.g.
|
| + break; |
| case PP_GRAPHICS3DATTRIB_WIDTH: |
| surface_size.set_width(attr[1]); |
| break; |
| @@ -280,9 +285,12 @@ bool PPB_Graphics3D_Impl::InitRaw(PPB_Graphics3D_API* share_context, |
| break; |
| } |
| } |
| - attribs.push_back(PP_GRAPHICS3DATTRIB_NONE); |
| } |
| + attribs.push_back(gpu::gles2::kContextType); |
| + attribs.push_back(gpu::gles2::CONTEXT_TYPE_OPENGLES2_PEPPER); |
| + attribs.push_back(PP_GRAPHICS3DATTRIB_NONE); |
| + |
| CommandBufferProxyImpl* share_buffer = NULL; |
| if (share_context) { |
| PPB_Graphics3D_Impl* share_graphics = |