author Jonathan Hao <>
Wed, 16 Mar 2016 11:13:26 +0800
changeset 289194 5c69aaedbde9b43c106d2959e2c612bbf720f621
parent 288555 99d90f0790854bf63853c34fed3141c5cf5cffae
child 289354 093561da226a8bfca530afdbb0eaab4c57c6eb58
permissions -rw-r--r--
Bug 1235572 - Enforce SRI if content signature is enforced r=francois * * * [mq]: sri_fix MozReview-Commit-ID: 8vY9J4j3Eog * * * [mq]: loadInfo MozReview-Commit-ID: EZ8BUfCOXO6 * * * [mq]: add-logs MozReview-Commit-ID: 1jeyTq9nvlW

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et tw=80 ft=c: */

/* 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 */

include protocol PHttpChannel;
include protocol PFTPChannel;
include protocol PRtspChannel;
include URIParams;
include InputStreamParams;
include PBackgroundSharedTypes;

using mozilla::NeckoOriginAttributes from "mozilla/ipc/BackgroundUtils.h";
using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
using RequestHeaderTuples from "mozilla/net/PHttpChannelParams.h";
using struct nsHttpAtom from "nsHttp.h";
using class nsHttpResponseHead from "nsHttpResponseHead.h";

namespace mozilla {
namespace net {

// LoadInfo IPDL structs

struct LoadInfoArgs
  PrincipalInfo    requestingPrincipalInfo;
  PrincipalInfo    triggeringPrincipalInfo;
  uint32_t         securityFlags;
  uint32_t         contentPolicyType;
  uint32_t         tainting;
  bool             upgradeInsecureRequests;
  bool             verifySignedContent;
  bool             enforceSRI;
  uint64_t         innerWindowID;
  uint64_t         outerWindowID;
  uint64_t         parentOuterWindowID;
  bool             enforceSecurity;
  bool             initialSecurityCheckDone;
  bool             isInThirdPartyContext;
  NeckoOriginAttributes originAttributes;
  PrincipalInfo[]  redirectChainIncludingInternalRedirects;
  PrincipalInfo[]  redirectChain;
  nsCString[]      corsUnsafeHeaders;
  bool             forcePreflight;
  bool             isPreflight;

 * Not every channel necessarily has a loadInfo attached.
union OptionalLoadInfoArgs

// HTTP IPDL structs

union OptionalHttpResponseHead

struct CorsPreflightArgs
  nsCString[]   unsafeHeaders;

union OptionalCorsPreflightArgs

struct HttpChannelOpenArgs
  URIParams                   uri;
  // - TODO: bug 571161: unclear if any HTTP channel clients ever
  // set originalURI != uri (about:credits?); also not clear if
  // chrome channel would ever need to know.  Get rid of next arg?
  OptionalURIParams           original;
  OptionalURIParams           doc;
  OptionalURIParams           referrer;
  uint32_t                    referrerPolicy;
  OptionalURIParams           apiRedirectTo;
  OptionalURIParams           topWindowURI;
  uint32_t                    loadFlags;
  RequestHeaderTuples         requestHeaders;
  nsCString                   requestMethod;
  OptionalInputStreamParams   uploadStream;
  bool                        uploadStreamHasHeaders;
  uint16_t                    priority;
  uint32_t                    classOfService;
  uint8_t                     redirectionLimit;
  bool                        allowPipelining;
  bool                        allowSTS;
  uint32_t                    thirdPartyFlags;
  bool                        resumeAt;
  uint64_t                    startPos;
  nsCString                   entityID;
  bool                        chooseApplicationCache;
  nsCString                   appCacheClientID;
  bool                        allowSpdy;
  bool                        allowAltSvc;
  OptionalFileDescriptorSet   fds;
  OptionalLoadInfoArgs        loadInfo;
  OptionalHttpResponseHead    synthesizedResponseHead;
  nsCString                   synthesizedSecurityInfoSerialization;
  uint32_t                    cacheKey;
  nsCString                   schedulingContextID;
  OptionalCorsPreflightArgs   preflightArgs;
  uint32_t                    initialRwin;
  bool                        blockAuthPrompt;
  bool                        suspendAfterSynthesizeResponse;
  bool                        allowStaleCacheContent;

struct HttpChannelConnectArgs
  uint32_t channelId;
  bool shouldIntercept;

union HttpChannelCreationArgs
  HttpChannelOpenArgs;      // For AsyncOpen: the common case.
  HttpChannelConnectArgs;   // Used for redirected-to channels

// FTP IPDL structs

struct FTPChannelOpenArgs
  URIParams                 uri;
  uint64_t                  startPos;
  nsCString                 entityID;
  OptionalInputStreamParams uploadStream;
  OptionalLoadInfoArgs      loadInfo;

struct FTPChannelConnectArgs
  uint32_t channelId;

union FTPChannelCreationArgs
  FTPChannelOpenArgs;      // For AsyncOpen: the common case.
  FTPChannelConnectArgs;   // Used for redirected-to channels

struct HttpChannelDiverterArgs
  PHttpChannel mChannel;
  bool mApplyConversion;

union ChannelDiverterArgs

// RTSP IPDL structs

struct RtspChannelConnectArgs
  URIParams uri;
  uint32_t channelId;

} // namespace ipc
} // namespace mozilla