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

Issue 2796783002: [Ext Registry] Do not try to re-watch registry if we are already watching it. (Closed)

Created:
3 years, 8 months ago by lazyboy
Modified:
3 years, 8 months ago
Reviewers:
Devlin
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Ext Registry] Do not try to re-watch registry if we are already watching it. Firstly, registry observer/watcher is already set up, then we do not need to observe that again. Because we didn't use to call ExternalLoader::StartLoading more than once before https://crrev.com/2336403002, this wan't an issue when we added registry watching code. After we started calling StartLoading > 1nce, we unintentionally started retrying to observe windows registry if previous observing failed for some reason. This CL also removes this hard-to-explain retry. The reasoning is that if we want to retry observing registry, we should be doing that explicitly (and periodically?) and not rely on whether additional StartLoading was called or not. Secondly, RegKey::Watcher fails a DCHECK if we want to re-observe using same RegKey. This is DCHECK(callback_.is_null()) in RegKey::Watcher::StartWatching. BUG=653045 Test=On windows, make chrome have a policy forced extension installed. Shut down chrome. Manually corrupt the policy installed extension. Re-laucnch chrome in debug mode: observe no more DCHECK failures. Review-Url: https://codereview.chromium.org/2796783002 Cr-Commit-Position: refs/heads/master@{#461903} Committed: https://chromium.googlesource.com/chromium/src/+/36920277941e915314f558ada0a27236c633f751

Patch Set 1 #

Total comments: 4

Patch Set 2 : add test #

Total comments: 2

Patch Set 3 : revert retrying + add assert #

Unified diffs Side-by-side diffs Delta from patch set Stats (+93 lines, -4 lines) Patch
M chrome/browser/extensions/external_registry_loader_win.h View 1 2 1 chunk +6 lines, -3 lines 0 comments Download
M chrome/browser/extensions/external_registry_loader_win.cc View 1 2 3 chunks +9 lines, -1 line 0 comments Download
A chrome/browser/extensions/external_registry_loader_win_unittest.cc View 1 2 1 chunk +74 lines, -0 lines 0 comments Download
M chrome/test/BUILD.gn View 1 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (12 generated)
lazyboy
3 years, 8 months ago (2017-04-04 01:27:29 UTC) #2
Devlin
Any chance of a test? :) https://codereview.chromium.org/2796783002/diff/1/chrome/browser/extensions/external_registry_loader_win.cc File chrome/browser/extensions/external_registry_loader_win.cc (right): https://codereview.chromium.org/2796783002/diff/1/chrome/browser/extensions/external_registry_loader_win.cc#newcode208 chrome/browser/extensions/external_registry_loader_win.cc:208: if (!is_watching_hklm_) { ...
3 years, 8 months ago (2017-04-04 01:44:07 UTC) #3
lazyboy
Added a unit test. Ideally, ContentVerifierPolicyTest.PolicyCorruption* test would have covered this restart after corruption case, ...
3 years, 8 months ago (2017-04-04 18:45:10 UTC) #4
Devlin
https://codereview.chromium.org/2796783002/diff/1/chrome/browser/extensions/external_registry_loader_win.cc File chrome/browser/extensions/external_registry_loader_win.cc (right): https://codereview.chromium.org/2796783002/diff/1/chrome/browser/extensions/external_registry_loader_win.cc#newcode208 chrome/browser/extensions/external_registry_loader_win.cc:208: if (!is_watching_hklm_) { On 2017/04/04 18:45:10, lazyboy wrote: > ...
3 years, 8 months ago (2017-04-04 20:48:36 UTC) #5
lazyboy
https://codereview.chromium.org/2796783002/diff/1/chrome/browser/extensions/external_registry_loader_win.cc File chrome/browser/extensions/external_registry_loader_win.cc (right): https://codereview.chromium.org/2796783002/diff/1/chrome/browser/extensions/external_registry_loader_win.cc#newcode208 chrome/browser/extensions/external_registry_loader_win.cc:208: if (!is_watching_hklm_) { On 2017/04/04 20:48:35, Devlin wrote: > ...
3 years, 8 months ago (2017-04-04 21:47:23 UTC) #8
Devlin
lgtm
3 years, 8 months ago (2017-04-04 22:34:38 UTC) #13
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/2796783002/80001
3 years, 8 months ago (2017-04-04 23:42:34 UTC) #17
commit-bot: I haz the power
3 years, 8 months ago (2017-04-04 23:52:47 UTC) #20
Message was sent while issue was closed.
Committed patchset #3 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/36920277941e915314f558ada0a2...

Powered by Google App Engine
This is Rietveld 408576698