blob: b43c895671a7c78ea2babcca83e808888968b18e [file] [log] [blame]
// 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 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 {
// 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(object 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(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(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(GenericDoneCallback callback);
// Uploads the log. Logging must be stopped before this function is called.
static void upload(UploadDoneCallback callback);
// Discards the log. Logging must be stopped before this function is called.
static void discard(GenericDoneCallback callback);
};
};