netwerk/protocol/http/PHttpChannel.ipdl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/protocol/http/PHttpChannel.ipdl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,145 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set sw=2 ts=8 et tw=80 ft=cpp : */
     1.6 +
     1.7 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    1.10 +
    1.11 +include protocol PNecko;
    1.12 +include InputStreamParams;
    1.13 +include URIParams;
    1.14 +
    1.15 +include protocol PBlob; //FIXME: bug #792908
    1.16 +
    1.17 +include "mozilla/net/NeckoMessageUtils.h";
    1.18 +
    1.19 +using RequestHeaderTuples from "mozilla/net/PHttpChannelParams.h";
    1.20 +using class nsHttpHeaderArray from "nsHttpHeaderArray.h";
    1.21 +using class nsHttpResponseHead from "nsHttpResponseHead.h";
    1.22 +using struct nsHttpAtom from "nsHttp.h";
    1.23 +using mozilla::net::NetAddr from "mozilla/net/DNS.h";
    1.24 +
    1.25 +namespace mozilla {
    1.26 +namespace net {
    1.27 +
    1.28 +//-------------------------------------------------------------------
    1.29 +protocol PHttpChannel
    1.30 +{
    1.31 +  manager PNecko;
    1.32 +
    1.33 +parent:
    1.34 +  // Note: channels are opened during construction, so no open method here:
    1.35 +  // see PNecko.ipdl
    1.36 +
    1.37 +  SetPriority(uint16_t priority);
    1.38 +
    1.39 +  SetCacheTokenCachedCharset(nsCString charset);
    1.40 +
    1.41 +  UpdateAssociatedContentSecurity(int32_t broken,
    1.42 +                                  int32_t no);
    1.43 +  Suspend();
    1.44 +  Resume();
    1.45 +
    1.46 +  Cancel(nsresult status);
    1.47 +
    1.48 +  // Reports approval/veto of redirect by child process redirect observers
    1.49 +  Redirect2Verify(nsresult result, RequestHeaderTuples changedHeaders,
    1.50 +                  OptionalURIParams apiRedirectTo);
    1.51 +
    1.52 +  // For document loads we keep this protocol open after child's
    1.53 +  // OnStopRequest, and send this msg (instead of __delete__) to allow
    1.54 +  // partial cleanup on parent.
    1.55 +  DocumentChannelCleanup();
    1.56 +
    1.57 +  // This might have to be sync. If this fails we must fail the document load
    1.58 +  // to avoid endless loop.
    1.59 +  //
    1.60 +  // Explanation: the document loaded was loaded from the offline cache. But
    1.61 +  // the cache group id (the manifest URL) of the cache group it was loaded
    1.62 +  // from is different then the manifest the document refers to in the html
    1.63 +  // tag. If we detect this during the cache selection algorithm, we must not
    1.64 +  // load this document from the offline cache group it was just loaded from.
    1.65 +  // Marking the cache entry as foreign in its cache group will prevent
    1.66 +  // the document to load from the bad offline cache group. After it is marked,
    1.67 +  // we reload the document to take the effect. If we fail to mark the entry
    1.68 +  // as foreign, we will end up in the same situation and reload again and
    1.69 +  // again, indefinitely.
    1.70 +  MarkOfflineCacheEntryAsForeign();
    1.71 +
    1.72 +  // Divert OnDataAvailable to the parent.
    1.73 +  DivertOnDataAvailable(nsCString data,
    1.74 +                        uint64_t  offset,
    1.75 +                        uint32_t  count);
    1.76 +
    1.77 +  // Divert OnStopRequest to the parent.
    1.78 +  DivertOnStopRequest(nsresult statusCode);
    1.79 +
    1.80 +  // Child has no more events/messages to divert to the parent.
    1.81 +  DivertComplete();
    1.82 +
    1.83 +  __delete__();
    1.84 +
    1.85 +child:
    1.86 +  OnStartRequest(nsresult            channelStatus,
    1.87 +                 nsHttpResponseHead  responseHead,
    1.88 +                 bool                useResponseHead,
    1.89 +                 nsHttpHeaderArray   requestHeaders,
    1.90 +                 bool                isFromCache,
    1.91 +                 bool                cacheEntryAvailable,
    1.92 +                 uint32_t            cacheExpirationTime,
    1.93 +                 nsCString           cachedCharset,
    1.94 +                 nsCString           securityInfoSerialization,
    1.95 +                 NetAddr             selfAddr,
    1.96 +                 NetAddr             peerAddr,
    1.97 +                 int16_t             redirectCount);
    1.98 +
    1.99 +  // Combines a single OnDataAvailable and its associated OnProgress &
   1.100 +  // OnStatus calls into one IPDL message
   1.101 +  OnTransportAndData(nsresult  channelStatus,
   1.102 +                     nsresult  transportStatus,
   1.103 +                     uint64_t  progress,
   1.104 +                     uint64_t  progressMax,
   1.105 +                     nsCString data,
   1.106 +                     uint64_t  offset,
   1.107 +                     uint32_t  count);
   1.108 +
   1.109 +  OnStopRequest(nsresult channelStatus);
   1.110 +
   1.111 +  OnProgress(uint64_t progress, uint64_t progressMax);
   1.112 +
   1.113 +  OnStatus(nsresult status);
   1.114 +
   1.115 +  // Used to cancel child channel if we hit errors during creating and
   1.116 +  // AsyncOpen of nsHttpChannel on the parent.
   1.117 +  FailedAsyncOpen(nsresult status);
   1.118 +
   1.119 +  // Called to initiate content channel redirect, starts talking to sinks
   1.120 +  // on the content process and reports result via Redirect2Verify above
   1.121 +  Redirect1Begin(uint32_t           newChannelId,
   1.122 +                 URIParams          newUri,
   1.123 +                 uint32_t           redirectFlags,
   1.124 +                 nsHttpResponseHead responseHead);
   1.125 +
   1.126 +  // Called if redirect successful so that child can complete setup.
   1.127 +  Redirect3Complete();
   1.128 +
   1.129 +  // Associte the child with an application ids
   1.130 +  AssociateApplicationCache(nsCString groupID,
   1.131 +                            nsCString clientID);
   1.132 +
   1.133 +  // Parent has been suspended for diversion; no more events to be enqueued.
   1.134 +  FlushedForDiversion();
   1.135 +
   1.136 +  // Child should resume processing the ChannelEventQueue, i.e. diverting any
   1.137 +  // OnDataAvailable and OnStopRequest messages in the queue back to the parent.
   1.138 +  DivertMessages();
   1.139 +
   1.140 +  // Tell child to delete channel (all IPDL deletes must be done from child to
   1.141 +  // avoid races: see bug 591708).
   1.142 +  DeleteSelf();
   1.143 +};
   1.144 +
   1.145 +
   1.146 +} // namespace net
   1.147 +} // namespace mozilla
   1.148 +

mercurial