blob: 2c68883ebec30e8c785e4bd33bb5bb0763b93b56 [file] [log] [blame]
// Copyright 2018 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.
// API exposed by the diagnosticsd daemon. Normally the consumer of this API is
// the browser.
// NOTE: This mojom should be kept in sync with the copy in Chromium's repo in
// src/chrome/services/diagnosticsd/public/mojom/diagnosticsd.mojom.
module chromeos.diagnosticsd.mojom;
// Factory interface exposed by the diagnosticsd daemon, which allows both
// endpoints (the diagnosticsd and the browser) to exchange with their
// interfaces (DiagnosticsdService and DiagnosticsdClient correspondingly).
interface DiagnosticsdServiceFactory {
// Returns an interface to DiagnosticsdService in response to the passed
// interface to DiagnosticsdClient.
GetService@0(DiagnosticsdService& service, DiagnosticsdClient client) => ();
};
// Interface exposed by the diagnosticsd daemon.
interface DiagnosticsdService {
// Sends a message, originating from the diagnostics UI extension (hosted by
// the browser), to the diagnostics_processor daemon. The message contents are
// serialized JSON. Delivery of the message is not guaranteed (for example, if
// the diagnostics_processor daemon isn't running at the moment).
//
// The response will contain the JSON message returned by the
// diagnostics_processor daemon. The response handle will be unset if the
// request wasn't delivered to the daemon or the daemon made no reply.
SendUiMessageToDiagnosticsProcessor@0(handle<shared_buffer> json_message)
=> (handle<shared_buffer>? response_json_message);
// TODO(lamzin): remove when mojo library will support retrieving size of
// mojo handle and shared buffers will compatible across Chrome OS - chrome.
// Similar to SendUiMessageToDiagnosticsProcessor, but with additional
// size parameters and with using "handle" instead of "handle<shared_buffer>".
SendUiMessageToDiagnosticsProcessorWithSize@1(
handle<shared_buffer> json_message, int64 json_message_size) => (
handle<shared_buffer>? response_json_message,
int64 response_json_message_size);
};
// Interface exposed by the consumer of DiagnosticsdService. In production this
// is the browser.
interface DiagnosticsdClient {
// Sends a message, originating from the diagnostics_processor daemon, to the
// diagnositcs UI extension (hosted by the browser). The message contents are
// serialized JSON. Delivery of the message is not guaranteed (for example, if
// no user is currently logged in that has the diagnostics UI extension
// installed).
//
// The response will contain the JSON message returned by the
// diagnostics_processor daemon. The response handle will be unset if the
// request wasn't delivered to the extension or the extension made no reply.
SendDiagnosticsProcessorMessageToUi@0(handle<shared_buffer> json_message)
=> (handle<shared_buffer>? response_json_message);
};