2010-08-18 07:19:24 +04: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 15:12:37 +04: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-18 07:19:24 +04:00
|
|
|
|
|
|
|
#include "mozilla/dom/PExternalHelperAppParent.h"
|
|
|
|
#include "nsIChannel.h"
|
2010-09-13 22:17:00 +04:00
|
|
|
#include "nsIMultiPartChannel.h"
|
2010-08-23 20:29:33 +04:00
|
|
|
#include "nsIResumableChannel.h"
|
2010-08-18 07:19:24 +04:00
|
|
|
#include "nsHashPropertyBag.h"
|
|
|
|
|
|
|
|
namespace IPC {
|
|
|
|
class URI;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2010-09-16 02:55:08 +04:00
|
|
|
class ContentParent;
|
2010-08-18 07:19:24 +04:00
|
|
|
|
|
|
|
class ExternalHelperAppParent : public PExternalHelperAppParent
|
|
|
|
, public nsHashPropertyBag
|
|
|
|
, public nsIChannel
|
2010-09-13 22:17:00 +04:00
|
|
|
, public nsIMultiPartChannel
|
2010-08-23 20:29:33 +04:00
|
|
|
, public nsIResumableChannel
|
2010-08-18 07:19:24 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIREQUEST
|
|
|
|
NS_DECL_NSICHANNEL
|
2010-09-13 22:17:00 +04:00
|
|
|
NS_DECL_NSIMULTIPARTCHANNEL
|
2010-08-23 20:29:33 +04:00
|
|
|
NS_DECL_NSIRESUMABLECHANNEL
|
2010-08-18 07:19:24 +04:00
|
|
|
|
2010-08-23 20:29:33 +04:00
|
|
|
bool RecvOnStartRequest(const nsCString& entityID);
|
2012-08-22 19:56:38 +04:00
|
|
|
bool RecvOnDataAvailable(const nsCString& data, const uint32_t& offset, const uint32_t& count);
|
2010-08-18 07:19:24 +04:00
|
|
|
bool RecvOnStopRequest(const nsresult& code);
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
ExternalHelperAppParent(const IPC::URI& uri, const int64_t& contentLength);
|
2010-09-16 02:55:08 +04:00
|
|
|
void Init(ContentParent *parent,
|
2010-08-18 07:19:24 +04:00
|
|
|
const nsCString& aMimeContentType,
|
2010-09-13 22:17:00 +04:00
|
|
|
const nsCString& aContentDisposition,
|
2011-09-29 10:19:26 +04:00
|
|
|
const bool& aForceSave,
|
2010-11-21 22:21:59 +03:00
|
|
|
const IPC::URI& aReferrer);
|
2010-08-18 07:19:24 +04:00
|
|
|
virtual ~ExternalHelperAppParent();
|
|
|
|
|
|
|
|
private:
|
|
|
|
nsCOMPtr<nsIStreamListener> mListener;
|
|
|
|
nsCOMPtr<nsIURI> mURI;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mPending;
|
2010-08-18 07:19:24 +04:00
|
|
|
nsLoadFlags mLoadFlags;
|
|
|
|
nsresult mStatus;
|
2012-08-22 19:56:38 +04:00
|
|
|
int64_t mContentLength;
|
|
|
|
uint32_t mContentDisposition;
|
2011-09-10 02:41:04 +04:00
|
|
|
nsString mContentDispositionFilename;
|
|
|
|
nsCString mContentDispositionHeader;
|
2010-08-23 20:29:33 +04:00
|
|
|
nsCString mEntityID;
|
2010-08-18 07:19:24 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|