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

Side by Side Diff: chrome/browser/policy/cloud/component_cloud_policy_store.cc

Issue 70863002: Refactored the ComponentCloudPolicyService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/policy/cloud/component_cloud_policy_store.h" 5 #include "chrome/browser/policy/cloud/component_cloud_policy_store.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/sha1.h" 10 #include "base/sha1.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 60
61 } // namespace 61 } // namespace
62 62
63 ComponentCloudPolicyStore::Delegate::~Delegate() {} 63 ComponentCloudPolicyStore::Delegate::~Delegate() {}
64 64
65 ComponentCloudPolicyStore::ComponentCloudPolicyStore( 65 ComponentCloudPolicyStore::ComponentCloudPolicyStore(
66 Delegate* delegate, 66 Delegate* delegate,
67 ResourceCache* cache) 67 ResourceCache* cache)
68 : delegate_(delegate), 68 : delegate_(delegate),
69 cache_(cache) {} 69 cache_(cache) {
70 // Allow the store to be created on a different thread than the thread that
71 // will end up using it.
72 DetachFromThread();
73 }
70 74
71 ComponentCloudPolicyStore::~ComponentCloudPolicyStore() { 75 ComponentCloudPolicyStore::~ComponentCloudPolicyStore() {
72 DCHECK(CalledOnValidThread()); 76 DCHECK(CalledOnValidThread());
73 } 77 }
74 78
75 // static 79 // static
76 bool ComponentCloudPolicyStore::SupportsDomain(PolicyDomain domain) { 80 bool ComponentCloudPolicyStore::SupportsDomain(PolicyDomain domain) {
77 return GetDomainConstants(domain) != NULL; 81 return GetDomainConstants(domain) != NULL;
78 } 82 }
79 83
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 // If policy for components is ever used for device-level settings then 339 // If policy for components is ever used for device-level settings then
336 // this must support a configurable scope; assuming POLICY_SCOPE_USER is 340 // this must support a configurable scope; assuming POLICY_SCOPE_USER is
337 // fine for now. 341 // fine for now.
338 policy->Set(it.key(), level, POLICY_SCOPE_USER, value.release(), NULL); 342 policy->Set(it.key(), level, POLICY_SCOPE_USER, value.release(), NULL);
339 } 343 }
340 344
341 return true; 345 return true;
342 } 346 }
343 347
344 } // namespace policy 348 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698