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

Side by Side Diff: components/copresence/test/stub_whispernet_client.cc

Issue 865483005: Creating the audio_modem component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merging again Created 5 years, 10 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 | « components/copresence/test/stub_whispernet_client.h ('k') | components/copresence/tokens.h » ('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 #include "components/copresence/test/stub_whispernet_client.h"
6
7 namespace copresence {
8
9 StubWhispernetClient::StubWhispernetClient(
10 scoped_refptr<media::AudioBusRefCounted> samples,
11 const std::vector<AudioToken>& tokens)
12 : samples_(samples),
13 tokens_(tokens) {
14 }
15
16 StubWhispernetClient::~StubWhispernetClient() {}
17
18 void StubWhispernetClient::Initialize(const SuccessCallback& init_callback) {}
19
20 void StubWhispernetClient::EncodeToken(const std::string& token,
21 AudioType type) {
22 if (!samples_cb_.is_null())
23 samples_cb_.Run(type, token, samples_);
24 }
25
26 void StubWhispernetClient::DecodeSamples(AudioType type,
27 const std::string& samples,
28 const size_t token_length[2]) {
29 if (!tokens_cb_.is_null())
30 tokens_cb_.Run(tokens_);
31 }
32
33 void StubWhispernetClient::RegisterTokensCallback(
34 const TokensCallback& tokens_cb) {
35 tokens_cb_ = tokens_cb;
36 }
37
38 void StubWhispernetClient::RegisterSamplesCallback(
39 const SamplesCallback& samples_cb) {
40 samples_cb_ = samples_cb;
41 }
42
43 TokensCallback StubWhispernetClient::GetTokensCallback() {
44 return tokens_cb_;
45 }
46
47 SamplesCallback StubWhispernetClient::GetSamplesCallback() {
48 return samples_cb_;
49 }
50
51 SuccessCallback StubWhispernetClient::GetDetectBroadcastCallback() {
52 return SuccessCallback();
53 }
54
55 SuccessCallback StubWhispernetClient::GetInitializedCallback() {
56 return SuccessCallback();
57 }
58
59 } // namespace copresence
OLDNEW
« no previous file with comments | « components/copresence/test/stub_whispernet_client.h ('k') | components/copresence/tokens.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698