Commit e72a3130 authored by Sam McNally's avatar Sam McNally Committed by Commit Bot

Don't request the default pref store from the pref service.

The browser already has all the defaults and ignores the returned pref
store connection so this is just wasting time at startup.

Bug: 654988
Change-Id: I05a6af935fd44f5ea9d37cef71e3acf3d782e4d4
Reviewed-on: https://chromium-review.googlesource.com/494407Reviewed-by: default avatarBernhard Bauer <bauerb@chromium.org>
Commit-Queue: Sam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#468935}
parent a289707c
......@@ -814,7 +814,12 @@ std::set<PrefValueStore::PrefStoreType> ExpectedPrefStores() {
std::set<PrefValueStore::PrefStoreType> InProcessPrefStores() {
auto pref_stores = ExpectedPrefStores();
pref_stores.erase(PrefValueStore::DEFAULT_STORE);
// Until we have a distinction between owned and unowned prefs, we always have
// default values for all prefs locally. Since we already have the defaults it
// would be wasteful to request them from the service by connecting to the
// DEFAULT_STORE.
// TODO(sammc): Once we have this distinction, connect to the default pref
// store here (by erasing it from |pref_stores|).
pref_stores.erase(PrefValueStore::USER_STORE);
return pref_stores;
}
......
......@@ -76,6 +76,13 @@ void ConnectionBarrier::Create(
void ConnectionBarrier::Init(const PrefStorePtrs& pref_store_ptrs,
const std::vector<std::string>& observed_prefs) {
if (pref_store_ptrs.empty()) {
// After this method exits |this| will get destroyed so it's safe to move
// out the members.
callback_.Run(std::move(persistent_pref_store_connection_),
std::move(connections_));
return;
}
for (const auto& ptr : pref_store_ptrs) {
ptr.second->AddObserver(
observed_prefs,
......
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