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

Issue 1380083005: Mac: Use [NSArray firstObject] for [NSScreen screens] (Closed)

Created:
5 years, 2 months ago by ccameron
Modified:
5 years, 2 months ago
Reviewers:
Avi (use Gerrit), sky
CC:
chromium-reviews, yusukes+watch_chromium.org, dcheng, bondd+autofillwatch_chromium.org, jdduke+watch_chromium.org, tapted, tdanderson+views_chromium.org, Matt Giuca, jam, nona+watch_chromium.org, darin-cc_chromium.org, jennb, tdresser+watch_chromium.org, rouslan+autofill_chromium.org, mlamouri+watch-notifications_chromium.org, jianli, tfarina, shuchen+watch_chromium.org, Dmitry Titov, jdonnelly+autofillwatch_chromium.org, estade+watch_chromium.org, peter+watch_chromium.org, James Su
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mac: Use [NSArray firstObject] for [NSScreen screens] Crash reports indicate that the array is at times empty. Use firstObject instead of objectAtIndex:0, because firstObject will return nil instead of raising an exception. BUG=529723 Committed: https://crrev.com/741debced2db082f4921d7a46f79d81e47caaada Cr-Commit-Position: refs/heads/master@{#352915}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -37 lines) Patch
M chrome/browser/ui/app_list/app_list_service_mac.mm View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm View 4 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/cocoa/autofill/autofill_popup_base_view_cocoa.mm View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/autofill/autofill_section_container.mm View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/browser_window_cocoa.mm View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_controller_private.mm View 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/panels/panel_utils_cocoa.mm View 3 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/cocoa/presentation_mode_controller.mm View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/window_sizer/window_sizer_mac.mm View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/input/web_input_event_builders_mac.mm View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.mm View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/web_contents/web_contents_view_mac.mm View 1 chunk +1 line, -1 line 0 comments Download
M content/public/test/content_browser_test_utils_mac.mm View 1 chunk +1 line, -1 line 0 comments Download
M ui/base/test/ui_controls_mac.mm View 1 chunk +1 line, -1 line 0 comments Download
M ui/events/cocoa/events_mac_unittest.mm View 1 chunk +1 line, -1 line 0 comments Download
M ui/gfx/color_profile_mac_unittest.mm View 1 chunk +1 line, -1 line 0 comments Download
M ui/gfx/mac/coordinate_conversion.mm View 1 chunk +1 line, -1 line 0 comments Download
M ui/gfx/mac/coordinate_conversion_unittest.mm View 2 chunks +2 lines, -2 lines 0 comments Download
M ui/gfx/screen_mac.mm View 4 chunks +4 lines, -4 lines 0 comments Download
M ui/message_center/cocoa/popup_collection.mm View 1 chunk +1 line, -1 line 0 comments Download
M ui/snapshot/snapshot_mac.mm View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/event_monitor_mac.mm View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/widget/native_widget_mac_unittest.mm View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 26 (5 generated)
ccameron
Search-replace for this particular instance. The calls to objectAtIndex:0 seem to be used for geometry ...
5 years, 2 months ago (2015-10-05 18:56:23 UTC) #2
Avi (use Gerrit)
lgtm
5 years, 2 months ago (2015-10-05 19:09:05 UTC) #3
ccameron
Thanks!
5 years, 2 months ago (2015-10-05 19:17:24 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1380083005/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1380083005/1
5 years, 2 months ago (2015-10-05 19:20:22 UTC) #6
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/106775)
5 years, 2 months ago (2015-10-05 19:51:11 UTC) #8
ccameron
Adding sky@ for stamp on chrome/browser/ui
5 years, 2 months ago (2015-10-05 20:28:31 UTC) #9
ccameron
Adding sky@ for stamp, for real this time.
5 years, 2 months ago (2015-10-07 00:48:28 UTC) #11
sky
LGTM
5 years, 2 months ago (2015-10-07 01:46:12 UTC) #12
sky
Actually, NOT LGTM. Yes, this means objectAtIndex won't crash, but it isn't obvious that you ...
5 years, 2 months ago (2015-10-07 01:48:51 UTC) #13
ccameron
On 2015/10/07 01:48:51, sky wrote: > Actually, NOT LGTM. > Yes, this means objectAtIndex won't ...
5 years, 2 months ago (2015-10-07 06:39:50 UTC) #14
sky
On 2015/10/07 06:39:50, ccameron wrote: > On 2015/10/07 01:48:51, sky wrote: > > Actually, NOT ...
5 years, 2 months ago (2015-10-07 15:45:05 UTC) #15
sky
On 2015/10/07 15:45:05, sky wrote: > On 2015/10/07 06:39:50, ccameron wrote: > > On 2015/10/07 ...
5 years, 2 months ago (2015-10-07 15:45:36 UTC) #16
ccameron
On 2015/10/07 15:45:36, sky wrote: > On 2015/10/07 15:45:05, sky wrote: > > On 2015/10/07 ...
5 years, 2 months ago (2015-10-07 16:37:13 UTC) #17
sky
I'm not arguing that crashing is good. I'm arguing that if screens is empty it ...
5 years, 2 months ago (2015-10-07 17:52:04 UTC) #18
sky
On 2015/10/07 17:52:04, sky wrote: > I'm not arguing that crashing is good. I'm arguing ...
5 years, 2 months ago (2015-10-07 17:53:36 UTC) #19
ccameron
On 2015/10/07 17:53:36, sky wrote: > On 2015/10/07 17:52:04, sky wrote: > > I'm not ...
5 years, 2 months ago (2015-10-07 18:49:47 UTC) #20
sky
Ok, LGTM
5 years, 2 months ago (2015-10-07 18:52:05 UTC) #21
ccameron
Thanks!
5 years, 2 months ago (2015-10-07 18:55:00 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1380083005/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1380083005/1
5 years, 2 months ago (2015-10-07 18:57:55 UTC) #24
commit-bot: I haz the power
Committed patchset #1 (id:1)
5 years, 2 months ago (2015-10-07 19:42:30 UTC) #25
commit-bot: I haz the power
5 years, 2 months ago (2015-10-07 19:43:57 UTC) #26
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/741debced2db082f4921d7a46f79d81e47caaada
Cr-Commit-Position: refs/heads/master@{#352915}

Powered by Google App Engine
This is Rietveld 408576698