Skip to content

Commit

Permalink
Migrate might_have_observer to empty in components/prefs and services/
Browse files Browse the repository at this point in the history
Bug: 1155308
Change-Id: Ib42a0acc0a29beb35ced0e9cd717456c1d62a92e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2638540
Reviewed-by: Gabriel Charette <[email protected]>
Commit-Queue: Mitsuru Oshima <[email protected]>
Cr-Commit-Position: refs/heads/master@{#845285}
  • Loading branch information
mitoshima authored and Chromium LUCI CQ committed Jan 20, 2021
1 parent 9fa26f5 commit 28f9b68
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion components/prefs/default_pref_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void DefaultPrefStore::RemoveObserver(PrefStore::Observer* observer) {
}

bool DefaultPrefStore::HasObservers() const {
return observers_.might_have_observers();
return !observers_.empty();
}

void DefaultPrefStore::SetDefaultValue(const std::string& key, Value value) {
Expand Down
2 changes: 1 addition & 1 deletion components/prefs/in_memory_pref_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void InMemoryPrefStore::RemoveObserver(PrefStore::Observer* observer) {
}

bool InMemoryPrefStore::HasObservers() const {
return observers_.might_have_observers();
return !observers_.empty();
}

bool InMemoryPrefStore::IsInitializationComplete() const {
Expand Down
3 changes: 1 addition & 2 deletions components/prefs/json_pref_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ void JsonPrefStore::RemoveObserver(PrefStore::Observer* observer) {

bool JsonPrefStore::HasObservers() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);

return observers_.might_have_observers();
return !observers_.empty();
}

bool JsonPrefStore::IsInitializationComplete() const {
Expand Down
2 changes: 1 addition & 1 deletion components/prefs/overlay_user_pref_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void OverlayUserPrefStore::RemoveObserver(PrefStore::Observer* observer) {
}

bool OverlayUserPrefStore::HasObservers() const {
return observers_.might_have_observers();
return !observers_.empty();
}

bool OverlayUserPrefStore::IsInitializationComplete() const {
Expand Down
2 changes: 1 addition & 1 deletion components/prefs/testing_pref_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void TestingPrefStore::RemoveObserver(PrefStore::Observer* observer) {
}

bool TestingPrefStore::HasObservers() const {
return observers_.might_have_observers();
return !observers_.empty();
}

bool TestingPrefStore::IsInitializationComplete() const {
Expand Down
2 changes: 1 addition & 1 deletion components/prefs/value_map_pref_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void ValueMapPrefStore::RemoveObserver(PrefStore::Observer* observer) {
}

bool ValueMapPrefStore::HasObservers() const {
return observers_.might_have_observers();
return !observers_.empty();
}

void ValueMapPrefStore::SetValue(const std::string& key,
Expand Down
2 changes: 1 addition & 1 deletion services/preferences/tracked/segregated_pref_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void SegregatedPrefStore::RemoveObserver(Observer* observer) {
}

bool SegregatedPrefStore::HasObservers() const {
return observers_.might_have_observers();
return !observers_.empty();
}

bool SegregatedPrefStore::IsInitializationComplete() const {
Expand Down

0 comments on commit 28f9b68

Please sign in to comment.