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

Delta Between Two Patch Sets: src/plugin/PluginWbPassThrough.cpp

Issue 5231751647461376: Issue 1264 - Generate custom response for subdocument on subdomain request (Closed)
Left Patch Set: Created Sept. 5, 2014, 3:16 p.m.
Right Patch Set: move opening braces on the new line Created Sept. 8, 2014, 8:42 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/plugin/PluginWbPassThrough.h ('k') | src/plugin/SinkPolicy.inl » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include "PluginWbPassThrough.h" 3 #include "PluginWbPassThrough.h"
4 #include "PluginClient.h" 4 #include "PluginClient.h"
5 #include "PluginClientFactory.h" 5 #include "PluginClientFactory.h"
6 #ifdef SUPPORT_FILTER 6 #ifdef SUPPORT_FILTER
7 #include "PluginFilter.h" 7 #include "PluginFilter.h"
8 #endif 8 #endif
9 #include "PluginSettings.h" 9 #include "PluginSettings.h"
10 #include "PluginClass.h" 10 #include "PluginClass.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 } 284 }
285 } 285 }
286 #endif // SUPPORT_FILTER 286 #endif // SUPPORT_FILTER
287 287
288 return isBlocked ? S_FALSE : BaseClass::OnStart(szUrl, pOIProtSink, pOIBindInf o, grfPI, dwReserved, pTargetProtocol); 288 return isBlocked ? S_FALSE : BaseClass::OnStart(szUrl, pOIProtSink, pOIBindInf o, grfPI, dwReserved, pTargetProtocol);
289 } 289 }
290 290
291 291
292 HRESULT WBPassthruSink::OnRead(void* pv, ULONG cb, ULONG* pcbRead) 292 HRESULT WBPassthruSink::OnRead(void* pv, ULONG cb, ULONG* pcbRead)
293 { 293 {
294 if (nullptr == pv) { 294 if (nullptr == pv)
295 {
295 return E_POINTER; 296 return E_POINTER;
296 } 297 }
297 if (nullptr == pcbRead) { 298 if (nullptr == pcbRead)
299 {
298 return E_POINTER; 300 return E_POINTER;
299 } 301 }
300 *pcbRead = 0; 302 *pcbRead = 0;
301 303
302 if (PassthroughAPP::CustomSinkStartPolicy<WBPassthru, WBPassthruSink>::GetProt ocol(this)->m_shouldSupplyCustomContent) 304 if (PassthroughAPP::CustomSinkStartPolicy<WBPassthru, WBPassthruSink>::GetProt ocol(this)->m_shouldSupplyCustomContent)
303 { 305 {
304 ULONG myPageSize = static_cast<ULONG>(g_myPageBlocked.size()); 306 ULONG myPageSize = static_cast<ULONG>(g_myPageBlocked.size());
305 auto positionGrow = std::min<ULONG>(cb, static_cast<ULONG>(g_myPageBlocked.s ize() - m_currentPositionOfSentPage)); 307 auto positionGrow = std::min<ULONG>(cb, static_cast<ULONG>(g_myPageBlocked.s ize() - m_currentPositionOfSentPage));
306 if (0 == positionGrow) { 308 if (0 == positionGrow) {
307 return S_FALSE; 309 return S_FALSE;
308 } 310 }
309 std::copy(g_myPageBlocked.begin(), g_myPageBlocked.begin() + positionGrow, 311 std::copy(g_myPageBlocked.begin(), g_myPageBlocked.begin() + positionGrow,
310 stdext::make_checked_array_iterator(static_cast<char*>(pv), cb)); 312 stdext::make_checked_array_iterator(static_cast<char*>(pv), cb));
311 *pcbRead = positionGrow; 313 *pcbRead = positionGrow;
312 m_currentPositionOfSentPage += positionGrow; 314 m_currentPositionOfSentPage += positionGrow;
313 315
314 if (m_spInternetProtocolSink) { 316 if (m_spInternetProtocolSink)
317 {
315 m_spInternetProtocolSink->ReportData(BSCF_INTERMEDIATEDATANOTIFICATION, 318 m_spInternetProtocolSink->ReportData(BSCF_INTERMEDIATEDATANOTIFICATION,
316 static_cast<ULONG>(m_currentPositionOfSentPage), myPageSize); 319 static_cast<ULONG>(m_currentPositionOfSentPage), myPageSize);
317 } 320 }
318 if (myPageSize == m_currentPositionOfSentPage && m_spInternetProtocolSink) { 321 if (myPageSize == m_currentPositionOfSentPage && m_spInternetProtocolSink)
322 {
319 m_spInternetProtocolSink->ReportData(BSCF_DATAFULLYAVAILABLE, myPageSize, myPageSize); 323 m_spInternetProtocolSink->ReportData(BSCF_DATAFULLYAVAILABLE, myPageSize, myPageSize);
320 m_spInternetProtocolSink->ReportResult(S_OK, 0, nullptr); 324 m_spInternetProtocolSink->ReportResult(S_OK, 0, nullptr);
321 } 325 }
322 return S_OK; 326 return S_OK;
323 } 327 }
324 return m_pTargetProtocol->Read(pv, cb, pcbRead); 328 return m_pTargetProtocol->Read(pv, cb, pcbRead);
325 } 329 }
326 STDMETHODIMP WBPassthruSink::Switch( 330 STDMETHODIMP WBPassthruSink::Switch(
327 /* [in] */ PROTOCOLDATA *pProtocolData) 331 /* [in] */ PROTOCOLDATA *pProtocolData)
328 { 332 {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 } 417 }
414 418
415 STDMETHODIMP WBPassthru::UnlockRequest() 419 STDMETHODIMP WBPassthru::UnlockRequest()
416 { 420 {
417 if (m_shouldSupplyCustomContent) 421 if (m_shouldSupplyCustomContent)
418 { 422 {
419 return S_OK; 423 return S_OK;
420 } 424 }
421 return PassthroughAPP::CInternetProtocol<WBStartPolicy>::UnlockRequest(); 425 return PassthroughAPP::CInternetProtocol<WBStartPolicy>::UnlockRequest();
422 } 426 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld