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

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

Issue 5231751647461376: Issue 1264 - Generate custom response for subdocument on subdomain request (Closed)
Patch Set: Created Sept. 5, 2014, 3:16 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 | « no previous file | 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 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 14
15 » bool m_shouldBlock; 15 » uint64_t m_currentPositionOfSentPage;
16 » bool m_lastDataReported;
17 CComPtr<IInternetProtocol> m_pTargetProtocol; 16 CComPtr<IInternetProtocol> m_pTargetProtocol;
18 17
19 int GetContentTypeFromMimeType(CString mimeType); 18 int GetContentTypeFromMimeType(CString mimeType);
20 int GetContentTypeFromURL(CString src); 19 int GetContentTypeFromURL(CString src);
21 int GetContentType(CString mimeType, CString domain, CString src); 20 int GetContentType(CString mimeType, CString domain, CString src);
22 public: 21 public:
23 BEGIN_COM_MAP(WBPassthruSink) 22 BEGIN_COM_MAP(WBPassthruSink)
24 COM_INTERFACE_ENTRY(IHttpNegotiate) 23 COM_INTERFACE_ENTRY(IHttpNegotiate)
25 COM_INTERFACE_ENTRY_CHAIN(BaseClass) 24 COM_INTERFACE_ENTRY_CHAIN(BaseClass)
26 END_COM_MAP() 25 END_COM_MAP()
27 26
28 BEGIN_SERVICE_MAP(WBPassthruSink) 27 BEGIN_SERVICE_MAP(WBPassthruSink)
29 SERVICE_ENTRY(IID_IHttpNegotiate) 28 SERVICE_ENTRY(IID_IHttpNegotiate)
30 END_SERVICE_MAP() 29 END_SERVICE_MAP()
31 30
32 STDMETHODIMP BeginningTransaction( 31 STDMETHODIMP BeginningTransaction(
33 /* [in] */ LPCWSTR szURL, 32 /* [in] */ LPCWSTR szURL,
34 /* [in] */ LPCWSTR szHeaders, 33 /* [in] */ LPCWSTR szHeaders,
35 /* [in] */ DWORD dwReserved, 34 /* [in] */ DWORD dwReserved,
36 /* [out] */ LPWSTR *pszAdditionalHeaders); 35 /* [out] */ LPWSTR *pszAdditionalHeaders);
37 36
38 STDMETHODIMP OnResponse( 37 STDMETHODIMP OnResponse(
39 /* [in] */ DWORD dwResponseCode, 38 /* [in] */ DWORD dwResponseCode,
40 /* [in] */ LPCWSTR szResponseHeaders, 39 /* [in] */ LPCWSTR szResponseHeaders,
41 /* [in] */ LPCWSTR szRequestHeaders, 40 /* [in] */ LPCWSTR szRequestHeaders,
42 /* [out] */ LPWSTR *pszAdditionalRequestHeaders); 41 /* [out] */ LPWSTR *pszAdditionalRequestHeaders);
43 42
44 HRESULT OnStart(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, 43 HRESULT OnStart(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink,
45 IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserv ed, 44 IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserv ed,
46 » » IInternetProtocol* pTargetProtocol); 45 » » IInternetProtocol* pTargetProtocol, bool& handled);
47 » HRESULT Read(void *pv, ULONG cb, ULONG* pcbRead); 46 » HRESULT OnRead(void *pv, ULONG cb, ULONG* pcbRead);
48 47
49 STDMETHODIMP ReportProgress( 48 STDMETHODIMP ReportProgress(
50 /* [in] */ ULONG ulStatusCode, 49 /* [in] */ ULONG ulStatusCode,
51 /* [in] */ LPCWSTR szStatusText); 50 /* [in] */ LPCWSTR szStatusText);
52 51
53 STDMETHODIMP Switch( 52 STDMETHODIMP Switch(
54 /* [in] */ PROTOCOLDATA *pProtocolData); 53 /* [in] */ PROTOCOLDATA *pProtocolData);
55 }; 54 };
56 55
57 class WBPassthru; 56 class WBPassthru;
58 typedef PassthroughAPP::CustomSinkStartPolicy<WBPassthru, WBPassthruSink> WBStar tPolicy; 57 typedef PassthroughAPP::CustomSinkStartPolicy<WBPassthru, WBPassthruSink> WBStar tPolicy;
59 58
60 class WBPassthru : public PassthroughAPP::CInternetProtocol<WBStartPolicy> 59 class WBPassthru : public PassthroughAPP::CInternetProtocol<WBStartPolicy>
61 { 60 {
62 public: 61 public:
62 WBPassthru();
63 // IInternetProtocolRoot 63 // IInternetProtocolRoot
64 STDMETHODIMP Start(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, 64 STDMETHODIMP Start(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink,
65 IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved); 65 IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved) override ;
66 66
67 //IInternetProtocol 67 //IInternetProtocol
68 STDMETHODIMP Read(» /* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [out] */ ULONG *pcbRead); 68 STDMETHODIMP Read(/* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [out] */ ULO NG *pcbRead) override;
69
70 STDMETHODIMP LockRequest(/* [in] */ DWORD dwOptions) override;
71 STDMETHODIMP UnlockRequest() override;
72
73 bool m_shouldSupplyCustomContent;
69 }; 74 };
OLDNEW
« no previous file with comments | « no previous file | src/plugin/PluginWbPassThrough.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld