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

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

Issue 2532163002: Comments updated as result of infinite timeout for state keys generated (Closed)
Patch Set: Fixed the nits Created 4 years 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
« no previous file with comments | « no previous file | chromeos/dbus/session_manager_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 28 matching lines...) Expand all
39 chromeos::SessionManagerClient* session_manager_client, 39 chromeos::SessionManagerClient* session_manager_client,
40 scoped_refptr<base::TaskRunner> delayed_task_runner); 40 scoped_refptr<base::TaskRunner> delayed_task_runner);
41 ~ServerBackedStateKeysBroker(); 41 ~ServerBackedStateKeysBroker();
42 42
43 // 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.
44 // 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
45 // long as it wants to receive the callback. If the state keys haven't been 45 // long as it wants to receive the callback. If the state keys haven't been
46 // requested yet, calling this will also trigger their initial fetch. 46 // requested yet, calling this will also trigger their initial fetch.
47 Subscription RegisterUpdateCallback(const base::Closure& callback); 47 Subscription RegisterUpdateCallback(const base::Closure& callback);
48 48
49 // Requests state keys asynchronously. Invokes the passed callback exactly 49 // Requests state keys asynchronously. Invokes the passed callback at most
50 // once (unless |this| gets destroyed before the callback happens), with the 50 // once, with the current state keys passed as a parameter to the callback. If
51 // current state keys passed as a parameter to the callback. If there's a 51 // there's a problem determining the state keys, the passed vector will be
52 // problem determining the state keys, the passed vector will be empty. 52 // empty. If |this| gets destroyed before the callback happens or if the time
53 // sync fails / the network is not established, then the |callback| is never
54 // invoked.
stevenjb 2016/12/22 19:14:05 Let's reference the issue here to give developers
igorcov 2016/12/23 15:39:21 Done.
53 void RequestStateKeys(const StateKeysCallback& callback); 55 void RequestStateKeys(const StateKeysCallback& callback);
54 56
55 // Get the set of current state keys. Empty if state keys are unavailable 57 // Get the set of current state keys. Empty if state keys are unavailable
56 // or pending retrieval. 58 // or pending retrieval.
57 const std::vector<std::string>& state_keys() const { return state_keys_; } 59 const std::vector<std::string>& state_keys() const { return state_keys_; }
58 60
59 // Returns the state key for the current point in time. Returns an empty 61 // Returns the state key for the current point in time. Returns an empty
60 // string if state keys are unavailable or pending retrieval. 62 // string if state keys are unavailable or pending retrieval.
61 std::string current_state_key() const { 63 std::string current_state_key() const {
62 return state_keys_.empty() ? std::string() : state_keys_.front(); 64 return state_keys_.empty() ? std::string() : state_keys_.front();
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 std::vector<StateKeysCallback> request_callbacks_; 97 std::vector<StateKeysCallback> request_callbacks_;
96 98
97 base::WeakPtrFactory<ServerBackedStateKeysBroker> weak_factory_; 99 base::WeakPtrFactory<ServerBackedStateKeysBroker> weak_factory_;
98 100
99 DISALLOW_COPY_AND_ASSIGN(ServerBackedStateKeysBroker); 101 DISALLOW_COPY_AND_ASSIGN(ServerBackedStateKeysBroker);
100 }; 102 };
101 103
102 } // namespace policy 104 } // namespace policy
103 105
104 #endif // CHROME_BROWSER_CHROMEOS_POLICY_SERVER_BACKED_STATE_KEYS_BROKER_H_ 106 #endif // CHROME_BROWSER_CHROMEOS_POLICY_SERVER_BACKED_STATE_KEYS_BROKER_H_
OLDNEW
« no previous file with comments | « no previous file | chromeos/dbus/session_manager_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698