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

Unified Diff: content/browser/renderer_host/clipboard_message_filter_mac.mm

Issue 8634002: Revert 111080 - Remove Task inheritance in clipboard code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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/renderer_host/clipboard_message_filter.cc ('k') | ui/base/clipboard/clipboard.h » ('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_mac.mm
===================================================================
--- content/browser/renderer_host/clipboard_message_filter_mac.mm (revision 111082)
+++ content/browser/renderer_host/clipboard_message_filter_mac.mm (working copy)
@@ -6,25 +6,20 @@
#import <Cocoa/Cocoa.h>
-#include "base/basictypes.h"
-#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/sys_string_conversions.h"
#import "content/browser/find_pasteboard.h"
#include "content/public/browser/browser_thread.h"
using content::BrowserThread;
-namespace {
-
// The number of utf16 code units that will be written to the find pasteboard,
// longer texts are silently ignored. This is to prevent that a compromised
// renderer can write unlimited amounts of data into the find pasteboard.
static const size_t kMaxFindPboardStringLength = 4096;
-class WriteFindPboardWrapper {
+class WriteFindPboardTask : public Task {
public:
- explicit WriteFindPboardWrapper(NSString* text)
+ explicit WriteFindPboardTask(NSString* text)
: text_([text retain]) {}
void Run() {
@@ -33,12 +28,8 @@
private:
scoped_nsobject<NSString> text_;
-
- DISALLOW_COPY_AND_ASSIGN(WriteFindPboardWrapper);
};
-} // namespace
-
// Called on the IO thread.
void ClipboardMessageFilter::OnFindPboardWriteString(const string16& text) {
if (text.length() <= kMaxFindPboardStringLength) {
@@ -46,9 +37,7 @@
if (nsText) {
// FindPasteboard must be used on the UI thread.
BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE, base::Bind(
- &WriteFindPboardWrapper::Run,
- base::Owned(new WriteFindPboardWrapper(nsText))));
+ BrowserThread::UI, FROM_HERE, new WriteFindPboardTask(nsText));
}
}
}
« no previous file with comments | « content/browser/renderer_host/clipboard_message_filter.cc ('k') | ui/base/clipboard/clipboard.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698