OLD | NEW |
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 CHROME_BROWSER_CHROMEOS_POLICY_CLOUD_EXTERNAL_DATA_MANAGER_BASE_TEST_UTI
L_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_CLOUD_EXTERNAL_DATA_MANAGER_BASE_TEST_UTI
L_H_ |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_CLOUD_EXTERNAL_DATA_MANAGER_BASE_TEST_UTI
L_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_CLOUD_EXTERNAL_DATA_MANAGER_BASE_TEST_UTI
L_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class DictionaryValue; | 14 class DictionaryValue; |
15 } | 15 } |
16 | 16 |
17 namespace policy { | 17 namespace policy { |
18 | 18 |
19 class CloudPolicyCore; | 19 class CloudPolicyCore; |
20 | 20 |
21 namespace test { | 21 namespace test { |
22 | 22 |
23 // Passes |data| to |destination| and invokes |done_callback| to indicate that | 23 // Passes |data| to |destination| and invokes |done_callback| to indicate that |
24 // the |data| has been retrieved. | 24 // the |data| has been retrieved. |
25 void ExternalDataFetchCallback(scoped_ptr<std::string>* destination, | 25 void ExternalDataFetchCallback(std::unique_ptr<std::string>* destination, |
26 const base::Closure& done_callback, | 26 const base::Closure& done_callback, |
27 scoped_ptr<std::string> data); | 27 std::unique_ptr<std::string> data); |
28 | 28 |
29 // Constructs a value that points a policy referencing external data at |url| | 29 // Constructs a value that points a policy referencing external data at |url| |
30 // and sets the expected hash of the external data to that of |data|. | 30 // and sets the expected hash of the external data to that of |data|. |
31 scoped_ptr<base::DictionaryValue> ConstructExternalDataReference( | 31 std::unique_ptr<base::DictionaryValue> ConstructExternalDataReference( |
32 const std::string& url, | 32 const std::string& url, |
33 const std::string& data); | 33 const std::string& data); |
34 | 34 |
35 // TODO(bartfab): Makes an arbitrary |policy| in |core| reference external data | 35 // TODO(bartfab): Makes an arbitrary |policy| in |core| reference external data |
36 // as specified in |metadata|. This is only done because there are no policies | 36 // as specified in |metadata|. This is only done because there are no policies |
37 // that reference external data yet. Once the first such policy is added, it | 37 // that reference external data yet. Once the first such policy is added, it |
38 // will be sufficient to set its value to |metadata| and this method should be | 38 // will be sufficient to set its value to |metadata| and this method should be |
39 // removed. | 39 // removed. |
40 void SetExternalDataReference(CloudPolicyCore* core, | 40 void SetExternalDataReference(CloudPolicyCore* core, |
41 const std::string& policy, | 41 const std::string& policy, |
42 scoped_ptr<base::DictionaryValue> metadata); | 42 std::unique_ptr<base::DictionaryValue> metadata); |
43 | 43 |
44 } // namespace test | 44 } // namespace test |
45 } // namespace policy | 45 } // namespace policy |
46 | 46 |
47 #endif // CHROME_BROWSER_CHROMEOS_POLICY_CLOUD_EXTERNAL_DATA_MANAGER_BASE_TEST_
UTIL_H_ | 47 #endif // CHROME_BROWSER_CHROMEOS_POLICY_CLOUD_EXTERNAL_DATA_MANAGER_BASE_TEST_
UTIL_H_ |
OLD | NEW |