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

Unified Diff: content/browser/renderer_host/clipboard_message_filter.cc

Issue 10911074: Change how ui::Clipboard is accessed so there's only one per thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes for kaiwang Created 8 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
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | content/shell/shell_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/clipboard_message_filter.cc
diff --git a/content/browser/renderer_host/clipboard_message_filter.cc b/content/browser/renderer_host/clipboard_message_filter.cc
index 1de011e2374cf4bd96633bee575b4d272706ea9b..542ec1f9c783d593ad9cec459a234bf2c696f3b8 100644
--- a/content/browser/renderer_host/clipboard_message_filter.cc
+++ b/content/browser/renderer_host/clipboard_message_filter.cc
@@ -31,8 +31,8 @@ namespace {
// clipboard's contents. // See http://crbug.com/5823.
void WriteObjectsHelper(const ui::Clipboard::ObjectMap* objects) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- static ui::Clipboard* clipboard = new ui::Clipboard;
- clipboard->WriteObjects(ui::Clipboard::BUFFER_STANDARD, *objects);
+ ui::Clipboard::GetForCurrentThread()->WriteObjects(
+ ui::Clipboard::BUFFER_STANDARD, *objects);
}
} // namespace
@@ -244,7 +244,6 @@ void ClipboardMessageFilter::OnReadCustomData(
ui::Clipboard* ClipboardMessageFilter::GetClipboard() {
// We have a static instance of the clipboard service for use by all message
// filters. This instance lives for the life of the browser processes.
- static ui::Clipboard* clipboard = new ui::Clipboard;
-
+ static ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread();
return clipboard;
}
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | content/shell/shell_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698