1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/base/src/nsCSPService.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,29 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsXPCOM.h" 1.10 +#include "nsIContentPolicy.h" 1.11 +#include "nsIChannel.h" 1.12 +#include "nsIChannelEventSink.h" 1.13 + 1.14 +#define CSPSERVICE_CONTRACTID "@mozilla.org/cspservice;1" 1.15 +#define CSPSERVICE_CID \ 1.16 + { 0x8d2f40b2, 0x4875, 0x4c95, \ 1.17 + { 0x97, 0xd9, 0x3f, 0x7d, 0xca, 0x2c, 0xb4, 0x60 } } 1.18 +class CSPService : public nsIContentPolicy, 1.19 + public nsIChannelEventSink 1.20 +{ 1.21 +public: 1.22 + NS_DECL_ISUPPORTS 1.23 + NS_DECL_NSICONTENTPOLICY 1.24 + NS_DECL_NSICHANNELEVENTSINK 1.25 + 1.26 + CSPService(); 1.27 + virtual ~CSPService(); 1.28 + static bool sCSPEnabled; 1.29 +private: 1.30 + // Maps origins to app status. 1.31 + nsDataHashtable<nsCStringHashKey, uint16_t> mAppStatusCache; 1.32 +};