All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WebModule.h
1 // Copyright eeGeo Ltd (2012-2015), All Rights Reserved
2 #pragma once
3 #include "Types.h"
4 #include "Concurrency.h"
5 #include "Tasks.h"
6 #include "Helpers.h"
7 #include "BidirectionalWebIOBus.h"
8 #include "Web.h"
9 #include "UrlHelpers.h"
10 
11 namespace Eegeo
12 {
13  namespace Web
14  {
15  class WebModule: protected Eegeo::NonCopyable
16  {
17  public:
18 
19  static WebModule* Create(Helpers::IFileIO& cacheFileIO,
20  Helpers::IHttpCache& httpCache,
21  const WebIOConfig& webIOConfig,
24  Concurrency::IThreadService& threadService);
25 
26  static WebModule* CreateWithPacRunner(Helpers::IFileIO& cacheFileIO,
27  Helpers::IHttpCache& httpCache,
28  const WebIOConfig& webIOConfig,
31  Concurrency::IThreadService& threadService,
32  IProxyAutoConfigRunner& pacRunner);
33 
34  ~WebModule();
35 
36  WebRequestService& GetWebRequestService();
37 
38  IWebLoadRequestFactory& GetWebLoadRequestFactory();
39 
40  IWebProxySettings& GetWebProxySettings();
41 
42  ISSLSettings& GetSSLSettings();
43 
44  void OnPause();
45  void Update();
46  void OnResume();
47 
48  private:
49 
50  static WebModule* CreateCommon(Helpers::IFileIO& cacheFileIO,
51  Helpers::IHttpCache& httpCache,
52  const WebIOConfig& webIOConfig,
55  Concurrency::IThreadService& threadService,
56  WebProxySettings* pWebProxySettings,
57  ManualProxyResolver* pManualProxyResolver,
58  IPacResolver* pPacResolver,
59  IProxyAutoConfigRunner* pDefaultPacRunnerOrNull
60  );
61 
62 
63  WebModule(Helpers::IHttpCache& httpCache,
64  TMessageBus* pWebMessageBus,
65  WebRequestServiceBackendRunner* pWebRequestServiceBackendRunner,
66  Concurrency::Thread* pWebRequestServiceBackendThread,
67  WebRequestService* pWebRequestService,
68  IWebLoadRequestFactory* pWebRequestFactory,
69  IWebProxySettings* pWebProxySettings,
70  ManualProxyResolver* pManualProxyResolver,
71  ISSLSettings* pSSLSettings,
72  IPacResolver* pPacResolver,
73  IProxyAutoConfigRunner* pDefaultPacRunnerOrNull
74  );
75 
76  Helpers::IHttpCache& m_httpCache;
77  TMessageBus* m_pWebMessageBus;
78  WebRequestServiceBackendRunner* m_pWebRequestServiceBackendRunner;
79  Concurrency::Thread* m_pWebRequestServiceBackendThread;
80  WebRequestService* m_pWebRequestService;
81  IWebLoadRequestFactory* m_pWebRequestFactory;
82  ManualProxyResolver* m_pManualProxyResolver;
83  IWebProxySettings* m_pWebProxySettings;
84  ISSLSettings* m_pSSLSettings;
85  IPacResolver* m_pPacResolver;
86  IProxyAutoConfigRunner* m_pDefaultPacRunnerOrNull;
87  };
88  }
89 }