blob: 48cd77e0b528e499a186fd14594c1267429cfb32 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.web;
/// The debug service which allows to enable the DevTools service on Contexts.
@discoverable
closed protocol Debug {
/// Enables the DevTools service on every subsequent [`Context`] creation and delivers
/// subsequent DevTools events to the supplied `listener`. The callback indicates when the
/// WebEngine is in a debuggable state. Events will be sent to every `listener` registered with
/// this method.
///
/// Because DevTools debugging is exposed using TCP as its transport, only
/// [`Context`]s created with access to network capabilities will report
/// themselves as available for debugging.
strict EnableDevTools(resource struct {
listener client_end:DevToolsListener;
}) -> ();
};
/// Interface used to observe DevTools service availability events.
closed protocol DevToolsListener {
/// Called when the DevTools service is available on a new [`Context`].
///
/// - `listener`: Channel over which DevTools events for the new [`Context`] will
/// be delivered. This channel will disconnect when the [`Context`] is destroyed.
strict OnContextDevToolsAvailable(resource struct {
listener server_end:DevToolsPerContextListener;
});
};
/// Interface supplied by the debugging component to observe the DevTools service opening event.
closed protocol DevToolsPerContextListener {
/// Called when the DevTools service starts accepting TCP connections on `port`. `port` will
/// remain open until the [`Context`] is destroyed.
///
/// - `port`: The port used by the service.
strict OnHttpPortOpen(struct {
port uint16;
});
};