summaryrefslogtreecommitdiffstats
path: root/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-16 21:00:10 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-16 21:00:10 +0000
commitaca5a97af1eabd1e4668379225388cb853018ebd (patch)
treec772aba3d20fd098b86f8cac183e3e477b70a8b9 /webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
parentab9a0ca1b40ad4b17eb7d29e6fee0f9bebd67876 (diff)
downloadchromium_src-aca5a97af1eabd1e4668379225388cb853018ebd.zip
chromium_src-aca5a97af1eabd1e4668379225388cb853018ebd.tar.gz
chromium_src-aca5a97af1eabd1e4668379225388cb853018ebd.tar.bz2
Fixing PPB_Graiphics2D::Describe to behave according to spec with an invalid graphics 2d resource parameter.
BUG= http://code.google.com/p/chromium/issues/detail?id=76091 Original review http://codereview.chromium.org/6681043/ Patch by Sang Ahn git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78432 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/ppapi/ppb_graphics_2d_impl.cc')
-rw-r--r--webkit/plugins/ppapi/ppb_graphics_2d_impl.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
index efeb544..5e98f44 100644
--- a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
+++ b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
@@ -132,12 +132,15 @@ PP_Bool IsGraphics2D(PP_Resource resource) {
}
PP_Bool Describe(PP_Resource graphics_2d,
- PP_Size* size,
- PP_Bool* is_always_opaque) {
+ PP_Size* size,
+ PP_Bool* is_always_opaque) {
scoped_refptr<PPB_Graphics2D_Impl> context(
Resource::GetAs<PPB_Graphics2D_Impl>(graphics_2d));
- if (!context)
+ if (!context) {
+ *size = PP_MakeSize(0, 0);
+ *is_always_opaque = PP_FALSE;
return PP_FALSE;
+ }
return context->Describe(size, is_always_opaque);
}
@@ -680,4 +683,3 @@ bool PPB_Graphics2D_Impl::HasPendingFlush() const {
} // namespace ppapi
} // namespace webkit
-