DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Implementation

Mercurial (dcc6d7a0dc00)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set expandtab ts=2 sw=2 sts=2 cin: */
/* 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/. */

#ifndef InterceptedJARChannel_h
#define InterceptedJARChannel_h

#include "nsJAR.h"
#include "nsJARChannel.h"
#include "nsIInputStream.h"
#include "nsIInputStreamPump.h"
#include "nsINetworkInterceptController.h"
#include "nsIOutputStream.h"
#include "mozilla/RefPtr.h"

#include "mozilla/Maybe.h"

class nsIStreamListener;
class nsJARChannel;

namespace mozilla {
namespace net {

// An object representing a channel that has been intercepted. This avoids
// complicating the actual channel implementation with the details of
// synthesizing responses.
class InterceptedJARChannel : public nsIInterceptedChannel
{
  // The interception controller to notify about the successful channel
  // interception.
  nsCOMPtr<nsINetworkInterceptController> mController;

  // The actual channel being intercepted.
  RefPtr<nsJARChannel> mChannel;

  // Reader-side of the synthesized response body.
  nsCOMPtr<nsIInputStream> mSynthesizedInput;

  // The stream to write the body of the synthesized response.
  nsCOMPtr<nsIOutputStream> mResponseBody;

  nsCOMPtr<nsISupports> mReleaseHandle;

  // The content type of the synthesized response.
  nsCString mContentType;

  virtual ~InterceptedJARChannel() {};
public:
  InterceptedJARChannel(nsJARChannel* aChannel,
                        nsINetworkInterceptController* aController);

  NS_DECL_ISUPPORTS
  NS_DECL_NSIINTERCEPTEDCHANNEL

  void NotifyController();
};

} // namespace net
} // namespace mozilla

#endif // InterceptedJARChannel_h