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

Side by Side Diff: chrome/browser/copresence/chrome_whispernet_client.h

Issue 637223011: Redesign the copresence audio handlers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: Created 6 years, 1 month 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 | chrome/browser/copresence/chrome_whispernet_client.cc » ('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_COPRESENCE_CHROME_WHISPERNET_CLIENT_H_ 5 #ifndef CHROME_BROWSER_COPRESENCE_CHROME_WHISPERNET_CLIENT_H_
6 #define CHROME_BROWSER_COPRESENCE_CHROME_WHISPERNET_CLIENT_H_ 6 #define CHROME_BROWSER_COPRESENCE_CHROME_WHISPERNET_CLIENT_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "components/copresence/public/copresence_constants.h"
13 #include "components/copresence/public/whispernet_client.h" 14 #include "components/copresence/public/whispernet_client.h"
14 15
15 namespace content { 16 namespace content {
16 class BrowserContext; 17 class BrowserContext;
17 } 18 }
18 19
19 namespace extensions { 20 namespace extensions {
20 namespace api { 21 namespace api {
21 namespace copresence_private { 22 namespace copresence_private {
22 struct AudioParameters; 23 struct AudioParameters;
23 } 24 }
24 } 25 }
25 } 26 }
26 27
27 namespace media { 28 namespace media {
28 class AudioBusRefCounted; 29 class AudioBusRefCounted;
29 } 30 }
30 31
31 // This class is responsible for communication with our ledger_proxy extension 32 // This class is responsible for communication with our ledger_proxy extension
32 // that talks to the whispernet audio library. 33 // that talks to the whispernet audio library.
33 class ChromeWhispernetClient : public copresence::WhispernetClient { 34 class ChromeWhispernetClient final : public copresence::WhispernetClient {
34 public: 35 public:
35 // The browser context needs to outlive this class. 36 // The browser context needs to outlive this class.
36 explicit ChromeWhispernetClient(content::BrowserContext* browser_context); 37 explicit ChromeWhispernetClient(content::BrowserContext* browser_context);
37 ~ChromeWhispernetClient() override; 38 ~ChromeWhispernetClient() override;
38 39
39 // WhispernetClient overrides: 40 // WhispernetClient overrides:
40 void Initialize(const SuccessCallback& init_callback) override; 41 void Initialize(const SuccessCallback& init_callback) override;
41 void Shutdown() override; 42 void Shutdown() override;
42 43
43 void EncodeToken(const std::string& token, bool audible) override; 44 void EncodeToken(const std::string& token,
44 void DecodeSamples(const std::string& samples) override; 45 copresence::AudioType type) override;
46 void DecodeSamples(copresence::AudioType type,
47 const std::string& samples) override;
45 void DetectBroadcast() override; 48 void DetectBroadcast() override;
46 49
47 void RegisterTokensCallback(const TokensCallback& tokens_callback) override; 50 void RegisterTokensCallback(const TokensCallback& tokens_callback) override;
48 void RegisterSamplesCallback( 51 void RegisterSamplesCallback(
49 const SamplesCallback& samples_callback) override; 52 const SamplesCallback& samples_callback) override;
50 void RegisterDetectBroadcastCallback( 53 void RegisterDetectBroadcastCallback(
51 const SuccessCallback& db_callback) override; 54 const SuccessCallback& db_callback) override;
52 55
53 TokensCallback GetTokensCallback() override; 56 TokensCallback GetTokensCallback() override;
54 SamplesCallback GetSamplesCallback() override; 57 SamplesCallback GetSamplesCallback() override;
(...skipping 19 matching lines...) Expand all
74 TokensCallback tokens_callback_; 77 TokensCallback tokens_callback_;
75 SamplesCallback samples_callback_; 78 SamplesCallback samples_callback_;
76 SuccessCallback db_callback_; 79 SuccessCallback db_callback_;
77 80
78 bool extension_loaded_; 81 bool extension_loaded_;
79 82
80 DISALLOW_COPY_AND_ASSIGN(ChromeWhispernetClient); 83 DISALLOW_COPY_AND_ASSIGN(ChromeWhispernetClient);
81 }; 84 };
82 85
83 #endif // CHROME_BROWSER_COPRESENCE_CHROME_WHISPERNET_CLIENT_H_ 86 #endif // CHROME_BROWSER_COPRESENCE_CHROME_WHISPERNET_CLIENT_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/copresence/chrome_whispernet_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698