netwerk/base/src/LoadContextInfo.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/base/src/LoadContextInfo.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,53 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#ifndef nsLoadContextInfo_h__
     1.9 +#define nsLoadContextInfo_h__
    1.10 +
    1.11 +#include "nsILoadContextInfo.h"
    1.12 +
    1.13 +class nsIChannel;
    1.14 +class nsILoadContext;
    1.15 +
    1.16 +namespace mozilla {
    1.17 +namespace net {
    1.18 +
    1.19 +class LoadContextInfo : public nsILoadContextInfo
    1.20 +{
    1.21 +public:
    1.22 +  NS_DECL_THREADSAFE_ISUPPORTS
    1.23 +  NS_DECL_NSILOADCONTEXTINFO
    1.24 +
    1.25 +  LoadContextInfo(bool aIsPrivate, uint32_t aAppId, bool aIsInBrowser, bool aIsAnonymous);
    1.26 +
    1.27 +private:
    1.28 +  virtual ~LoadContextInfo();
    1.29 +
    1.30 +protected:
    1.31 +  uint32_t mAppId;
    1.32 +  bool mIsPrivate : 1;
    1.33 +  bool mIsInBrowser : 1;
    1.34 +  bool mIsAnonymous : 1;
    1.35 +};
    1.36 +
    1.37 +LoadContextInfo *
    1.38 +GetLoadContextInfo(nsIChannel * aChannel);
    1.39 +
    1.40 +LoadContextInfo *
    1.41 +GetLoadContextInfo(nsILoadContext * aLoadContext,
    1.42 +                   bool aAnonymous);
    1.43 +
    1.44 +LoadContextInfo *
    1.45 +GetLoadContextInfo(nsILoadContextInfo* aInfo);
    1.46 +
    1.47 +LoadContextInfo *
    1.48 +GetLoadContextInfo(bool const aIsPrivate = false,
    1.49 +                   uint32_t const aAppId = nsILoadContextInfo::NO_APP_ID,
    1.50 +                   bool const aIsInBrowserElement = false,
    1.51 +                   bool const aIsAnonymous = false);
    1.52 +
    1.53 +} // net
    1.54 +} // mozilla
    1.55 +
    1.56 +#endif

mercurial