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 {
|
2012-08-23 12:33:46 -07:00
|
|
|
|
|
|
|
namespace ipc {
|
|
|
|
class OptionalURIParams;
|
|
|
|
} // namespace ipc
|
|
|
|
|
2010-08-17 20:19:24 -07:00
|
|
|
namespace dom {
|
|
|
|
|
2010-09-15 15:55:08 -07:00
|
|
|
class ContentParent;
|
2013-09-12 12:24:10 -07:00
|
|
|
class PBrowserParent;
|
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
|
|
|
{
|
2012-08-23 12:33:46 -07:00
|
|
|
typedef mozilla::ipc::OptionalURIParams OptionalURIParams;
|
|
|
|
|
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);
|
2012-09-05 19:41:02 -07:00
|
|
|
bool RecvOnDataAvailable(const nsCString& data, const uint64_t& offset, const uint32_t& count);
|
2010-08-17 20:19:24 -07:00
|
|
|
bool RecvOnStopRequest(const nsresult& code);
|
2012-08-23 12:33:46 -07:00
|
|
|
|
|
|
|
ExternalHelperAppParent(const OptionalURIParams& uri, const int64_t& 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,
|
2013-09-12 12:24:10 -07:00
|
|
|
const OptionalURIParams& aReferrer,
|
|
|
|
PBrowserParent* aBrowser);
|
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;
|
2012-08-22 08:56:38 -07:00
|
|
|
int64_t mContentLength;
|
|
|
|
uint32_t mContentDisposition;
|
2011-09-09 15:41:04 -07:00
|
|
|
nsString mContentDispositionFilename;
|
|
|
|
nsCString mContentDispositionHeader;
|
2010-08-23 09:29:33 -07:00
|
|
|
nsCString mEntityID;
|
2010-08-17 20:19:24 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
2012-09-05 19:41:02 -07:00
|
|
|
} // namespace mozilla
|