Fix FreeBSD build.
[haiku.git] / headers / os / net / UrlContext.h
blob514c523ea4e453acc14cfb7caf9c4cf62c3e719f
1 /*
2 * Copyright 2010-2015 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
7 #ifndef _B_URL_CONTEXT_H_
8 #define _B_URL_CONTEXT_H_
11 #include <Certificate.h>
12 #include <HttpAuthentication.h>
13 #include <NetworkCookieJar.h>
14 #include <Referenceable.h>
17 namespace BPrivate {
18 template <class key, class value> class SynchronizedHashMap;
19 class HashString;
23 class BUrlContext: public BReferenceable {
24 public:
25 BUrlContext();
26 ~BUrlContext();
28 // Context modifiers
29 void SetCookieJar(
30 const BNetworkCookieJar& cookieJar);
31 void AddAuthentication(const BUrl& url,
32 const BHttpAuthentication& authentication);
33 void SetProxy(BString host, uint16 port);
34 void AddCertificateException(const BCertificate& certificate);
36 // Context accessors
37 BNetworkCookieJar& GetCookieJar();
38 BHttpAuthentication& GetAuthentication(const BUrl& url);
39 bool UseProxy();
40 BString GetProxyHost();
41 uint16 GetProxyPort();
42 bool HasCertificateException(const BCertificate& certificate);
44 private:
45 BNetworkCookieJar fCookieJar;
46 typedef BPrivate::SynchronizedHashMap<BPrivate::HashString,
47 BHttpAuthentication*> BHttpAuthenticationMap;
48 BHttpAuthenticationMap* fAuthenticationMap;
49 typedef BObjectList<const BCertificate> BCertificateSet;
50 BCertificateSet fCertificates;
52 BString fProxyHost;
53 uint16 fProxyPort;
57 #endif // _B_URL_CONTEXT_H_