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

Issue 822083004: Mac: Fix crash when opening Incognito window (Closed)

Created:
5 years, 11 months ago by Andre
Modified:
5 years, 11 months ago
Reviewers:
Robert Sesek, Finnur
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@FirstResponder
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mac: Fix crash when opening Incognito window Regressed by https://crrev.com/de66e360e2a2944bdf71608726b19b3bf2a2a6ff. ExtensionCommandsGlobalRegistry::Get() returns null when incognito, add a check for it. BUG=450903 Committed: https://crrev.com/6fe37681decffe98d09682f52fd3b66cd90cafef Cr-Commit-Position: refs/heads/master@{#312726}

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -4 lines) Patch
M chrome/browser/ui/cocoa/browser_window_controller.mm View 2 chunks +10 lines, -4 lines 2 comments Download

Messages

Total messages: 20 (7 generated)
Andre
Robert, please review. I investigated why browser_tests did not catch this. There are tests that ...
5 years, 11 months ago (2015-01-22 21:18:40 UTC) #2
Robert Sesek
LGTM
5 years, 11 months ago (2015-01-22 21:20:16 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/822083004/1
5 years, 11 months ago (2015-01-22 21:28:54 UTC) #5
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_dbg on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_dbg/builds/35221) Try jobs failed on following ...
5 years, 11 months ago (2015-01-22 22:41:10 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/822083004/1
5 years, 11 months ago (2015-01-22 23:25:08 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_dbg on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_dbg/builds/35221) mac_chromium_rel_ng on tryserver.chromium.mac (http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/26042)
5 years, 11 months ago (2015-01-22 23:27:01 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/822083004/1
5 years, 11 months ago (2015-01-23 01:17:17 UTC) #13
commit-bot: I haz the power
Committed patchset #1 (id:1)
5 years, 11 months ago (2015-01-23 01:20:18 UTC) #14
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/6fe37681decffe98d09682f52fd3b66cd90cafef Cr-Commit-Position: refs/heads/master@{#312726}
5 years, 11 months ago (2015-01-23 01:21:05 UTC) #15
Finnur
https://codereview.chromium.org/822083004/diff/1/chrome/browser/ui/cocoa/browser_window_controller.mm File chrome/browser/ui/cocoa/browser_window_controller.mm (right): https://codereview.chromium.org/822083004/diff/1/chrome/browser/ui/cocoa/browser_window_controller.mm#newcode635 chrome/browser/ui/cocoa/browser_window_controller.mm:635: } Hmm... I'm not sure this is the right ...
5 years, 11 months ago (2015-01-23 10:49:38 UTC) #17
Andre
https://codereview.chromium.org/822083004/diff/1/chrome/browser/ui/cocoa/browser_window_controller.mm File chrome/browser/ui/cocoa/browser_window_controller.mm (right): https://codereview.chromium.org/822083004/diff/1/chrome/browser/ui/cocoa/browser_window_controller.mm#newcode635 chrome/browser/ui/cocoa/browser_window_controller.mm:635: } On 2015/01/23 10:49:38, Finnur wrote: > Hmm... I'm ...
5 years, 11 months ago (2015-01-23 18:24:01 UTC) #18
Finnur
> I'm having problem imagining the problem scenario, do you have one in mind? Possibly ...
5 years, 11 months ago (2015-01-26 09:24:54 UTC) #19
Andre
5 years, 11 months ago (2015-01-27 01:08:14 UTC) #20
Message was sent while issue was closed.
On 2015/01/26 09:24:54, Finnur wrote:
> > I'm having problem imagining the problem scenario, do you have one in mind?
> 
> Possibly (bear with me, I'll get to it). But first, lets take a step back.
> There's two ways to fix the crash you were seeing. Either add null-checks (as
> per the checked in code) or make sure the pointer is never NULL (my proposal).
> 
> I don't see an obvious benefit for the null-checks, but I see an obvious
> drawback in that there's a non-zero chance that someone will forget to add the
> check, as we've already discovered. :)
> 
> Conversely...
> 
> I don't see an obvious drawback for making sure the pointer is never NULL but
I
> see a couple of obvious benefits to doing so:
> 
> 1) We don't have to sprinkle null-checks around the code base.
> 2) We might add code in the future that relies on always having the right
> registry available to us and currently it can be wrong (when we switch to an
> incognito) or even never set (if we start Chrome in incognito).
> 
> Thinking about that last point, I don't remember if Chrome on ChromeOS can be
> started in incognito (guest mode?) but if it can then the
> RewriteWithKeyboardRemappingsByKeyCode code is going to fail to avoid
converting
> some shortcuts (see discussion in
> https://code.google.com/p/chromium/issues/detail?id=410944, which is what got
> the active-registry-tracking introduced).
> 
> So, there may be a problem today and there may be a problem in the future,
both
> of which we can avoid by making the global registry accessible to incognito
> windows.

Got it, thanks.
I think I was confused by your previous comment about disabling shortcuts for
the wrong
window, so I thought you were wanting to call set_registry_for_active_window()
with the
incognito window. (And I did not know kServiceRedirectedInIncognito is an
existing thing).
Removing the necessity to null-check SGTM, PTAL at
https://codereview.chromium.org/883553002/

Powered by Google App Engine
This is Rietveld 408576698