dom/filehandle/PBackgroundFileRequest.ipdl
author Narcis Beleuzu <nbeleuzu@mozilla.com>
Sun, 29 Jul 2018 03:55:23 +0300
changeset 483986 aaee68beff800bcf076d9c49b5c1f6531b135579
parent 405551 66fafc2b84cf145190468eee4e08de99e5934ad6
child 522326 4d2c953008cd91e6409c9c1abdc921d7d1cc99c4
permissions -rw-r--r--
Backed out 2 changesets (bug 1463016, bug 1463291) for geckoview failures Backed out changeset fcfb99baa0f0 (bug 1463291) Backed out changeset 0d69b4fb1ed4 (bug 1463016)

/* 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 PBackgroundFileHandle;
include protocol PPendingIPCBlob;

using struct mozilla::void_t
  from "ipc/IPCMessageUtils.h";

namespace mozilla {
namespace dom {

union FileRequestSize
{
  void_t;
  uint64_t;
};

union FileRequestLastModified
{
  void_t;
  int64_t;
};

struct FileRequestMetadata
{
  FileRequestSize size;
  FileRequestLastModified lastModified;
};

struct FileRequestGetMetadataResponse
{
  FileRequestMetadata metadata;
};

struct FileRequestReadResponse
{
  nsCString data;
};

struct FileRequestWriteResponse
{
};

struct FileRequestTruncateResponse
{
};

struct FileRequestFlushResponse
{
};

struct FileRequestGetFileResponse
{
  PPendingIPCBlob file;
  FileRequestMetadata metadata;
};

union FileRequestResponse
{
  nsresult;
  FileRequestGetMetadataResponse;
  FileRequestReadResponse;
  FileRequestWriteResponse;
  FileRequestTruncateResponse;
  FileRequestFlushResponse;
  FileRequestGetFileResponse;
};

protocol PBackgroundFileRequest
{
  manager PBackgroundFileHandle;

child:
  async __delete__(FileRequestResponse response);

  async Progress(uint64_t progress,
                 uint64_t progressMax);
};

} // namespace dom
} // namespace mozilla