summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/api/webrtc_logging_private.idl
blob: b07aed44cd5f5e5cba33be29b6560608f75945ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Use the <code>chrome.webrtcLoggingPrivate</code> API to control diagnostic
// WebRTC logging.
[nodoc] namespace webrtcLoggingPrivate {
  dictionary MetaDataEntry {
    // The meta data entry key.
    DOMString key;

    // The meta data entry value.
    DOMString value;
  };

  dictionary UploadResult {
    // The report ID for the uploaded log. Will be empty if not successful.
    DOMString reportId;
  };

  callback GenericDoneCallback = void ();
  callback UploadDoneCallback = void (UploadResult result);

  interface Functions {
    // For all functions, |tabId| determines which render process to apply
    // the operation on. |tabId| is the identifier from the chrome.tabs API.
    // |securityOrigin| is the security origin for the tab identified by |tabId|
    // and is used for verifying that the tab is the correct one and has not
    // been navigated away from.

    // Sets additional custom meta data that will be uploaded along with the
    // log. |metaData| is a dictionary of the metadata (key, value).
    static void setMetaData(long tabId,
                            DOMString securityOrigin,
                            MetaDataEntry[] metaData,
                            GenericDoneCallback callback);

    // Starts logging. If logging has already been started for this render
    // process, the call will be ignored. |appSessionId| is the unique session
    // ID which will be added to the log.
    static void start(long tabId,
                      DOMString securityOrigin,
                      GenericDoneCallback callback);

    // Sets whether the log should be uploaded automatically for the case when
    // the render process goes away (tab is closed or crashes) and stop has not
    // been called before that. If |shouldUpload| is true it will be uploaded,
    // otherwise it will be discarded. The default setting is to discard it.
    static void setUploadOnRenderClose(long tabId,
                                       DOMString securityOrigin,
                                       boolean shouldUpload);

    // Stops logging. After stop has finished, either upload() or discard()
    // should be called, otherwise the log will be kept in memory until the
    // render process is closed or logging restarted.
    static void stop(long tabId,
                     DOMString securityOrigin,
                     GenericDoneCallback callback);

    // Uploads the log. Logging must be stopped before this function is called.
    static void upload(long tabId,
                       DOMString securityOrigin,
                       UploadDoneCallback callback);

    // Discards the log. Logging must be stopped before this function is called.
    static void discard(long tabId,
                        DOMString securityOrigin,
                        GenericDoneCallback callback);
  };
};