OLD | NEW |
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 COMPONENTS_COPRESENCE_PUBLIC_WHISPERNET_CLIENT_H_ | 5 #ifndef COMPONENTS_COPRESENCE_PUBLIC_WHISPERNET_CLIENT_H_ |
6 #define COMPONENTS_COPRESENCE_PUBLIC_WHISPERNET_CLIENT_H_ | 6 #define COMPONENTS_COPRESENCE_PUBLIC_WHISPERNET_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 typedef base::Callback<void(const std::vector<std::string>&)> TokensCallback; | 30 typedef base::Callback<void(const std::vector<std::string>&)> TokensCallback; |
31 // Callback that returns encoded samples for a given token. | 31 // Callback that returns encoded samples for a given token. |
32 typedef base::Callback< | 32 typedef base::Callback< |
33 void(const std::string&, const scoped_refptr<media::AudioBusRefCounted>&)> | 33 void(const std::string&, const scoped_refptr<media::AudioBusRefCounted>&)> |
34 SamplesCallback; | 34 SamplesCallback; |
35 | 35 |
36 // Initialize the whispernet client and call the callback when done. The | 36 // Initialize the whispernet client and call the callback when done. The |
37 // parameter indicates whether we succeeded or failed. | 37 // parameter indicates whether we succeeded or failed. |
38 virtual void Initialize(const SuccessCallback& init_callback) = 0; | 38 virtual void Initialize(const SuccessCallback& init_callback) = 0; |
39 // Copresence will call this before making any calls to its destructors. | 39 // Copresence will call this before making any calls to its destructors. |
| 40 // Any callbacks the client holds must be cleared. |
40 virtual void Shutdown() = 0; | 41 virtual void Shutdown() = 0; |
41 | 42 |
42 // Fires an event to request a token encode. | 43 // Fires an event to request a token encode. |
43 virtual void EncodeToken(const std::string& token) = 0; | 44 virtual void EncodeToken(const std::string& token) = 0; |
44 // Fires an event to request a decode for the given samples. | 45 // Fires an event to request a decode for the given samples. |
45 virtual void DecodeSamples(const std::string& samples) = 0; | 46 virtual void DecodeSamples(const std::string& samples) = 0; |
46 // Fires an event to request detection of a whispernet broadcast. | 47 // Fires an event to request detection of a whispernet broadcast. |
47 virtual void DetectBroadcast() = 0; | 48 virtual void DetectBroadcast() = 0; |
48 | 49 |
49 // Callback registreation methods. These are the callbacks that will be | 50 // Callback registreation methods. These are the callbacks that will be |
(...skipping 11 matching lines...) Expand all Loading... |
61 virtual SamplesCallback GetSamplesCallback() = 0; | 62 virtual SamplesCallback GetSamplesCallback() = 0; |
62 virtual SuccessCallback GetDetectBroadcastCallback() = 0; | 63 virtual SuccessCallback GetDetectBroadcastCallback() = 0; |
63 virtual SuccessCallback GetInitializedCallback() = 0; | 64 virtual SuccessCallback GetInitializedCallback() = 0; |
64 | 65 |
65 virtual ~WhispernetClient() {}; | 66 virtual ~WhispernetClient() {}; |
66 }; | 67 }; |
67 | 68 |
68 } // namespace copresence | 69 } // namespace copresence |
69 | 70 |
70 #endif // COMPONENTS_COPRESENCE_PUBLIC_WHISPERNET_CLIENT_H_ | 71 #endif // COMPONENTS_COPRESENCE_PUBLIC_WHISPERNET_CLIENT_H_ |
OLD | NEW |