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

Unified Diff: ui/events/test/cocoa_test_event_utils.mm

Issue 345243007: Add ScopedObjCClassSwizzler in base/mac, absorbs objc_method_swizzle and ScopedClassSwizzler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Inlude in shiny new gn base_unittests target Created 6 years, 4 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 | « ui/events/test/cocoa_test_event_utils.h ('k') | ui/views/test/event_generator_delegate_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/test/cocoa_test_event_utils.mm
diff --git a/ui/events/test/cocoa_test_event_utils.mm b/ui/events/test/cocoa_test_event_utils.mm
index 4f0cb67de0deaf7c190a7427875ab99785003e6b..2694b84e1d552ef1dd5575a881a08dc11933c303 100644
--- a/ui/events/test/cocoa_test_event_utils.mm
+++ b/ui/events/test/cocoa_test_event_utils.mm
@@ -6,22 +6,6 @@
#include "ui/events/test/cocoa_test_event_utils.h"
-ScopedClassSwizzler::ScopedClassSwizzler(Class target, Class source,
- SEL selector) {
- old_selector_impl_ = class_getInstanceMethod(target, selector);
- new_selector_impl_ = class_getInstanceMethod(source, selector);
- if (!old_selector_impl_ && !new_selector_impl_) {
- // Try class methods.
- old_selector_impl_ = class_getClassMethod(target, selector);
- new_selector_impl_ = class_getClassMethod(source, selector);
- }
- method_exchangeImplementations(old_selector_impl_, new_selector_impl_);
-}
-
-ScopedClassSwizzler::~ScopedClassSwizzler() {
- method_exchangeImplementations(old_selector_impl_, new_selector_impl_);
-}
-
namespace cocoa_test_event_utils {
NSEvent* MouseEventAtPoint(NSPoint point, NSEventType type,
« no previous file with comments | « ui/events/test/cocoa_test_event_utils.h ('k') | ui/views/test/event_generator_delegate_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698