2015-07-31 23:50:08 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 ;*; */
|
|
|
|
/* vim: set sw=2 ts=8 et tw=80 : */
|
|
|
|
/* 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/. */
|
|
|
|
|
2016-04-21 17:59:17 +03:00
|
|
|
#ifndef mozilla__net__RequestContextService_h
|
|
|
|
#define mozilla__net__RequestContextService_h
|
2015-07-31 23:50:08 +03:00
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsInterfaceHashtable.h"
|
|
|
|
#include "nsIObserver.h"
|
2016-04-21 17:59:17 +03:00
|
|
|
#include "nsIRequestContext.h"
|
2015-07-31 23:50:08 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace net {
|
|
|
|
|
2016-04-21 17:59:17 +03:00
|
|
|
class RequestContextService final
|
|
|
|
: public nsIRequestContextService
|
|
|
|
, public nsIObserver
|
2015-07-31 23:50:08 +03:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
2016-04-21 17:59:17 +03:00
|
|
|
NS_DECL_NSIREQUESTCONTEXTSERVICE
|
2015-07-31 23:50:08 +03:00
|
|
|
NS_DECL_NSIOBSERVER
|
|
|
|
|
2016-04-21 17:59:17 +03:00
|
|
|
RequestContextService();
|
2015-07-31 23:50:08 +03:00
|
|
|
|
|
|
|
nsresult Init();
|
|
|
|
void Shutdown();
|
|
|
|
static nsresult Create(nsISupports *outer, const nsIID& iid, void **result);
|
|
|
|
|
|
|
|
private:
|
2016-04-21 17:59:17 +03:00
|
|
|
virtual ~RequestContextService();
|
2015-07-31 23:50:08 +03:00
|
|
|
|
2016-04-21 17:59:17 +03:00
|
|
|
static RequestContextService *sSelf;
|
2015-07-31 23:50:08 +03:00
|
|
|
|
2017-03-23 17:40:36 +03:00
|
|
|
nsInterfaceHashtable<nsUint64HashKey, nsIRequestContext> mTable;
|
|
|
|
uint32_t mRCIDNamespace;
|
|
|
|
uint32_t mNextRCID;
|
2015-07-31 23:50:08 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // ::mozilla::net
|
|
|
|
} // ::mozilla
|
|
|
|
|
2016-04-21 17:59:17 +03:00
|
|
|
#endif // mozilla__net__RequestContextService_h
|