diff options
author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-29 20:40:57 +0000 |
---|---|---|
committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-29 20:40:57 +0000 |
commit | 555ec4fc25e8d48c70a3d9495f577a101541a16c (patch) | |
tree | a250321667d4e7a6af0b2eeab1507b04dad42d0a /content/renderer/pepper | |
parent | e4b66bf17bd92ac5d3aee302c3166e729fec89ed (diff) | |
download | chromium_src-555ec4fc25e8d48c70a3d9495f577a101541a16c.zip chromium_src-555ec4fc25e8d48c70a3d9495f577a101541a16c.tar.gz chromium_src-555ec4fc25e8d48c70a3d9495f577a101541a16c.tar.bz2 |
[OSX/Pepper] Don't have browser cache shmem ref behind ImageData.
On OSX the browser has to create shmem blocks for sandboxed processes.
The browser process can keep a handle for synchronizing between
processes by id, but pepper's implementation just passes the handle
between processes so that is not necessary.
Before, the browser ran out of handles which breaks all sorts of stuff, but everything kept running, with various visual glitches (and no fds in browser is really bad). With this change, the renderer crashes. That sounds bad, but is actually better in terms of resolving the underlying problems.
Also, histogram sizes for all platforms. Using a TransportDIB for
small images is probably a bad idea. The histograms should show how
things are being used in the wild.
BUG=129430
TEST=flapper works, histograms appear.
Review URL: https://chromiumcodereview.appspot.com/10424007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139366 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/pepper')
-rw-r--r-- | content/renderer/pepper/pepper_platform_image_2d_impl.cc | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/content/renderer/pepper/pepper_platform_image_2d_impl.cc b/content/renderer/pepper/pepper_platform_image_2d_impl.cc index ffea778..9971e62 100644 --- a/content/renderer/pepper/pepper_platform_image_2d_impl.cc +++ b/content/renderer/pepper/pepper_platform_image_2d_impl.cc @@ -5,6 +5,8 @@ #include "content/renderer/pepper/pepper_platform_image_2d_impl.h" #include "build/build_config.h" + +#include "base/metrics/histogram.h" #include "content/common/view_messages.h" #include "content/renderer/render_thread_impl.h" #include "ui/surface/transport_dib.h" @@ -19,20 +21,14 @@ PepperPlatformImage2DImpl::PepperPlatformImage2DImpl(int width, dib_(dib) { } -// On Mac, we have to tell the browser to free the transport DIB. PepperPlatformImage2DImpl::~PepperPlatformImage2DImpl() { -#if defined(OS_MACOSX) - if (dib_.get()) { - RenderThreadImpl::current()->Send( - new ViewHostMsg_FreeTransportDIB(dib_->id())); - } -#endif } // static PepperPlatformImage2DImpl* PepperPlatformImage2DImpl::Create(int width, int height) { uint32 buffer_size = width * height * 4; + UMA_HISTOGRAM_COUNTS("Plugin.PepperImage2DSize", buffer_size); // Allocate the transport DIB and the PlatformCanvas pointing to it. #if defined(OS_MACOSX) @@ -40,12 +36,10 @@ PepperPlatformImage2DImpl* PepperPlatformImage2DImpl::Create(int width, // work in the sandbox. Do this by sending a message to the browser // requesting a TransportDIB (see also // chrome/renderer/webplugin_delegate_proxy.cc, method - // WebPluginDelegateProxy::CreateBitmap() for similar code). The TransportDIB - // is cached in the browser, and is freed (in typical cases) by the - // PepperPlatformImage2DImpl's destructor. + // WebPluginDelegateProxy::CreateBitmap() for similar code). TransportDIB::Handle dib_handle; IPC::Message* msg = new ViewHostMsg_AllocTransportDIB(buffer_size, - true, + false, &dib_handle); if (!RenderThreadImpl::current()->Send(msg)) return NULL; |