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

Unified Diff: chrome/browser/renderer_host/resource_message_filter_mac.mm

Issue 5745006: Rename the OS specific ResourceMessageFilter files as well. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years 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: chrome/browser/renderer_host/resource_message_filter_mac.mm
===================================================================
--- chrome/browser/renderer_host/resource_message_filter_mac.mm (revision 69076)
+++ chrome/browser/renderer_host/resource_message_filter_mac.mm (working copy)
@@ -1,43 +0,0 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/renderer_host/render_message_filter.h"
-
-#import <Cocoa/Cocoa.h>
-
-#include "base/message_loop.h"
-#include "base/sys_string_conversions.h"
-#include "chrome/browser/browser_thread.h"
-#import "chrome/browser/ui/cocoa/find_pasteboard.h"
-
-// 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 WriteFindPboardTask : public Task {
- public:
- explicit WriteFindPboardTask(NSString* text)
- : text_([text retain]) {}
-
- void Run() {
- [[FindPasteboard sharedInstance] setFindText:text_];
- }
-
- private:
- scoped_nsobject<NSString> text_;
-};
-
-// Called on the IO thread.
-void RenderMessageFilter::OnClipboardFindPboardWriteString(
- const string16& text) {
- if (text.length() <= kMaxFindPboardStringLength) {
- NSString* nsText = base::SysUTF16ToNSString(text);
- if (nsText) {
- // FindPasteboard must be used on the UI thread.
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE, new WriteFindPboardTask(nsText));
- }
- }
-}

Powered by Google App Engine
This is Rietveld 408576698