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

Side by Side Diff: components/policy/core/common/cloud/policy_header_service.h

Issue 1902633006: Convert //components/policy from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments and use namespace alias Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 #ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_HEADER_SERVICE_H_ 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_HEADER_SERVICE_H_
6 #define COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_HEADER_SERVICE_H_ 6 #define COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_HEADER_SERVICE_H_
7 7
8 #include <memory>
8 #include <string> 9 #include <string>
9 #include <vector> 10 #include <vector>
10 11
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "components/policy/core/common/cloud/cloud_policy_store.h" 14 #include "components/policy/core/common/cloud/cloud_policy_store.h"
15 #include "components/policy/policy_export.h" 15 #include "components/policy/policy_export.h"
16 16
17 namespace base { 17 namespace base {
18 class SequencedTaskRunner; 18 class SequencedTaskRunner;
19 } 19 }
20 20
21 namespace policy { 21 namespace policy {
22 22
23 class PolicyHeaderIOHelper; 23 class PolicyHeaderIOHelper;
(...skipping 10 matching lines...) Expand all
34 const std::string& verification_key_hash, 34 const std::string& verification_key_hash,
35 CloudPolicyStore* user_policy_store, 35 CloudPolicyStore* user_policy_store,
36 CloudPolicyStore* device_policy_store); 36 CloudPolicyStore* device_policy_store);
37 ~PolicyHeaderService() override; 37 ~PolicyHeaderService() override;
38 38
39 // Creates a PolicyHeaderIOHelper object to be run on the IO thread and 39 // Creates a PolicyHeaderIOHelper object to be run on the IO thread and
40 // add policy headers to outgoing requests. The caller takes ownership of 40 // add policy headers to outgoing requests. The caller takes ownership of
41 // this object and must ensure it outlives ProfileHeaderService (in practice, 41 // this object and must ensure it outlives ProfileHeaderService (in practice,
42 // this is called by ProfileIOData, which is shutdown *after* all 42 // this is called by ProfileIOData, which is shutdown *after* all
43 // ProfileKeyedServices are shutdown). 43 // ProfileKeyedServices are shutdown).
44 scoped_ptr<PolicyHeaderIOHelper> CreatePolicyHeaderIOHelper( 44 std::unique_ptr<PolicyHeaderIOHelper> CreatePolicyHeaderIOHelper(
45 scoped_refptr<base::SequencedTaskRunner> task_runner); 45 scoped_refptr<base::SequencedTaskRunner> task_runner);
46 46
47 // Overridden CloudPolicyStore::Observer methods: 47 // Overridden CloudPolicyStore::Observer methods:
48 void OnStoreLoaded(CloudPolicyStore* store) override; 48 void OnStoreLoaded(CloudPolicyStore* store) override;
49 void OnStoreError(CloudPolicyStore* store) override; 49 void OnStoreError(CloudPolicyStore* store) override;
50 50
51 // Returns a list of all PolicyHeaderIOHelpers created by this object. 51 // Returns a list of all PolicyHeaderIOHelpers created by this object.
52 std::vector<PolicyHeaderIOHelper*> GetHelpersForTest(); 52 std::vector<PolicyHeaderIOHelper*> GetHelpersForTest();
53 53
54 private: 54 private:
(...skipping 12 matching lines...) Expand all
67 // Weak pointers to User-/Device-level policy stores. 67 // Weak pointers to User-/Device-level policy stores.
68 CloudPolicyStore* user_policy_store_; 68 CloudPolicyStore* user_policy_store_;
69 CloudPolicyStore* device_policy_store_; 69 CloudPolicyStore* device_policy_store_;
70 70
71 DISALLOW_COPY_AND_ASSIGN(PolicyHeaderService); 71 DISALLOW_COPY_AND_ASSIGN(PolicyHeaderService);
72 }; 72 };
73 73
74 } // namespace policy 74 } // namespace policy
75 75
76 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_HEADER_SERVICE_H_ 76 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_POLICY_HEADER_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698