Commit 3f2ee71b authored by Greg Thompson's avatar Greg Thompson Committed by Commit Bot

Avoid using DictionaryPrefUpdate for read-only pref ops.

ExternalProtocolHandler::GetBlockState queries for a value in a dict
pref. Previously, it was using DictionaryPrefUpdate to get the
dict. This causes the pref file to be written out in its dtor. This CL
switches to ordinary read-only ops to avoid spurious pref file writes.

BUG=none
R=benwells@chromium.org

Change-Id: I9a42441cdee70e7bd9b0f67afefb67d411bef2dd
Reviewed-on: https://chromium-review.googlesource.com/c/1298715Reviewed-by: default avatarBen Wells <benwells@chromium.org>
Commit-Queue: Greg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603041}
parent d782b715
......@@ -188,8 +188,8 @@ ExternalProtocolHandler::BlockState ExternalProtocolHandler::GetBlockState(
PrefService* profile_prefs = profile->GetPrefs();
if (profile_prefs) { // May be NULL during testing.
DictionaryPrefUpdate update_excluded_schemas_profile(
profile_prefs, prefs::kExcludedSchemes);
const base::DictionaryValue* update_excluded_schemas_profile =
profile_prefs->GetDictionary(prefs::kExcludedSchemes);
bool should_block;
// Ignore stored block decisions. These are now not possible through the UI,
// and previous block decisions should be ignored to allow users to recover
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment