Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(734)

Unified Diff: content/renderer/scoped_clipboard_writer_glue.cc

Issue 558913003: Remove clipboard argument from ScopedClipboardWriter constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't leak a clipboard on Windows Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/scoped_clipboard_writer_glue.cc
diff --git a/content/renderer/scoped_clipboard_writer_glue.cc b/content/renderer/scoped_clipboard_writer_glue.cc
index 37790375303820a3454e967d92fc245b018650dd..71471344fd5be6158acc6e62f16a9db0f1b0b028 100644
--- a/content/renderer/scoped_clipboard_writer_glue.cc
+++ b/content/renderer/scoped_clipboard_writer_glue.cc
@@ -8,17 +8,18 @@
namespace content {
ScopedClipboardWriterGlue::ScopedClipboardWriterGlue(ClipboardClient* client)
- : ui::ScopedClipboardWriter(client->GetClipboard(),
- ui::CLIPBOARD_TYPE_COPY_PASTE),
+ : ui::ScopedClipboardWriter(ui::CLIPBOARD_TYPE_COPY_PASTE),
context_(client->CreateWriteContext()) {
- // We should never have an instance where both are set.
- DCHECK((clipboard_ && !context_.get()) ||
- (!clipboard_ && context_.get()));
+ DCHECK(context_);
}
ScopedClipboardWriterGlue::~ScopedClipboardWriterGlue() {
if (!objects_.empty() && context_) {
context_->Flush(objects_);
+ // TODO(dcheng): Temporary hack while the clipboard IPCs are cleaned up.
+ // This prevents the base class destructor from also trying to (probably
+ // unsuccessfully) flush things to the clipboard.
+ objects_.clear();
}
}
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | ui/base/clipboard/clipboard_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698