OLD | NEW |
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_service.h" | 5 #include "chrome/browser/policy/cloud/component_cloud_policy_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 ComponentCloudPolicyService::Delegate::~Delegate() {} | 29 ComponentCloudPolicyService::Delegate::~Delegate() {} |
30 | 30 |
31 // Owns the objects that live on the background thread, and posts back to UI | 31 // Owns the objects that live on the background thread, and posts back to UI |
32 // to the service whenever the policy changes. | 32 // to the service whenever the policy changes. |
33 class ComponentCloudPolicyService::Backend | 33 class ComponentCloudPolicyService::Backend |
34 : public ComponentCloudPolicyStore::Delegate { | 34 : public ComponentCloudPolicyStore::Delegate { |
35 public: | 35 public: |
36 Backend(base::WeakPtr<ComponentCloudPolicyService> service, | 36 Backend(base::WeakPtr<ComponentCloudPolicyService> service, |
37 scoped_refptr<base::SequencedTaskRunner> task_runner, | 37 scoped_refptr<base::SequencedTaskRunner> task_runner, |
38 scoped_ptr<ResourceCache> cache); | 38 scoped_ptr<ResourceCache> cache); |
39 ~Backend(); | 39 virtual ~Backend(); |
40 | 40 |
41 // This is invoked right after the constructor but on the backend background | 41 // This is invoked right after the constructor but on the backend background |
42 // thread. Used to create the store on the right thread. | 42 // thread. Used to create the store on the right thread. |
43 void Init(); | 43 void Init(); |
44 | 44 |
45 // Reads the initial list of components and the initial policy. | 45 // Reads the initial list of components and the initial policy. |
46 void FinalizeInit(); | 46 void FinalizeInit(); |
47 | 47 |
48 // Creates the backend updater. | 48 // Creates the backend updater. |
49 void Connect(scoped_refptr<net::URLRequestContextGetter> request_context); | 49 void Connect(scoped_refptr<net::URLRequestContextGetter> request_context); |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 PolicyDomain domain, | 437 PolicyDomain domain, |
438 const StringSet& set) { | 438 const StringSet& set) { |
439 std::string policy_type; | 439 std::string policy_type; |
440 if (ComponentCloudPolicyStore::GetPolicyType(domain, &policy_type)) { | 440 if (ComponentCloudPolicyStore::GetPolicyType(domain, &policy_type)) { |
441 for (StringSet::const_iterator it = set.begin(); it != set.end(); ++it) | 441 for (StringSet::const_iterator it = set.begin(); it != set.end(); ++it) |
442 client_->RemoveNamespaceToFetch(PolicyNamespaceKey(policy_type, *it)); | 442 client_->RemoveNamespaceToFetch(PolicyNamespaceKey(policy_type, *it)); |
443 } | 443 } |
444 } | 444 } |
445 | 445 |
446 } // namespace policy | 446 } // namespace policy |
OLD | NEW |