2014-07-10 06:56:37 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2015-02-13 19:36:47 +00:00
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2014-07-10 06:56:37 +00: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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_LoadInfo_h
|
|
|
|
#define mozilla_LoadInfo_h
|
|
|
|
|
2014-07-16 20:16:12 +00:00
|
|
|
#include "nsIContentPolicy.h"
|
2014-07-10 06:56:37 +00:00
|
|
|
#include "nsILoadInfo.h"
|
2014-07-16 20:16:12 +00:00
|
|
|
#include "nsIPrincipal.h"
|
|
|
|
#include "nsIWeakReferenceUtils.h" // for nsWeakPtr
|
2014-11-05 00:34:00 +00:00
|
|
|
#include "nsIURI.h"
|
2014-07-16 20:16:12 +00:00
|
|
|
|
|
|
|
class nsINode;
|
2014-07-10 06:56:37 +00:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2015-01-07 23:51:20 +00:00
|
|
|
namespace net {
|
|
|
|
class HttpChannelParent;
|
|
|
|
class FTPChannelParent;
|
2015-02-17 18:09:58 +00:00
|
|
|
class WebSocketChannelParent;
|
2015-01-07 23:51:20 +00:00
|
|
|
}
|
|
|
|
|
2014-07-10 06:56:37 +00:00
|
|
|
/**
|
|
|
|
* Class that provides an nsILoadInfo implementation.
|
|
|
|
*/
|
2014-07-16 20:16:12 +00:00
|
|
|
class MOZ_EXPORT LoadInfo MOZ_FINAL : public nsILoadInfo
|
2014-07-10 06:56:37 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSILOADINFO
|
|
|
|
|
2014-11-14 16:55:59 +00:00
|
|
|
// aLoadingPrincipal MUST NOT BE NULL.
|
|
|
|
LoadInfo(nsIPrincipal* aLoadingPrincipal,
|
|
|
|
nsIPrincipal* aTriggeringPrincipal,
|
2014-07-16 20:16:12 +00:00
|
|
|
nsINode* aLoadingContext,
|
|
|
|
nsSecurityFlags aSecurityFlags,
|
2014-11-05 00:34:00 +00:00
|
|
|
nsContentPolicyType aContentPolicyType,
|
|
|
|
nsIURI* aBaseURI = nullptr);
|
2014-07-10 06:56:37 +00:00
|
|
|
|
|
|
|
private:
|
2015-01-07 23:51:20 +00:00
|
|
|
// private constructor that is only allowed to be called from within
|
|
|
|
// HttpChannelParent and FTPChannelParent declared as friends undeneath.
|
|
|
|
// In e10s we can not serialize nsINode, hence we store the innerWindowID.
|
|
|
|
LoadInfo(nsIPrincipal* aLoadingPrincipal,
|
|
|
|
nsIPrincipal* aTriggeringPrincipal,
|
|
|
|
nsSecurityFlags aSecurityFlags,
|
|
|
|
nsContentPolicyType aContentPolicyType,
|
|
|
|
uint32_t aInnerWindowID);
|
|
|
|
|
|
|
|
friend class net::HttpChannelParent;
|
|
|
|
friend class net::FTPChannelParent;
|
2015-02-17 18:09:58 +00:00
|
|
|
friend class net::WebSocketChannelParent;
|
2015-01-07 23:51:20 +00:00
|
|
|
|
2014-07-10 06:56:37 +00:00
|
|
|
~LoadInfo();
|
|
|
|
|
2014-11-14 16:55:59 +00:00
|
|
|
nsCOMPtr<nsIPrincipal> mLoadingPrincipal;
|
|
|
|
nsCOMPtr<nsIPrincipal> mTriggeringPrincipal;
|
2015-02-13 19:36:37 +00:00
|
|
|
nsWeakPtr mLoadingContext;
|
|
|
|
nsSecurityFlags mSecurityFlags;
|
|
|
|
nsContentPolicyType mContentPolicyType;
|
|
|
|
nsCOMPtr<nsIURI> mBaseURI;
|
|
|
|
uint32_t mInnerWindowID;
|
2014-07-10 06:56:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_LoadInfo_h
|
|
|
|
|