Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/plugin/PluginWbPassThrough.h

Issue 6299667012780032: Issues #696,1231,1264,1265 - Improve handling in PassthroughApp (Closed)
Patch Set: Get rid of yoda style and rename blockedByABPPageSize local var Created Sept. 22, 2014, 4:14 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/plugin/PluginTabBase.cpp ('k') | src/plugin/PluginWbPassThrough.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #pragma once 1 #pragma once
2 #include <cstdint> 2 #include <cstdint>
3 #include "ProtocolCF.h" 3 #include "ProtocolCF.h"
4 #include "ProtocolImpl.h" 4 #include "ProtocolImpl.h"
5 #define IE_MAX_URL_LENGTH 2048 5 #define IE_MAX_URL_LENGTH 2048
6 6
7 class WBPassthruSink : 7 class WBPassthruSink :
8 public PassthroughAPP::CInternetProtocolSinkWithSP<WBPassthruSink, CComM ultiThreadModel>, 8 public PassthroughAPP::CInternetProtocolSinkWithSP<WBPassthruSink, CComM ultiThreadModel>,
9 public IHttpNegotiate 9 public IHttpNegotiate
10 { 10 {
11 typedef PassthroughAPP::CInternetProtocolSinkWithSP<WBPassthruSink, CCom MultiThreadModel> BaseClass; 11 typedef PassthroughAPP::CInternetProtocolSinkWithSP<WBPassthruSink, CCom MultiThreadModel> BaseClass;
12 12
13 public: 13 public:
14 WBPassthruSink();
14 15
15 uint64_t m_currentPositionOfSentPage; 16 uint64_t m_currentPositionOfSentPage;
16 CComPtr<IInternetProtocol> m_pTargetProtocol; 17 CComPtr<IInternetProtocol> m_pTargetProtocol;
18 int m_contentType;
19 CString m_boundDomain;
20 bool m_blockedInTransaction;
17 21
18 int GetContentTypeFromMimeType(CString mimeType); 22 » int GetContentTypeFromMimeType(const CString& mimeType);
19 int GetContentTypeFromURL(CString src); 23 » int GetContentTypeFromURL(const CString& src);
20 int GetContentType(CString mimeType, CString domain, CString src); 24 » int GetContentType(const CString& mimeType, const CString& domain, const CString& src);
21 public: 25 public:
22 BEGIN_COM_MAP(WBPassthruSink) 26 BEGIN_COM_MAP(WBPassthruSink)
23 COM_INTERFACE_ENTRY(IHttpNegotiate) 27 COM_INTERFACE_ENTRY(IHttpNegotiate)
24 COM_INTERFACE_ENTRY_CHAIN(BaseClass) 28 COM_INTERFACE_ENTRY_CHAIN(BaseClass)
25 END_COM_MAP() 29 END_COM_MAP()
26 30
27 BEGIN_SERVICE_MAP(WBPassthruSink) 31 BEGIN_SERVICE_MAP(WBPassthruSink)
28 SERVICE_ENTRY(IID_IHttpNegotiate) 32 SERVICE_ENTRY(IID_IHttpNegotiate)
29 END_SERVICE_MAP() 33 END_SERVICE_MAP()
30 34
(...skipping 11 matching lines...) Expand all
42 46
43 HRESULT OnStart(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, 47 HRESULT OnStart(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink,
44 IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserv ed, 48 IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserv ed,
45 IInternetProtocol* pTargetProtocol, bool& handled); 49 IInternetProtocol* pTargetProtocol, bool& handled);
46 HRESULT OnRead(void *pv, ULONG cb, ULONG* pcbRead); 50 HRESULT OnRead(void *pv, ULONG cb, ULONG* pcbRead);
47 51
48 STDMETHODIMP ReportProgress( 52 STDMETHODIMP ReportProgress(
49 /* [in] */ ULONG ulStatusCode, 53 /* [in] */ ULONG ulStatusCode,
50 /* [in] */ LPCWSTR szStatusText); 54 /* [in] */ LPCWSTR szStatusText);
51 55
56 STDMETHODIMP ReportResult(
57 /* [in] */ HRESULT hrResult,
58 /* [in] */ DWORD dwError,
59 /* [in] */ LPCWSTR szResult);
60
52 STDMETHODIMP Switch( 61 STDMETHODIMP Switch(
53 /* [in] */ PROTOCOLDATA *pProtocolData); 62 /* [in] */ PROTOCOLDATA *pProtocolData);
54 }; 63 };
55 64
56 class WBPassthru; 65 class WBPassthru;
57 typedef PassthroughAPP::CustomSinkStartPolicy<WBPassthru, WBPassthruSink> WBStar tPolicy; 66 typedef PassthroughAPP::CustomSinkStartPolicy<WBPassthru, WBPassthruSink> WBStar tPolicy;
58 67
59 class WBPassthru : public PassthroughAPP::CInternetProtocol<WBStartPolicy> 68 class WBPassthru : public PassthroughAPP::CInternetProtocol<WBStartPolicy>
60 { 69 {
70 typedef PassthroughAPP::CInternetProtocol<WBStartPolicy> BaseClass;
61 public: 71 public:
62 WBPassthru(); 72 WBPassthru();
63 // IInternetProtocolRoot 73 // IInternetProtocolRoot
64 STDMETHODIMP Start(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, 74 STDMETHODIMP Start(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink,
65 IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved) override ; 75 IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved) override ;
66 76
67 //IInternetProtocol 77 //IInternetProtocol
68 STDMETHODIMP Read(/* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [out] */ ULO NG *pcbRead) override; 78 STDMETHODIMP Read(/* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [out] */ ULO NG *pcbRead) override;
69 79
70 STDMETHODIMP LockRequest(/* [in] */ DWORD dwOptions) override; 80 STDMETHODIMP LockRequest(/* [in] */ DWORD dwOptions) override;
71 STDMETHODIMP UnlockRequest() override; 81 STDMETHODIMP UnlockRequest() override;
72 82
73 bool m_shouldSupplyCustomContent; 83 bool m_shouldSupplyCustomContent;
84 bool m_hasOriginalStartCalled;
74 }; 85 };
OLDNEW
« no previous file with comments | « src/plugin/PluginTabBase.cpp ('k') | src/plugin/PluginWbPassThrough.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld