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

Side by Side Diff: chrome/browser/chromeos/policy/server_backed_state_keys_broker.h

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_SERVER_BACKED_STATE_KEYS_BROKER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_SERVER_BACKED_STATE_KEYS_BROKER_H_
6 #define CHROME_BROWSER_CHROMEOS_POLICY_SERVER_BACKED_STATE_KEYS_BROKER_H_ 6 #define CHROME_BROWSER_CHROMEOS_POLICY_SERVER_BACKED_STATE_KEYS_BROKER_H_
7 7
8 #include <memory>
8 #include <string> 9 #include <string>
9 #include <vector> 10 #include <vector>
10 11
11 #include "base/callback.h" 12 #include "base/callback.h"
12 #include "base/callback_list.h" 13 #include "base/callback_list.h"
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
15 #include "base/memory/scoped_ptr.h"
16 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
17 17
18 namespace base { 18 namespace base {
19 class TaskRunner; 19 class TaskRunner;
20 } 20 }
21 21
22 namespace chromeos { 22 namespace chromeos {
23 class SessionManagerClient; 23 class SessionManagerClient;
24 } 24 }
25 25
26 namespace policy { 26 namespace policy {
27 27
28 // Brokers server-backed FRE state keys for the device. Retrieves them from 28 // Brokers server-backed FRE state keys for the device. Retrieves them from
29 // session manager via DBus and refreshes them periodically. Consumers can 29 // session manager via DBus and refreshes them periodically. Consumers can
30 // register callbacks to invoke when the state keys change. 30 // register callbacks to invoke when the state keys change.
31 class ServerBackedStateKeysBroker { 31 class ServerBackedStateKeysBroker {
32 public: 32 public:
33 typedef scoped_ptr<base::CallbackList<void()>::Subscription> Subscription; 33 typedef std::unique_ptr<base::CallbackList<void()>::Subscription>
34 Subscription;
34 typedef base::Callback<void(const std::vector<std::string>&)> 35 typedef base::Callback<void(const std::vector<std::string>&)>
35 StateKeysCallback; 36 StateKeysCallback;
36 37
37 ServerBackedStateKeysBroker( 38 ServerBackedStateKeysBroker(
38 chromeos::SessionManagerClient* session_manager_client, 39 chromeos::SessionManagerClient* session_manager_client,
39 scoped_refptr<base::TaskRunner> delayed_task_runner); 40 scoped_refptr<base::TaskRunner> delayed_task_runner);
40 ~ServerBackedStateKeysBroker(); 41 ~ServerBackedStateKeysBroker();
41 42
42 // Registers a callback to be invoked whenever the state keys get updated. 43 // Registers a callback to be invoked whenever the state keys get updated.
43 // Note that consuming code needs to hold on to the returned Subscription as 44 // Note that consuming code needs to hold on to the returned Subscription as
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 std::vector<StateKeysCallback> request_callbacks_; 95 std::vector<StateKeysCallback> request_callbacks_;
95 96
96 base::WeakPtrFactory<ServerBackedStateKeysBroker> weak_factory_; 97 base::WeakPtrFactory<ServerBackedStateKeysBroker> weak_factory_;
97 98
98 DISALLOW_COPY_AND_ASSIGN(ServerBackedStateKeysBroker); 99 DISALLOW_COPY_AND_ASSIGN(ServerBackedStateKeysBroker);
99 }; 100 };
100 101
101 } // namespace policy 102 } // namespace policy
102 103
103 #endif // CHROME_BROWSER_CHROMEOS_POLICY_SERVER_BACKED_STATE_KEYS_BROKER_H_ 104 #endif // CHROME_BROWSER_CHROMEOS_POLICY_SERVER_BACKED_STATE_KEYS_BROKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698