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.
5 // Use the <code>chrome.copresencePrivate</code> API to interface with Chrome
6 // from the whispernet_proxy extension.
7 namespace copresencePrivate
{
13 dictionary TokenParameters
{
19 dictionary DecodeSamplesParameters
{
22 boolean decodeAudible
;
23 boolean decodeInaudible
;
25 TokenParameters audibleTokenParams
;
26 TokenParameters inaudibleTokenParams
;
29 dictionary EncodeTokenParameters
{
32 TokenParameters tokenParams
;
35 dictionary AudioParameters
{
36 // This string contains marshalling of a custom parameters structure
37 // that Chrome and the Whispernet wrapper both know about. These are
38 // based off //components/copresence/proto/config_data.proto.
39 ArrayBuffer paramData
;
43 // Send a boolean indicating whether our initialization was successful.
44 static
void sendInitialized
(boolean success
);
46 // Sends an array of found tokens to Chrome.
47 static
void sendFound
(DOMString clientId
, Token
[] tokens
);
49 // Send an array buffer of samples encoded for the specified token.
50 static
void sendSamples
(DOMString clientId
,
56 // Fired to request audio configuration of the whisper.net library.
57 static
void onConfigAudio
(DOMString clientId
, AudioParameters audioParams
);
59 // Fired to request encoding of the given token.
60 static
void onEncodeTokenRequest
(DOMString clientId
,
61 EncodeTokenParameters encodeParams
);
63 // Fired when we have new samples to decode.
64 static
void onDecodeSamplesRequest
(DOMString clientId
,
65 DecodeSamplesParameters decodeParams
);