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

Unified Diff: services/preferences/public/cpp/persistent_pref_store_client.cc

Issue 2746023002: Pref service: enable for user prefs in chrome behind a flag. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/cpp/bindings/sync_call_restrictions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/preferences/public/cpp/persistent_pref_store_client.cc
diff --git a/services/preferences/public/cpp/persistent_pref_store_client.cc b/services/preferences/public/cpp/persistent_pref_store_client.cc
index 032e081625427f2e1bf3687f18e6252a2da37960..74c9b116fbd7d9bae66fe0bc950077ad0f9e36bc 100644
--- a/services/preferences/public/cpp/persistent_pref_store_client.cc
+++ b/services/preferences/public/cpp/persistent_pref_store_client.cc
@@ -6,7 +6,9 @@
#include <utility>
+#include "base/threading/thread_restrictions.h"
#include "base/values.h"
+#include "mojo/public/cpp/bindings/sync_call_restrictions.h"
namespace prefs {
@@ -70,6 +72,8 @@ PersistentPrefStore::PrefReadError PersistentPrefStoreClient::ReadPrefs() {
std::unique_ptr<base::DictionaryValue> local_prefs;
mojom::PersistentPrefStorePtr pref_store;
mojom::PrefStoreObserverRequest observer_request;
+ base::ThreadRestrictions::AssertWaitAllowed();
jam 2017/03/22 14:58:12 nit: curious why you added this? mojo::SyncCallRes
Sam McNally 2017/03/28 23:06:22 It was intended to detect inadvertent post-startup
+ mojo::SyncCallRestrictions::ScopedAllowSyncCall allow_sync_calls;
if (!connector_->Connect(&read_error, &read_only, &local_prefs, &pref_store,
&observer_request)) {
NOTREACHED();
« no previous file with comments | « mojo/public/cpp/bindings/sync_call_restrictions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698