guest_view.mojom 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2022 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.
  4. module guest_view.mojom;
  5. import "mojo/public/mojom/base/values.mojom";
  6. // The renderer uses this interface to create GuestViews, make requests to the
  7. // browser to attach a GuestView to a container frame, and notify the browser
  8. // of state relating to a guest's container.
  9. interface GuestViewHost {
  10. // We have a RenderFrame with routing id of |embedder_local_frame_routing_id|.
  11. // We want this local frame to be replaced with a remote frame that points
  12. // to a GuestView. This message will attach the local frame to the guest.
  13. // The GuestView is identified by its ID: |guest_instance_id|.
  14. AttachToEmbedderFrame(
  15. int32 embedder_local_frame_routing_id,
  16. int32 element_instance_id,
  17. int32 guest_instance_id,
  18. mojo_base.mojom.DictionaryValue params) => ();
  19. // Sent by the renderer when a GuestView (identified by |view_instance_id|)
  20. // has been created in JavaScript.
  21. ViewCreated(int32 view_instance_id, string view_type);
  22. // Sent by the renderer when a GuestView (identified by |view_instance_id|)
  23. // has been garbage collected in JavaScript.
  24. // TODO(mcnee): Instead of a separate message for cleanup, consider having
  25. // `ViewCreated` incorporate a "keep alive" interface.
  26. ViewGarbageCollected(int32 view_instance_id);
  27. };