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

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

Issue 2131993002: Delete the audio modem and copresence private APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@eol
Patch Set: Sync again Created 4 years, 5 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
« no previous file with comments | « chrome/browser/copresence/OWNERS ('k') | 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
(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 CHROME_BROWSER_COPRESENCE_CHROME_WHISPERNET_CLIENT_H_
6 #define CHROME_BROWSER_COPRESENCE_CHROME_WHISPERNET_CLIENT_H_
7
8 #include <string>
9
10 #include "base/callback.h"
11 #include "base/macros.h"
12 #include "base/memory/scoped_vector.h"
13 #include "chrome/browser/copresence/chrome_whispernet_config.h"
14 #include "components/audio_modem/public/whispernet_client.h"
15
16 namespace content {
17 class BrowserContext;
18 }
19
20 namespace extensions {
21
22 struct Event;
23 class EventRouter;
24
25 namespace api {
26 namespace copresence_private {
27 struct AudioParameters;
28 }
29 }
30
31 } // namespace extensions
32
33 namespace media {
34 class AudioBusRefCounted;
35 }
36
37 // This class is responsible for communication with our whispernet_proxy
38 // extension that talks to the whispernet audio library.
39 class ChromeWhispernetClient final : public audio_modem::WhispernetClient {
40 public:
41 // The browser context needs to outlive this class.
42 explicit ChromeWhispernetClient(content::BrowserContext* browser_context);
43 ~ChromeWhispernetClient() override;
44
45 // WhispernetClient overrides:
46 void Initialize(const audio_modem::SuccessCallback& init_callback) override;
47 void EncodeToken(const std::string& token_str,
48 audio_modem::AudioType type,
49 const audio_modem::TokenParameters token_params[2]) override;
50 void DecodeSamples(
51 audio_modem::AudioType type,
52 const std::string& samples,
53 const audio_modem::TokenParameters token_params[2]) override;
54 void RegisterTokensCallback(
55 const audio_modem::TokensCallback& tokens_callback) override;
56 void RegisterSamplesCallback(
57 const audio_modem::SamplesCallback& samples_callback) override;
58
59 audio_modem::TokensCallback GetTokensCallback() override;
60 audio_modem::SamplesCallback GetSamplesCallback() override;
61 audio_modem::SuccessCallback GetInitializedCallback() override;
62
63 static const char kWhispernetProxyExtensionId[];
64
65 private:
66 // Fire an event to configure whispernet with the given audio parameters.
67 void AudioConfiguration(const AudioParamData& params);
68
69 void SendEventIfLoaded(std::unique_ptr<extensions::Event> event);
70
71 // This gets called when the proxy extension loads.
72 void OnExtensionLoaded(bool success);
73
74 content::BrowserContext* const browser_context_;
75 extensions::EventRouter* const event_router_;
76 std::string client_id_;
77
78 audio_modem::SuccessCallback extension_loaded_callback_;
79 audio_modem::SuccessCallback init_callback_;
80
81 audio_modem::TokensCallback tokens_callback_;
82 audio_modem::SamplesCallback samples_callback_;
83
84 ScopedVector<extensions::Event> queued_events_;
85 bool extension_loaded_;
86
87 DISALLOW_COPY_AND_ASSIGN(ChromeWhispernetClient);
88 };
89
90 #endif // CHROME_BROWSER_COPRESENCE_CHROME_WHISPERNET_CLIENT_H_
OLDNEW
« no previous file with comments | « chrome/browser/copresence/OWNERS ('k') | chrome/browser/copresence/chrome_whispernet_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698