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

Issue 2028823003: Mac: Make ScopedTypeRef require explicit constructors (Closed)

Created:
4 years, 6 months ago by ccameron
Modified:
4 years, 6 months ago
CC:
chromium-apps-reviews_chromium.org, chromium-reviews, estade+watch_chromium.org, extensions-reviews_chromium.org, gcasto+watchlist_chromium.org, jdonnelly+autofillwatch_chromium.org, jlebel, mkwst+watchlist-passwords_chromium.org, mlamouri+watch-notifications_chromium.org, noyau+watch_chromium.org, ortuno+watch_chromium.org, Peter Beverloo, rouslan+autofill_chromium.org, scheib+watch_chromium.org, sdefresne+watch_chromium.org, tfarina, vabr+watchlistautofill_chromium.org, vabr+watchlistpasswordmanager_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mac: Make ScopedTypeRef require explicit constructors Style guide requires explicit constructors. Prior to this patch, a T* can be passed into a function that requires a scoped_nsobject<T>, and the object will be released but not retained. Also make the copy constructor that takes a different typename more generic, allowing for different types (e.g, subclasses) in addition to different traits. Clean up all instances where we relied on this behavior. BUG= Committed: https://crrev.com/1c9b983a8576851000408b49bf73090c4986240a Cr-Commit-Position: refs/heads/master@{#397847}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Rebase #

Total comments: 7

Patch Set 3 : Fix iOS build #

Total comments: 1

Patch Set 4 : Remove retain #

Total comments: 6

Patch Set 5 : Re-add retain #

Patch Set 6 : Fix ChooserDialogCocoa default values (not needed) #

Patch Set 7 : Fix new instances #

Patch Set 8 : Fix new instance in unittest #

