2009-09-08 23:31:35 -07:00
|
|
|
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* 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/. */
|
2009-09-08 23:31:35 -07:00
|
|
|
|
2010-04-26 18:11:46 -07:00
|
|
|
include protocol PPluginInstance;
|
2009-09-08 23:31:35 -07:00
|
|
|
|
2009-11-12 14:20:20 -08:00
|
|
|
include "mozilla/plugins/PluginMessageUtils.h";
|
|
|
|
|
2009-09-08 23:31:35 -07:00
|
|
|
using mozilla::plugins::Buffer;
|
|
|
|
using mozilla::plugins::IPCByteRanges;
|
|
|
|
|
|
|
|
using NPError;
|
2009-12-03 00:16:14 -08:00
|
|
|
using NPReason;
|
2009-06-30 11:51:05 -07:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace plugins {
|
|
|
|
|
2009-09-08 23:31:35 -07:00
|
|
|
/**
|
|
|
|
* NPBrowserStream represents a NPStream sent from the browser to the plugin.
|
|
|
|
*/
|
|
|
|
|
2009-09-09 07:04:09 -07:00
|
|
|
rpc protocol PBrowserStream
|
2009-06-30 11:51:05 -07:00
|
|
|
{
|
2009-09-08 23:31:35 -07:00
|
|
|
manager PPluginInstance;
|
2009-06-30 11:51:05 -07:00
|
|
|
|
2009-09-08 23:31:35 -07:00
|
|
|
child:
|
2010-02-23 13:45:00 -08:00
|
|
|
async Write(int32_t offset, Buffer data,
|
|
|
|
uint32_t newlength);
|
2011-10-19 07:46:24 -07:00
|
|
|
async NPP_StreamAsFile(nsCString fname);
|
2010-02-23 13:45:00 -08:00
|
|
|
|
2010-02-23 13:45:00 -08:00
|
|
|
/**
|
|
|
|
* NPP_DestroyStream may race with other messages: the child acknowledges
|
|
|
|
* the message with StreamDestroyed before this actor is deleted.
|
|
|
|
*/
|
|
|
|
async NPP_DestroyStream(NPReason reason);
|
|
|
|
async __delete__();
|
|
|
|
|
2009-09-08 23:31:35 -07:00
|
|
|
parent:
|
|
|
|
rpc NPN_RequestRead(IPCByteRanges ranges)
|
|
|
|
returns (NPError result);
|
2010-02-23 13:45:00 -08:00
|
|
|
async NPN_DestroyStream(NPReason reason);
|
|
|
|
async StreamDestroyed();
|
2009-12-03 00:16:14 -08:00
|
|
|
|
2010-02-23 13:45:00 -08:00
|
|
|
/*
|
|
|
|
TODO: turn on state machine.
|
|
|
|
|
|
|
|
// need configurable start state: if the constructor
|
|
|
|
// returns an error in result, start state should
|
|
|
|
// be DELETING.
|
|
|
|
start state ALIVE:
|
|
|
|
send Write goto ALIVE;
|
|
|
|
call NPP_StreamAsFile goto ALIVE;
|
|
|
|
send NPP_DestroyStream goto ALIVE;
|
|
|
|
answer NPN_RequestRead goto ALIVE;
|
|
|
|
recv NPN_DestroyStream goto DYING;
|
|
|
|
|
|
|
|
state DYING:
|
|
|
|
answer NPN_RequestRead goto DYING;
|
|
|
|
recv NPN_DestroyStream goto DYING;
|
|
|
|
recv StreamDestroyed goto DELETING;
|
|
|
|
|
|
|
|
state DELETING:
|
|
|
|
send __delete__;
|
|
|
|
*/
|
2009-09-08 23:31:35 -07:00
|
|
|
};
|
2009-06-30 11:51:05 -07:00
|
|
|
|
2009-09-08 23:31:35 -07:00
|
|
|
} // namespace plugins
|
|
|
|
} // namespace mozilla
|