| Index: content/renderer/pepper/pepper_platform_image_2d_impl.cc
|
| diff --git a/content/renderer/pepper/pepper_platform_image_2d_impl.cc b/content/renderer/pepper/pepper_platform_image_2d_impl.cc
|
| index ffea7783dadcdf74283aed8a6bb46bb665c0bf58..9971e6210f1c2a1d1ed1e63a75f02a7ecbf11581 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;
|
|
|