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

Issue 345243007: Add ScopedObjCClassSwizzler in base/mac, absorbs objc_method_swizzle and ScopedClassSwizzler (Closed)

Created:
6 years, 6 months ago by tapted
Modified:
6 years, 4 months ago
CC:
chromium-reviews, tfarina, erikwright+watch_chromium.org, tdresser+watch_chromium.org, chrome-apps-syd-reviews_chromium.org, mac-views-reviews_chromium.org, Mark Mentovai
Project:
chromium
Visibility:
Public.

Description

Add ScopedObjCClassSwizzler in base/mac, absorbs objc_method_swizzle and ScopedClassSwizzler ScopedClassSwizzler from ui/test is wanted for new tests where it can't currently be accessed. It also re-implements a concept in chrome/common/mac/objc_method_swizzle.* This change adds base::mac::ScopedObjCClassSwizzler, merges concepts from objc_method_swizzle, and adjusts chrome_browser_application_mac.mm to use the new swizzler. The test from objc_method_swizzle is adapted and extended for the scoped swizzler. BUG=378134 TEST=base_unittests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=288943

Patch Set 1 #

Patch Set 2 : Neater #

Patch Set 3 : rebase to master #

Total comments: 9

Patch Set 4 : just a rebase #

Patch Set 5 : Everything but the file moves #

Patch Set 6 : respond to comments #

Patch Set 7 : just a rebase #

Patch Set 8 : drop coord conversion test, CR_DEFINE_STATIC_LOCAL #

Patch Set 9 : git-cl-format #

Patch Set 10 : Fix EventsMacTest.ButtonEvents #

Total comments: 1

Patch Set 11 : Add overloaded constructor #

Patch Set 12 : rebase - patch conflict in event_generator_delegate_mac.mm (r288663) #

Patch Set 13 : Inlude in shiny new gn base_unittests target #

