2010-08-17 20:19:24 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
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/. */
|
2010-08-17 20:19:24 -07:00
|
|
|
|
|
|
|
#include "mozilla/dom/PExternalHelperAppParent.h"
|
|
|
|
#include "nsIChannel.h"
|
2010-09-13 11:17:00 -07:00
|
|
|
#include "nsIMultiPartChannel.h"
|
2010-08-23 09:29:33 -07:00
|
|
|
#include "nsIResumableChannel.h"
|
2010-08-17 20:19:24 -07:00
|
|
|
#include "nsHashPropertyBag.h"
|
|
|
|
|
|
|
|
namespace IPC {
|
|
|
|
class URI;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2010-09-15 15:55:08 -07:00
|
|
|
class ContentParent;
|
2010-08-17 20:19:24 -07:00
|
|
|
|
|
|
|
class ExternalHelperAppParent : public PExternalHelperAppParent
|
|
|
|
, public nsHashPropertyBag
|
|
|
|
, public nsIChannel
|
2010-09-13 11:17:00 -07:00
|
|
|
, public nsIMultiPartChannel
|
2010-08-23 09:29:33 -07:00
|
|
|
, public nsIResumableChannel
|
2010-08-17 20:19:24 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIREQUEST
|
|
|
|
NS_DECL_NSICHANNEL
|
2010-09-13 11:17:00 -07:00
|
|
|
NS_DECL_NSIMULTIPARTCHANNEL
|
2010-08-23 09:29:33 -07:00
|
|
|
NS_DECL_NSIRESUMABLECHANNEL
|
2010-08-17 20:19:24 -07:00
|
|
|
|
2010-08-23 09:29:33 -07:00
|
|
|
bool RecvOnStartRequest(const nsCString& entityID);
|
2010-08-17 20:19:24 -07:00
|
|
|
bool RecvOnDataAvailable(const nsCString& data, const PRUint32& offset, const PRUint32& count);
|
|
|
|
bool RecvOnStopRequest(const nsresult& code);
|
|
|
|
|
|
|
|
ExternalHelperAppParent(const IPC::URI& uri, const PRInt64& contentLength);
|
2010-09-15 15:55:08 -07:00
|
|
|
void Init(ContentParent *parent,
|
2010-08-17 20:19:24 -07:00
|
|
|
const nsCString& aMimeContentType,
|
2010-09-13 11:17:00 -07:00
|
|
|
const nsCString& aContentDisposition,
|
2011-09-28 23:19:26 -07:00
|
|
|
const bool& aForceSave,
|
2010-11-21 11:21:59 -08:00
|
|
|
const IPC::URI& aReferrer);
|
2010-08-17 20:19:24 -07:00
|
|
|
virtual ~ExternalHelperAppParent();
|
|
|
|
|
|
|
|
private:
|
|
|
|
nsCOMPtr<nsIStreamListener> mListener;
|
|
|
|
nsCOMPtr<nsIURI> mURI;
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mPending;
|
2010-08-17 20:19:24 -07:00
|
|
|
nsLoadFlags mLoadFlags;
|
|
|
|
nsresult mStatus;
|
|
|
|
PRInt64 mContentLength;
|
2011-09-09 15:41:04 -07:00
|
|
|
PRUint32 mContentDisposition;
|
|
|
|
nsString mContentDispositionFilename;
|
|
|
|
nsCString mContentDispositionHeader;
|
2010-08-23 09:29:33 -07:00
|
|
|
nsCString mEntityID;
|
2010-08-17 20:19:24 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|