dom/presentation/ipc/PPresentation.ipdl
author Chun-Min Chang <chun.m.chang@gmail.com>
Tue, 04 Oct 2016 14:27:05 +0800
changeset 343131 64d86a1d172d80b8467c1ab015ebe04acb831185
parent 342515 f8797c70734845bba0e918977e276f6b76e9769e
child 348432 4975b2d475fbda30526ec997abd00f94b4fef55a
permissions -rw-r--r--
Bug 1306210 - Expose the principal of the device request. r=smaug MozReview-Commit-ID: ihzebnIUUU

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et ft=cpp : */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

include protocol PContent;
include protocol PPresentationRequest;
include protocol PPresentationBuilder;

include InputStreamParams;

using class IPC::Principal from "mozilla/dom/PermissionMessageUtils.h";
using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";

namespace mozilla {
namespace dom {

struct StartSessionRequest
{
  nsString[] urls;
  nsString sessionId;
  nsString origin;
  nsString deviceId;
  uint64_t windowId;
  TabId tabId;
  Principal principal;
};

struct SendSessionMessageRequest
{
  nsString sessionId;
  uint8_t role;
  nsString data;
};

struct CloseSessionRequest
{
  nsString sessionId;
  uint8_t role;
  uint8_t closedReason;
};

struct TerminateSessionRequest
{
  nsString sessionId;
  uint8_t role;
};

struct ReconnectSessionRequest
{
  nsString[] urls;
  nsString sessionId;
  uint8_t role;
};

struct BuildTransportRequest
{
  nsString sessionId;
  uint8_t role;
};

union PresentationIPCRequest
{
  StartSessionRequest;
  SendSessionMessageRequest;
  CloseSessionRequest;
  TerminateSessionRequest;
  ReconnectSessionRequest;
  BuildTransportRequest;
};

sync protocol PPresentation
{
  manager PContent;
  manages PPresentationBuilder;
  manages PPresentationRequest;

child:
  async NotifyAvailableChange(bool aAvailable);
  async NotifySessionStateChange(nsString aSessionId,
                                 uint16_t aState,
                                 nsresult aReason);
  async NotifyMessage(nsString aSessionId, nsCString aData, bool aIsBinary);
  async NotifySessionConnect(uint64_t aWindowId, nsString aSessionId);
  async NotifyCloseSessionTransport(nsString aSessionId,
                                    uint8_t aRole,
                                    nsresult aReason);

  async PPresentationBuilder(nsString aSessionId, uint8_t aRole);

parent:
  async __delete__();

  async RegisterAvailabilityHandler();
  async UnregisterAvailabilityHandler();

  async RegisterSessionHandler(nsString aSessionId, uint8_t aRole);
  async UnregisterSessionHandler(nsString aSessionId, uint8_t aRole);

  async RegisterRespondingHandler(uint64_t aWindowId);
  async UnregisterRespondingHandler(uint64_t aWindowId);

  async PPresentationRequest(PresentationIPCRequest aRequest);

  async NotifyReceiverReady(nsString aSessionId, uint64_t aWindowId, bool aIsLoading);
  async NotifyTransportClosed(nsString aSessionId, uint8_t aRole, nsresult aReason);
};

} // namespace dom
} // namespace mozilla