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

Unified Diff: ui/base/clipboard/clipboard_util_mac.h

Issue 1852433004: Fix NSPasteboard leaks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile error. Created 4 years, 9 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/common/sandbox_mac_system_access_unittest.mm ('k') | ui/base/clipboard/clipboard_util_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/clipboard/clipboard_util_mac.h
diff --git a/ui/base/clipboard/clipboard_util_mac.h b/ui/base/clipboard/clipboard_util_mac.h
index 79a2a6910be3d308c0cee49674ebed8a8cc0e37f..2bb6edaf36eb5b875ef239efb8fee16ab7182895 100644
--- a/ui/base/clipboard/clipboard_util_mac.h
+++ b/ui/base/clipboard/clipboard_util_mac.h
@@ -8,10 +8,24 @@
#import <AppKit/AppKit.h>
#include "base/mac/scoped_nsobject.h"
+#include "base/memory/ref_counted.h"
#include "ui/base/ui_base_export.h"
namespace ui {
+class UI_BASE_EXPORT UniquePasteboard
+ : public base::RefCounted<UniquePasteboard> {
+ public:
+ UniquePasteboard();
+
+ NSPasteboard* get() { return pasteboard_; }
+
+ private:
+ friend class base::RefCounted<UniquePasteboard>;
+ ~UniquePasteboard();
+ base::scoped_nsobject<NSPasteboard> pasteboard_;
+};
+
class UI_BASE_EXPORT ClipboardUtil {
public:
// Returns an NSPasteboardItem that represents the given |url|.
« no previous file with comments | « content/common/sandbox_mac_system_access_unittest.mm ('k') | ui/base/clipboard/clipboard_util_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698