Unified diffs Side-by-side diffs Delta from patch set Stats (+312 lines, -211 lines) Patch
M base/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -0 lines 0 comments Download
M base/base.gyp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M base/base.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
A base/mac/scoped_objc_class_swizzler.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +49 lines, -0 lines 0 comments Download
A base/mac/scoped_objc_class_swizzler.mm View 1 2 3 4 5 6 7 8 9 10 1 chunk +71 lines, -0 lines 0 comments Download
A base/mac/scoped_objc_class_swizzler_unittest.mm View 1 2 3 4 5 6 7 8 9 10 1 chunk +166 lines, -0 lines 0 comments Download
M chrome/browser/chrome_browser_application_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +8 lines, -5 lines 0 comments Download
M chrome/chrome_common.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -1 line 0 comments Download
D chrome/common/mac/objc_method_swizzle.h View 1 2 3 4 1 chunk +0 lines, -27 lines 0 comments Download
D chrome/common/mac/objc_method_swizzle.mm View 1 2 3 4 1 chunk +0 lines, -57 lines 0 comments Download
M chrome/common/mac/objc_method_swizzle_unittest.mm View 1 2 3 4 5 1 chunk +0 lines, -76 lines 0 comments Download
M chrome/common/mac/objc_zombie.mm View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -1 line 0 comments Download
M ui/base/cocoa/cocoa_base_utils_unittest.mm View 1 2 3 4 2 chunks +3 lines, -2 lines 0 comments Download
M ui/events/cocoa/events_mac_unittest.mm View 1 2 3 4 5 6 7 8 9 5 chunks +6 lines, -7 lines 0 comments Download
M ui/events/test/cocoa_test_event_utils.h View 1 chunk +0 lines, -14 lines 0 comments Download
M ui/events/test/cocoa_test_event_utils.mm View 1 chunk +0 lines, -16 lines 0 comments Download
M ui/views/test/event_generator_delegate_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 35 (0 generated)
tapted
Hi Robert - please take a look. This is a follow-up to an earlier CL ...
6 years, 5 months ago (2014-07-21 07:20:52 UTC) #1
Robert Sesek
LGTM https://codereview.chromium.org/345243007/diff/80001/base/test/scoped_class_swizzler_mac.h File base/test/scoped_class_swizzler_mac.h (right): https://codereview.chromium.org/345243007/diff/80001/base/test/scoped_class_swizzler_mac.h#newcode14 base/test/scoped_class_swizzler_mac.h:14: // Within a given scope, replace the selector ...
6 years, 5 months ago (2014-07-21 15:59:02 UTC) #2
Robert Sesek
+mark for the above question on placement //base, so that you can get feedback this ...
6 years, 5 months ago (2014-07-21 16:03:14 UTC) #3
Mark Mentovai
https://codereview.chromium.org/345243007/diff/80001/base/test/scoped_class_swizzler_mac.h File base/test/scoped_class_swizzler_mac.h (right): https://codereview.chromium.org/345243007/diff/80001/base/test/scoped_class_swizzler_mac.h#newcode14 base/test/scoped_class_swizzler_mac.h:14: // Within a given scope, replace the selector |selector| ...
6 years, 5 months ago (2014-07-21 16:09:58 UTC) #4
tapted
PTAL - quite a bit changed. (Maybe it's better to land the changes under src/chrome ...
6 years, 5 months ago (2014-07-22 12:53:49 UTC) #5
tapted
On 2014/07/22 12:53:49, tapted wrote: > and it makes > ObjcEvilDoers::GetImplementedInstanceMethod() redundant, so that part ...
6 years, 5 months ago (2014-07-22 13:01:32 UTC) #6
Robert Sesek
On 2014/07/22 12:53:49, tapted wrote: > PTAL - quite a bit changed. (Maybe it's better ...
6 years, 5 months ago (2014-07-22 13:59:21 UTC) #7
tapted
On 2014/07/22 13:59:21, rsesek wrote: > On 2014/07/22 12:53:49, tapted wrote: > > PTAL - ...
6 years, 5 months ago (2014-07-22 23:41:44 UTC) #8
Robert Sesek
LGTM However it occurs to me that this is going to break the way the ...
6 years, 5 months ago (2014-07-23 14:21:00 UTC) #9
tapted
mark: wdyt? On 2014/07/23 14:21:00, rsesek wrote: > However it occurs to me that this ...
6 years, 5 months ago (2014-07-23 23:57:17 UTC) #10
tapted
On 2014/07/23 23:57:17, tapted wrote: > mark: wdyt? > > On 2014/07/23 14:21:00, rsesek wrote: ...
6 years, 5 months ago (2014-07-25 06:59:56 UTC) #11
Robert Sesek
On 2014/07/25 06:59:56, tapted wrote: > On 2014/07/23 23:57:17, tapted wrote: > > mark: wdyt? ...
6 years, 5 months ago (2014-07-25 17:21:13 UTC) #12
tapted
mark: (ping) what do you think is the best way to proceed? I think we ...
6 years, 4 months ago (2014-07-28 23:03:01 UTC) #13
Robert Sesek
On 2014/07/25 17:21:13, rsesek wrote: > On 2014/07/25 06:59:56, tapted wrote: > > On 2014/07/23 ...
6 years, 4 months ago (2014-07-29 01:46:36 UTC) #14
Mark Mentovai
Robert’s suggestion, the one to use two Class-SEL pairs, is the most general and sounds ...
6 years, 4 months ago (2014-07-29 12:58:59 UTC) #15
tapted
PTAL - I've added the constructor overload, some extra tests, and rolled back some of ...
6 years, 4 months ago (2014-07-31 13:01:33 UTC) #16
Robert Sesek
LGTM!
6 years, 4 months ago (2014-07-31 13:57:00 UTC) #17
Mark Mentovai
LGTM
6 years, 4 months ago (2014-07-31 14:07:26 UTC) #18
tapted
+sky for OWNERS in ui/events/* and chrome/browser/chrome_browser_application_mac.mm
6 years, 4 months ago (2014-07-31 23:32:15 UTC) #19
sky
LGTM
6 years, 4 months ago (2014-08-04 19:44:20 UTC) #20
tapted
The CQ bit was checked by tapted@chromium.org
6 years, 4 months ago (2014-08-04 23:16:01 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tapted@chromium.org/345243007/480001
6 years, 4 months ago (2014-08-04 23:19:17 UTC) #22
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: chromium_presubmit on tryserver.chromium.linux ...
6 years, 4 months ago (2014-08-05 01:13:22 UTC) #23
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-05 01:16:44 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/1969)
6 years, 4 months ago (2014-08-05 01:16:45 UTC) #25
tapted
The following should be fixed by r288888, so I'm giving this a crack at the ...
6 years, 4 months ago (2014-08-12 03:24:41 UTC) #26
tapted
The CQ bit was checked by tapted@chromium.org
6 years, 4 months ago (2014-08-12 03:25:02 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tapted@chromium.org/345243007/480001
6 years, 4 months ago (2014-08-12 03:27:57 UTC) #28
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: chromium_presubmit on tryserver.chromium.linux ...
6 years, 4 months ago (2014-08-12 03:32:22 UTC) #29
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-12 03:34:25 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_swarming on tryserver.chromium.mac (http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_swarming/builds/2066)
6 years, 4 months ago (2014-08-12 03:34:27 UTC) #31
tapted
The CQ bit was checked by tapted@chromium.org
6 years, 4 months ago (2014-08-12 04:57:35 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tapted@chromium.org/345243007/520001
6 years, 4 months ago (2014-08-12 04:58:01 UTC) #33
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_chromium_x64_rel on tryserver.chromium.win ...
6 years, 4 months ago (2014-08-12 09:50:38 UTC) #34
commit-bot: I haz the power
6 years, 4 months ago (2014-08-12 12:03:55 UTC) #35
Message was sent while issue was closed.
Change committed as 288943

Powered by Google App Engine
This is Rietveld 408576698