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

Unified Diff: Shared/PluginMimeFilterClient.cpp

Issue 9595007: Fix for crash in urlmon.dll on telegrafua.com. (Endless redirect loop) (Closed)
Patch Set: Created March 5, 2013, 1:41 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Shared/ProtocolImpl.inl » ('j') | Shared/ProtocolImpl.inl » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Shared/PluginMimeFilterClient.cpp
===================================================================
--- a/Shared/PluginMimeFilterClient.cpp
+++ b/Shared/PluginMimeFilterClient.cpp
@@ -11,57 +11,57 @@
CPluginMimeFilterClient::CPluginMimeFilterClient() : m_classFactory(NULL), m_spCFHTTP(NULL)
{
- // Should only be called once
- // We register mime filters here
- // Register asynchronous protocol
- CComPtr<IInternetSession> spSession;
- m_spCFHTTP = NULL;
- HRESULT hr = ::CoInternetGetSession(0, &spSession, 0);
- if (FAILED(hr) || !spSession)
- {
- DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_SESSION, PLUGIN_ERROR_SESSION_GET_INTERNET_SESSION, "MimeClient::CoInternetGetSession failed");
- return;
- }
+ // Should only be called once
+ // We register mime filters here
+ // Register asynchronous protocol
+ CComPtr<IInternetSession> spSession;
+ m_spCFHTTP = NULL;
+ HRESULT hr = ::CoInternetGetSession(0, &spSession, 0);
+ if (FAILED(hr) || !spSession)
+ {
+ DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_SESSION, PLUGIN_ERROR_SESSION_GET_INTERNET_SESSION, "MimeClient::CoInternetGetSession failed");
+ return;
+ }
- hr = MetaFactory::CreateInstance(CLSID_HttpProtocol, &m_spCFHTTP);
- if (FAILED(hr) || !m_spCFHTTP)
- {
- DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_SESSION, PLUGIN_ERROR_SESSION_CREATE_HTTP_INSTANCE, "MimeClient::CreateInstance failed");
- return;
- }
+ hr = MetaFactory::CreateInstance(CLSID_HttpProtocol, &m_spCFHTTP);
+ if (FAILED(hr) || !m_spCFHTTP)
+ {
+ DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_SESSION, PLUGIN_ERROR_SESSION_CREATE_HTTP_INSTANCE, "MimeClient::CreateInstance failed");
+ return;
+ }
- hr = spSession->RegisterNameSpace(m_spCFHTTP, CLSID_NULL, L"http", 0, 0, 0);
- if (FAILED(hr))
- {
- DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_SESSION, PLUGIN_ERROR_SESSION_REGISTER_HTTP_NAMESPACE, "MimeClient::RegisterNameSpace failed");
- return;
- }
+ hr = spSession->RegisterNameSpace(m_spCFHTTP, CLSID_HttpProtocol, L"http", 0, 0, 0);
+ if (FAILED(hr))
+ {
+ DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_SESSION, PLUGIN_ERROR_SESSION_REGISTER_HTTP_NAMESPACE, "MimeClient::RegisterNameSpace failed");
+ return;
+ }
}
CPluginMimeFilterClient::~CPluginMimeFilterClient()
{
- CComPtr<IInternetSession> spSession;
+ CComPtr<IInternetSession> spSession;
- ::CoInternetGetSession(0, &spSession, 0);
- if (spSession)
- {
- spSession->UnregisterNameSpace(m_spCFHTTP, L"http");
- if (m_spCFHTTP != NULL)
- {
- m_spCFHTTP.Release();
- m_spCFHTTP = NULL;
- }
- }
+ ::CoInternetGetSession(0, &spSession, 0);
+ if (spSession)
+ {
+ spSession->UnregisterNameSpace(m_spCFHTTP, L"http");
+ if (m_spCFHTTP != NULL)
+ {
+ m_spCFHTTP.Release();
+ m_spCFHTTP = NULL;
+ }
+ }
}
void CPluginMimeFilterClient::Unregister()
{
- CComPtr<IInternetSession> spSession;
+ CComPtr<IInternetSession> spSession;
- ::CoInternetGetSession(0, &spSession, 0);
- if (spSession)
- {
+ ::CoInternetGetSession(0, &spSession, 0);
+ if (spSession)
+ {
spSession->UnregisterNameSpace(m_spCFHTTP, L"http");
- }
+ }
}
« no previous file with comments | « no previous file | Shared/ProtocolImpl.inl » ('j') | Shared/ProtocolImpl.inl » ('J')

Powered by Google App Engine
This is Rietveld