2015-05-03 19:32:37 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 11:12: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/. */
|
2010-01-22 21:38:21 +00:00
|
|
|
|
2014-04-01 16:35:22 +00:00
|
|
|
#ifndef nsCSPService_h___
|
|
|
|
#define nsCSPService_h___
|
|
|
|
|
2010-01-22 21:38:21 +00:00
|
|
|
#include "nsXPCOM.h"
|
|
|
|
#include "nsIContentPolicy.h"
|
2010-04-23 17:03:03 +00:00
|
|
|
#include "nsIChannel.h"
|
|
|
|
#include "nsIChannelEventSink.h"
|
2014-06-20 02:01:40 +00:00
|
|
|
#include "nsDataHashtable.h"
|
2010-01-22 21:38:21 +00:00
|
|
|
|
|
|
|
#define CSPSERVICE_CONTRACTID "@mozilla.org/cspservice;1"
|
|
|
|
#define CSPSERVICE_CID \
|
|
|
|
{ 0x8d2f40b2, 0x4875, 0x4c95, \
|
|
|
|
{ 0x97, 0xd9, 0x3f, 0x7d, 0xca, 0x2c, 0xb4, 0x60 } }
|
2010-04-23 17:03:03 +00:00
|
|
|
class CSPService : public nsIContentPolicy,
|
|
|
|
public nsIChannelEventSink
|
2010-01-22 21:38:21 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSICONTENTPOLICY
|
2010-04-23 17:03:03 +00:00
|
|
|
NS_DECL_NSICHANNELEVENTSINK
|
2010-07-13 03:12:32 +00:00
|
|
|
|
2010-01-22 21:38:21 +00:00
|
|
|
CSPService();
|
2011-09-29 06:19:26 +00:00
|
|
|
static bool sCSPEnabled;
|
2014-06-25 02:09:15 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~CSPService();
|
|
|
|
|
2013-10-17 17:56:12 +00:00
|
|
|
private:
|
|
|
|
// Maps origins to app status.
|
|
|
|
nsDataHashtable<nsCStringHashKey, uint16_t> mAppStatusCache;
|
2010-01-22 21:38:21 +00:00
|
|
|
};
|
2014-04-01 16:35:22 +00:00
|
|
|
#endif /* nsCSPService_h___ */
|