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

Side by Side Diff: components/copresence/public/copresence_state.h

Issue 824593003: Revert of Adding CopresenceState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_STATE_H_
6 #define COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_STATE_H_
7
8 #include <map>
9 #include <string>
10 #include <vector>
11
12 namespace copresence {
13
14 class CopresenceObserver;
15 class Directive;
16 struct TransmittedToken;
17 struct ReceivedToken;
18
19 // This class tracks the state of the copresence component and can notify
20 // interested parties when it changes. This is useful for debugging purposes.
21 class CopresenceState {
22 public:
23 // Add a listener for future state changes. |observer| is owned by the caller,
24 // and must be valid until removed (or the CopresenceState is destroyed).
25 virtual void AddObserver(CopresenceObserver* observer) = 0;
26
27 // Remove a state change listener.
28 virtual void RemoveObserver(CopresenceObserver* observer) = 0;
29
30 // Accessor for the currently active directives.
31 virtual const std::vector<Directive>& active_directives() const = 0;
32
33 // Accessor for recently transmitted tokens.
34 virtual const std::map<std::string, TransmittedToken>&
35 transmitted_tokens() const = 0;
36
37 // Accessor for recently received tokens.
38 virtual const std::map<std::string, ReceivedToken>&
39 received_tokens() const = 0;
40
41 protected:
42 virtual ~CopresenceState() {}
43 };
44
45 } // namespace copresence
46
47 #endif // COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_STATE_H_
OLDNEW
« no previous file with comments | « components/copresence/public/copresence_observer.h ('k') | components/copresence/rpc/rpc_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698