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

Issue 2863983002: DCHECK when loading images that do not exist. (Closed)

Created:
3 years, 7 months ago by jif
Modified:
3 years, 6 months ago
CC:
chromium-reviews, marq+watch_chromium.org, ios-reviews+chrome_chromium.org, noyau+watch_chromium.org, ios-reviews_chromium.org, pkl (ping after 24h if needed)
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

DCHECK when loading images that do not exist. Enabled only in debug mode. This works by swizzling [UIImage imageNamed:] and making sure that it returns a non-nil UIImage*. BUG=718850 Review-Url: https://codereview.chromium.org/2863983002 Cr-Commit-Position: refs/heads/master@{#470887} Committed: https://chromium.googlesource.com/chromium/src/+/b75611794c4ee0538c0f62aaf75abaa409d8963d

Patch Set 1 #

Total comments: 10

Patch Set 2 : Addressed comments. #

Patch Set 3 : Ran downstream bots. Added more exceptions. Better logging. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -0 lines) Patch
M ios/chrome/app/startup/setup_debugging.mm View 1 2 2 chunks +54 lines, -0 lines 3 comments Download

Messages

Total messages: 30 (17 generated)
jif
This is a WIP. I want to know if this idea sounds good before landing ...
3 years, 7 months ago (2017-05-05 15:06:00 UTC) #4
lpromero
Looks good for the runtime approach. Could you run the trybots, EG bot, and maybe ...
3 years, 7 months ago (2017-05-05 15:24:38 UTC) #6
marq (ping after 24h)
Overall approach looks fine to me, I've added some style/clarity comments. https://codereview.chromium.org/2863983002/diff/1/ios/chrome/app/startup/setup_debugging.mm File ios/chrome/app/startup/setup_debugging.mm (right): ...
3 years, 7 months ago (2017-05-09 09:35:31 UTC) #11
sdefresne
drive-by https://codereview.chromium.org/2863983002/diff/1/ios/chrome/app/startup/setup_debugging.mm File ios/chrome/app/startup/setup_debugging.mm (right): https://codereview.chromium.org/2863983002/diff/1/ios/chrome/app/startup/setup_debugging.mm#newcode28 ios/chrome/app/startup/setup_debugging.mm:28: // The original implementation of [UIImage imageNamed:]. On ...
3 years, 7 months ago (2017-05-09 10:07:27 UTC) #12
marq (ping after 24h)
https://codereview.chromium.org/2863983002/diff/1/ios/chrome/app/startup/setup_debugging.mm File ios/chrome/app/startup/setup_debugging.mm (right): https://codereview.chromium.org/2863983002/diff/1/ios/chrome/app/startup/setup_debugging.mm#newcode28 ios/chrome/app/startup/setup_debugging.mm:28: // The original implementation of [UIImage imageNamed:]. On 2017/05/09 ...
3 years, 7 months ago (2017-05-10 12:59:11 UTC) #14
jif
thank you. ptal https://codereview.chromium.org/2863983002/diff/1/ios/chrome/app/startup/setup_debugging.mm File ios/chrome/app/startup/setup_debugging.mm (right): https://codereview.chromium.org/2863983002/diff/1/ios/chrome/app/startup/setup_debugging.mm#newcode28 ios/chrome/app/startup/setup_debugging.mm:28: // The original implementation of [UIImage ...
3 years, 7 months ago (2017-05-10 13:34:46 UTC) #15
marq (ping after 24h)
LGTM, nice tool to have. Do we load any assets using other mechanisms?
3 years, 7 months ago (2017-05-11 08:53:51 UTC) #20
jif
On 2017/05/11 08:53:51, marq (ping after 24h) wrote: > LGTM, nice tool to have. > ...
3 years, 7 months ago (2017-05-11 09:17:37 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2863983002/40001
3 years, 7 months ago (2017-05-11 09:18:56 UTC) #23
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/b75611794c4ee0538c0f62aaf75abaa409d8963d
3 years, 7 months ago (2017-05-11 09:23:01 UTC) #26
pkl (ping after 24h if needed)
https://codereview.chromium.org/2863983002/diff/40001/ios/chrome/app/startup/setup_debugging.mm File ios/chrome/app/startup/setup_debugging.mm (right): https://codereview.chromium.org/2863983002/diff/40001/ios/chrome/app/startup/setup_debugging.mm#newcode34 ios/chrome/app/startup/setup_debugging.mm:34: When I run locally in debugger, I'm getting many ...
3 years, 7 months ago (2017-05-11 22:28:41 UTC) #28
lpromero
https://codereview.chromium.org/2863983002/diff/40001/ios/chrome/app/startup/setup_debugging.mm File ios/chrome/app/startup/setup_debugging.mm (right): https://codereview.chromium.org/2863983002/diff/40001/ios/chrome/app/startup/setup_debugging.mm#newcode21 ios/chrome/app/startup/setup_debugging.mm:21: // Swizzles [UIImage imageNamed:] to trigger a DCHECK if ...
3 years, 6 months ago (2017-05-29 13:31:13 UTC) #29
jif
3 years, 6 months ago (2017-05-31 13:20:51 UTC) #30
Message was sent while issue was closed.
https://codereview.chromium.org/2863983002/diff/40001/ios/chrome/app/startup/...
File ios/chrome/app/startup/setup_debugging.mm (right):

https://codereview.chromium.org/2863983002/diff/40001/ios/chrome/app/startup/...
ios/chrome/app/startup/setup_debugging.mm:21: // Swizzles [UIImage imageNamed:]
to trigger a DCHECK if an invalid image is
On 2017/05/29 13:31:12, lpromero wrote:
> There are other methods for loading images. For example:
>
https://cs.corp.google.com/piper///depot/google3/googlemac/iPhone/Shared/SSOA...

Correct!
See https://bugs.chromium.org/p/chromium/issues/detail?id=721258

Powered by Google App Engine
This is Rietveld 408576698