https://codereview.chromium.org/676083003/diff/40001/base/scoped_observer.h File base/scoped_observer.h (right): https://codereview.chromium.org/676083003/diff/40001/base/scoped_observer.h#newcode35 base/scoped_observer.h:35: DCHECK(it != sources_.end()); Looking at base/observer_list_unittest.cc, it should be ...
https://codereview.chromium.org/676083003/diff/40001/base/scoped_observer.h
File base/scoped_observer.h (right):
https://codereview.chromium.org/676083003/diff/40001/base/scoped_observer.h#n...
base/scoped_observer.h:35: DCHECK(it != sources_.end());
On 2014/10/24 19:57:29, Lei Zhang wrote:
> Looking at base/observer_list_unittest.cc, it should be ok to call
> RemoveObserver() for something that's not being observed.
True, but I think errors such as the previous one in ContentSettingsHandler
would not be detected unless a DCHECK is made.
https://codereview.chromium.org/676083003/diff/40001/chrome/browser/ui/webui/...
File chrome/browser/ui/webui/options/content_settings_handler.cc (right):
https://codereview.chromium.org/676083003/diff/40001/chrome/browser/ui/webui/...
chrome/browser/ui/webui/options/content_settings_handler.cc:542:
observer_.Remove(profile->GetHostContentSettingsMap());
On 2014/10/24 19:57:29, Lei Zhang wrote:
> Can't we potentially failed the newly added DCHECK in ScopedObserver if we:
>
> 1) Start with Profile A and Profile B, both profiles have OTR profiles.
>
> 2) At some point ContentSettingsHandler::InitializeHandler() runs with Profile
A
> as the Profile::FromWebUI() result.
>
> - |observers_| now contains Profile A and Profile A/OTR.
>
> 3) Profile B/OTR gets destroyed. This notification observer gets called.
>
> - Attempts to remove Profile B/OTR, which isn't in |observers_|.
Good catch. I've added a check.
Issue 676083003: Listen to Off The Record profiles in ContentSettingsHandler.
(Closed)
Created 6 years, 1 month ago by scheib
Modified 6 years, 1 month ago
Reviewers: Lei Zhang
Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Comments: 4