Patch Set 9 : Remove dependency #

Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -44 lines) Patch
M base/mac/scoped_typeref.h View 2 chunks +5 lines, -7 lines 0 comments Download
M chrome/browser/local_discovery/service_discovery_client_mac_unittest.mm View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/notifications/notification_builder_mac.mm View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.mm View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/extensions/chooser_dialog_cocoa.h View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/fullscreen_low_power_coordinator.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/new_tab_button.mm View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.mm View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/tabs/tab_view.mm View 1 1 chunk +3 lines, -4 lines 0 comments Download
M chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm View 1 2 chunks +6 lines, -6 lines 0 comments Download
M components/bookmarks/browser/bookmark_pasteboard_helper_mac.mm View 1 chunk +1 line, -1 line 0 comments Download
M device/bluetooth/test/bluetooth_test_mac.mm View 1 2 3 4 5 2 chunks +7 lines, -5 lines 0 comments Download
M device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M ios/chrome/browser/passwords/password_controller_unittest.mm View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/web/web_state/web_state_delegate_bridge_unittest.mm View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 42 (15 generated)
ccameron
Adding mark@ for base/mac/ review. Need OWNERs from: sky@: chrome/, components/bookmarks/ eugenebut@: ios/ reillyg@: device/ ...
4 years, 6 months ago (2016-06-01 00:39:11 UTC) #2
Eugene But (OOO till 7-30)
FYI: ios fails to compile
4 years, 6 months ago (2016-06-01 01:00:16 UTC) #3
Reilly Grant (use Gerrit)
https://codereview.chromium.org/2028823003/diff/20001/device/bluetooth/test/bluetooth_test_mac.mm File device/bluetooth/test/bluetooth_test_mac.mm (right): https://codereview.chromium.org/2028823003/diff/20001/device/bluetooth/test/bluetooth_test_mac.mm#newcode56 device/bluetooth/test/bluetooth_test_mac.mm:56: return scoped_nsobject<NSDictionary>([advertisement_data retain]); I believe this retain was and ...
4 years, 6 months ago (2016-06-01 01:05:15 UTC) #4
ccameron
Thanks! Fixed the remaining iOS failure. https://codereview.chromium.org/2028823003/diff/20001/device/bluetooth/test/bluetooth_test_mac.mm File device/bluetooth/test/bluetooth_test_mac.mm (right): https://codereview.chromium.org/2028823003/diff/20001/device/bluetooth/test/bluetooth_test_mac.mm#newcode56 device/bluetooth/test/bluetooth_test_mac.mm:56: return scoped_nsobject<NSDictionary>([advertisement_data retain]); ...
4 years, 6 months ago (2016-06-01 01:59:31 UTC) #5
ortuno
cc: jlebel who manages bluetooth's osx code
4 years, 6 months ago (2016-06-01 02:43:53 UTC) #7
jlebel
lgtm LGTM https://codereview.chromium.org/2028823003/diff/60001/device/bluetooth/test/bluetooth_test_mac.mm File device/bluetooth/test/bluetooth_test_mac.mm (right): https://codereview.chromium.org/2028823003/diff/60001/device/bluetooth/test/bluetooth_test_mac.mm#newcode44 device/bluetooth/test/bluetooth_test_mac.mm:44: scoped_nsobject<NSDictionary> CreateAdvertisementData(NSString* name, Nit: Since there is ...
4 years, 6 months ago (2016-06-01 02:50:02 UTC) #9
sky
https://codereview.chromium.org/2028823003/diff/60001/chrome/browser/local_discovery/service_discovery_client_mac_unittest.mm File chrome/browser/local_discovery/service_discovery_client_mac_unittest.mm (right): https://codereview.chromium.org/2028823003/diff/60001/chrome/browser/local_discovery/service_discovery_client_mac_unittest.mm#newcode143 chrome/browser/local_discovery/service_discovery_client_mac_unittest.mm:143: base::scoped_nsobject<NSNetService>(test_service)); Is it worth a template like WrapUnique so ...
4 years, 6 months ago (2016-06-01 03:35:33 UTC) #10
Eugene But (OOO till 7-30)
ios lgtm, but I think you have a crash now... https://codereview.chromium.org/2028823003/diff/20001/device/bluetooth/test/bluetooth_test_mac.mm File device/bluetooth/test/bluetooth_test_mac.mm (right): https://codereview.chromium.org/2028823003/diff/20001/device/bluetooth/test/bluetooth_test_mac.mm#newcode56 ...
4 years, 6 months ago (2016-06-01 05:12:07 UTC) #11
Reilly Grant (use Gerrit)
https://codereview.chromium.org/2028823003/diff/20001/device/bluetooth/test/bluetooth_test_mac.mm File device/bluetooth/test/bluetooth_test_mac.mm (right): https://codereview.chromium.org/2028823003/diff/20001/device/bluetooth/test/bluetooth_test_mac.mm#newcode56 device/bluetooth/test/bluetooth_test_mac.mm:56: return scoped_nsobject<NSDictionary>([advertisement_data retain]); I only pretend to understand Objective-C ...
4 years, 6 months ago (2016-06-01 15:34:43 UTC) #12
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2028823003/diff/20001/device/bluetooth/test/bluetooth_test_mac.mm File device/bluetooth/test/bluetooth_test_mac.mm (right): https://codereview.chromium.org/2028823003/diff/20001/device/bluetooth/test/bluetooth_test_mac.mm#newcode56 device/bluetooth/test/bluetooth_test_mac.mm:56: return scoped_nsobject<NSDictionary>([advertisement_data retain]); On 2016/06/01 15:34:42, Reilly Grant wrote: ...
4 years, 6 months ago (2016-06-01 15:58:35 UTC) #13
jlebel
https://codereview.chromium.org/2028823003/diff/20001/device/bluetooth/test/bluetooth_test_mac.mm File device/bluetooth/test/bluetooth_test_mac.mm (right): https://codereview.chromium.org/2028823003/diff/20001/device/bluetooth/test/bluetooth_test_mac.mm#newcode56 device/bluetooth/test/bluetooth_test_mac.mm:56: return scoped_nsobject<NSDictionary>([advertisement_data retain]); On 2016/06/01 15:58:35, Eugene But wrote: ...
4 years, 6 months ago (2016-06-02 23:07:34 UTC) #14
ccameron
Updated -- ptal https://codereview.chromium.org/2028823003/diff/20001/device/bluetooth/test/bluetooth_test_mac.mm File device/bluetooth/test/bluetooth_test_mac.mm (right): https://codereview.chromium.org/2028823003/diff/20001/device/bluetooth/test/bluetooth_test_mac.mm#newcode56 device/bluetooth/test/bluetooth_test_mac.mm:56: return scoped_nsobject<NSDictionary>([advertisement_data retain]); On 2016/06/01 15:58:35, ...
4 years, 6 months ago (2016-06-02 23:11:19 UTC) #15
Eugene But (OOO till 7-30)
lgtm for memory management fix
4 years, 6 months ago (2016-06-02 23:19:04 UTC) #16
Mark Mentovai
LGTM
4 years, 6 months ago (2016-06-03 00:01:40 UTC) #17
sky
LGTM
4 years, 6 months ago (2016-06-03 15:11:20 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2028823003/80001
4 years, 6 months ago (2016-06-03 17:04:56 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/194806)
4 years, 6 months ago (2016-06-03 17:13:37 UTC) #23
ccameron
On 2016/06/01 02:43:53, ortuno wrote: > cc: jlebel who manages bluetooth's osx code ortuno@, I ...
4 years, 6 months ago (2016-06-03 17:16:07 UTC) #24
ortuno
device/bluetooth lgtm. jlebel is not a committer yet. Once he is, we'll add him to ...
4 years, 6 months ago (2016-06-03 17:20:10 UTC) #25
ccameron
Ah, I see. Thanks!
4 years, 6 months ago (2016-06-03 17:25:02 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2028823003/100001
4 years, 6 months ago (2016-06-03 17:32:26 UTC) #29
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_gn_rel on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_gn_rel/builds/121981)
4 years, 6 months ago (2016-06-03 17:51:31 UTC) #31
ccameron
On 2016/06/03 17:51:31, commit-bot: I haz the power wrote: > Try jobs failed on following ...
4 years, 6 months ago (2016-06-03 20:33:03 UTC) #32
commit-bot: I haz the power
This CL has an open dependency (Issue 2028823003 Patch 120001). Please resolve the dependency and ...
4 years, 6 months ago (2016-06-03 22:23:01 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2028823003/160001
4 years, 6 months ago (2016-06-03 22:25:22 UTC) #39
commit-bot: I haz the power
Committed patchset #9 (id:160001)
4 years, 6 months ago (2016-06-03 23:54:25 UTC) #40
commit-bot: I haz the power
4 years, 6 months ago (2016-06-03 23:57:43 UTC) #42
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/1c9b983a8576851000408b49bf73090c4986240a
Cr-Commit-Position: refs/heads/master@{#397847}

Powered by Google App Engine
This is Rietveld 408576698