diff options
author | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-25 10:31:03 +0000 |
---|---|---|
committer | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-25 10:31:03 +0000 |
commit | 4260c386f35b3b99fbcd1a97a67eab3eb5d8b86a (patch) | |
tree | ddbb28b031e1517c56a15f48665724d9cf7e2b68 /content/renderer/renderer_clipboard_client.cc | |
parent | 5e6fd2084d754ab8b4308352a648c91976b80eeb (diff) | |
download | chromium_src-4260c386f35b3b99fbcd1a97a67eab3eb5d8b86a.zip chromium_src-4260c386f35b3b99fbcd1a97a67eab3eb5d8b86a.tar.gz chromium_src-4260c386f35b3b99fbcd1a97a67eab3eb5d8b86a.tar.bz2 |
Fix leak in ScopedClipboardWriterGlue.
BUG=123117
TEST=none
Review URL: http://codereview.chromium.org/10078001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133890 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/renderer_clipboard_client.cc')
-rw-r--r-- | content/renderer/renderer_clipboard_client.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/content/renderer/renderer_clipboard_client.cc b/content/renderer/renderer_clipboard_client.cc index 7f496b9..d04628e 100644 --- a/content/renderer/renderer_clipboard_client.cc +++ b/content/renderer/renderer_clipboard_client.cc @@ -30,7 +30,7 @@ class RendererClipboardWriteContext : virtual void WriteBitmapFromPixels(ui::Clipboard::ObjectMap* objects, const void* pixels, const gfx::Size& size); - virtual void FlushAndDestroy(const ui::Clipboard::ObjectMap& objects); + virtual void Flush(const ui::Clipboard::ObjectMap& objects); private: scoped_ptr<base::SharedMemory> shared_buf_; @@ -80,12 +80,9 @@ void RendererClipboardWriteContext::WriteBitmapFromPixels( (*objects)[ui::Clipboard::CBF_SMBITMAP] = params; } -// Define a destructor that makes IPCs to flush the contents to the -// system clipboard. -void RendererClipboardWriteContext::FlushAndDestroy( +// Flushes the objects to the clipboard with an IPC. +void RendererClipboardWriteContext::Flush( const ui::Clipboard::ObjectMap& objects) { - scoped_ptr<RendererClipboardWriteContext> delete_on_return(this); - if (shared_buf_.get()) { RenderThreadImpl::current()->Send( new ClipboardHostMsg_WriteObjectsSync(objects, shared_buf_->handle())); |