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

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

Issue 12513014: Fix crash on file upload (Closed)
Patch Set: Created Oct. 4, 2013, 8:38 a.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/ProtocolImpl.inl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2007 Igor Tandetnik 1 // Copyright 2007 Igor Tandetnik
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 CComPtr<IInternetProtocol> m_spInternetProtocol; 242 CComPtr<IInternetProtocol> m_spInternetProtocol;
243 CComPtr<IInternetProtocolInfo> m_spInternetProtocolInfo; 243 CComPtr<IInternetProtocolInfo> m_spInternetProtocolInfo;
244 CComPtr<IInternetPriority> m_spInternetPriority; 244 CComPtr<IInternetPriority> m_spInternetPriority;
245 CComPtr<IInternetThreadSwitch> m_spInternetThreadSwitch; 245 CComPtr<IInternetThreadSwitch> m_spInternetThreadSwitch;
246 CComPtr<IWinInetInfo> m_spWinInetInfo; 246 CComPtr<IWinInetInfo> m_spWinInetInfo;
247 CComPtr<IWinInetHttpInfo> m_spWinInetHttpInfo; 247 CComPtr<IWinInetHttpInfo> m_spWinInetHttpInfo;
248 }; 248 };
249 249
250 class ATL_NO_VTABLE IInternetProtocolSinkImpl : 250 class ATL_NO_VTABLE IInternetProtocolSinkImpl :
251 public IInternetProtocolSink, 251 public IInternetProtocolSink,
252 public IServiceProvider, 252 public IServiceProvider
253 public IInternetBindInfo
254 { 253 {
255 public: 254 public:
256 HRESULT OnStart(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, 255 HRESULT OnStart(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink,
257 IInternetBindInfo *pOIBindInfo, DWORD grfPI, DWORD dwReserved, 256 IInternetBindInfo *pOIBindInfo, DWORD grfPI, DWORD dwReserved,
258 IInternetProtocol* pTargetProtocol); 257 IInternetProtocol* pTargetProtocol);
259 void ReleaseAll(); 258 void ReleaseAll();
260 259
261 DECLARE_GET_TARGET_UNKNOWN(m_spInternetProtocolSink) 260 DECLARE_GET_TARGET_UNKNOWN(m_spInternetProtocolSink)
262 261
263 IServiceProvider* GetClientServiceProvider(); 262 IServiceProvider* GetClientServiceProvider();
(...skipping 30 matching lines...) Expand all
294 /* [in] */ HRESULT hrResult, 293 /* [in] */ HRESULT hrResult,
295 /* [in] */ DWORD dwError, 294 /* [in] */ DWORD dwError,
296 /* [in] */ LPCWSTR szResult); 295 /* [in] */ LPCWSTR szResult);
297 296
298 // IServiceProvider 297 // IServiceProvider
299 STDMETHODIMP QueryService( 298 STDMETHODIMP QueryService(
300 /* [in] */ REFGUID guidService, 299 /* [in] */ REFGUID guidService,
301 /* [in] */ REFIID riid, 300 /* [in] */ REFIID riid,
302 /* [out] */ void** ppvObject); 301 /* [out] */ void** ppvObject);
303 302
304 // IInternetBindInfo
305 STDMETHODIMP GetBindInfo(
306 /* [out] */ DWORD *grfBINDF,
307 /* [in, out] */ BINDINFO *pbindinfo);
308
309 STDMETHODIMP GetBindString(
310 /* [in] */ ULONG ulStringType,
311 /* [in, out] */ LPOLESTR *ppwzStr,
312 /* [in] */ ULONG cEl,
313 /* [in, out] */ ULONG *pcElFetched);
314 public: 303 public:
315 CComPtr<IInternetProtocolSink> m_spInternetProtocolSink; 304 CComPtr<IInternetProtocolSink> m_spInternetProtocolSink;
316 CComPtr<IServiceProvider> m_spServiceProvider; 305 CComPtr<IServiceProvider> m_spServiceProvider;
317 CComPtr<IInternetBindInfo> m_spInternetBindInfo;
318
319 CComPtr<IInternetProtocol> m_spTargetProtocol; 306 CComPtr<IInternetProtocol> m_spTargetProtocol;
320 }; 307 };
321 308
322 template <class ThreadModel = CComSingleThreadModel> 309 template <class ThreadModel = CComSingleThreadModel>
323 class CInternetProtocolSinkTM : 310 class CInternetProtocolSinkTM :
324 public CComObjectRootEx<ThreadModel>, 311 public CComObjectRootEx<ThreadModel>,
325 public IInternetProtocolSinkImpl 312 public IInternetProtocolSinkImpl
326 { 313 {
327 public: 314 public:
328 BEGIN_COM_MAP(CInternetProtocolSinkTM) 315 BEGIN_COM_MAP(CInternetProtocolSinkTM)
329 COM_INTERFACE_ENTRY(IInternetProtocolSink) 316 COM_INTERFACE_ENTRY(IInternetProtocolSink)
330 COM_INTERFACE_ENTRY_PASSTHROUGH(IServiceProvider, 317 COM_INTERFACE_ENTRY_PASSTHROUGH(IServiceProvider,
331 m_spServiceProvider.p) 318 m_spServiceProvider.p)
332 COM_INTERFACE_ENTRY(IInternetBindInfo)
333 COM_INTERFACE_ENTRY_PASSTHROUGH_DEBUG() 319 COM_INTERFACE_ENTRY_PASSTHROUGH_DEBUG()
334 END_COM_MAP() 320 END_COM_MAP()
335 }; 321 };
336 322
337 typedef CInternetProtocolSinkTM<> CInternetProtocolSink; 323 typedef CInternetProtocolSinkTM<> CInternetProtocolSink;
338 324
339 template <class T, class ThreadModel = CComSingleThreadModel> 325 template <class T, class ThreadModel = CComSingleThreadModel>
340 class CInternetProtocolSinkWithSP : 326 class CInternetProtocolSinkWithSP :
341 public CInternetProtocolSinkTM<ThreadModel> 327 public CInternetProtocolSinkTM<ThreadModel>
342 { 328 {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved); 440 IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved);
455 441
456 STDMETHODIMP Read( /* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [out] */ ULONG *pcbRead); 442 STDMETHODIMP Read( /* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [out] */ ULONG *pcbRead);
457 }; 443 };
458 444
459 } // end namespace PassthroughAPP 445 } // end namespace PassthroughAPP
460 446
461 #include "ProtocolImpl.inl" 447 #include "ProtocolImpl.inl"
462 448
463 #endif // PASSTHROUGHAPP_PROTOCOLIMPL_H 449 #endif // PASSTHROUGHAPP_PROTOCOLIMPL_H
OLDNEW
« no previous file with comments | « no previous file | src/plugin/ProtocolImpl.inl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld