Commit 94f92a18 authored by Sorin Jianu's avatar Sorin Jianu Committed by Commit Bot

Make updater::PersistedData RefCountedThreadSafe.

Per-project coding style: ref counted types must be thread-safe and
sequence affinity declared with sequence checkers in destructors
if needed.

The motivation for such change is that our types get aggregated in
different ways, and mixing thread-safe and non thread-safe may
result into puzzling asserts in ref-counting code when objects
get shared between sequences.

Bug: 1105922
Change-Id: I31c5f3c118b633d3a3eb5bf072d3872fba2d2054
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2314418Reviewed-by: default avatarJoshua Pawlicki <waffles@chromium.org>
Commit-Queue: Sorin Jianu <sorin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790959}
parent cf252d19
......@@ -29,7 +29,7 @@ struct RegistrationRequest;
//
// A mechanism to remove apps or app versions from prefs is needed.
// TODO(sorin): crbug.com/1056450
class PersistedData : public base::RefCounted<PersistedData> {
class PersistedData : public base::RefCountedThreadSafe<PersistedData> {
public:
// Constructs a provider using the specified |pref_service|.
// The associated preferences are assumed to already be registered.
......@@ -69,7 +69,7 @@ class PersistedData : public base::RefCounted<PersistedData> {
std::vector<std::string> GetAppIds() const;
private:
friend class base::RefCounted<PersistedData>;
friend class base::RefCountedThreadSafe<PersistedData>;
~PersistedData();
std::string GetString(const std::string& id, const std::string& key) const;
......
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