dom/plugins/ipc/PBrowserStream.ipdl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/plugins/ipc/PBrowserStream.ipdl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,68 @@
     1.4 +/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +include protocol PPluginInstance;
    1.10 +
    1.11 +
    1.12 +using mozilla::plugins::Buffer from "mozilla/plugins/PluginMessageUtils.h";
    1.13 +using mozilla::plugins::IPCByteRanges from "mozilla/plugins/PluginMessageUtils.h";
    1.14 +
    1.15 +using NPError from "npapi.h";
    1.16 +using NPReason from "npapi.h";
    1.17 +
    1.18 +namespace mozilla {
    1.19 +namespace plugins {
    1.20 +
    1.21 +/**
    1.22 + * NPBrowserStream represents a NPStream sent from the browser to the plugin.
    1.23 + */
    1.24 +
    1.25 +intr protocol PBrowserStream
    1.26 +{
    1.27 +  manager PPluginInstance;
    1.28 +
    1.29 +child:
    1.30 +  async Write(int32_t offset, Buffer data,
    1.31 +              uint32_t newlength);
    1.32 +  async NPP_StreamAsFile(nsCString fname);
    1.33 +
    1.34 +  /**
    1.35 +   * NPP_DestroyStream may race with other messages: the child acknowledges
    1.36 +   * the message with StreamDestroyed before this actor is deleted.
    1.37 +   */
    1.38 +  async NPP_DestroyStream(NPReason reason);
    1.39 +  async __delete__();
    1.40 +
    1.41 +parent:
    1.42 +  intr NPN_RequestRead(IPCByteRanges ranges)
    1.43 +    returns (NPError result);
    1.44 +  async NPN_DestroyStream(NPReason reason);
    1.45 +  async StreamDestroyed();
    1.46 +
    1.47 +/*
    1.48 +  TODO: turn on state machine.
    1.49 +
    1.50 +  // need configurable start state: if the constructor
    1.51 +  // returns an error in result, start state should
    1.52 +  // be DELETING.
    1.53 +start state ALIVE:
    1.54 +  send Write goto ALIVE;
    1.55 +  call NPP_StreamAsFile goto ALIVE;
    1.56 +  send NPP_DestroyStream goto ALIVE;
    1.57 +  answer NPN_RequestRead goto ALIVE;
    1.58 +  recv NPN_DestroyStream goto DYING;
    1.59 +
    1.60 +state DYING:
    1.61 +  answer NPN_RequestRead goto DYING;
    1.62 +  recv NPN_DestroyStream goto DYING;
    1.63 +  recv StreamDestroyed goto DELETING;
    1.64 +
    1.65 +state DELETING:
    1.66 +  send __delete__;
    1.67 +*/
    1.68 +};
    1.69 +
    1.70 +} // namespace plugins
    1.71 +} // namespace mozilla

mercurial