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

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

Issue 4842319220047872: Fix mime type detection (Closed)
Patch Set: Created April 29, 2014, 8:43 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 m_shouldBlock = false; 126 m_shouldBlock = false;
127 m_lastDataReported = false; 127 m_lastDataReported = false;
128 CString src; 128 CString src;
129 src.Append(szUrl); 129 src.Append(szUrl);
130 DEBUG_GENERAL(src); 130 DEBUG_GENERAL(src);
131 CPluginClient::UnescapeUrl(src); 131 CPluginClient::UnescapeUrl(src);
132 m_url = szUrl; 132 m_url = szUrl;
133 133
134 CString boundDomain; 134 CString boundDomain;
135 CString mimeType; 135 CString mimeType;
136 LPOLESTR mime[10];
136 if (pOIBindInfo) 137 if (pOIBindInfo)
137 { 138 {
138 ULONG resLen = 0; 139 ULONG resLen = 0;
139 LPOLESTR mime = 0; 140 pOIBindInfo->GetBindString(BINDSTRING_ACCEPT_MIMES, mime, 10, &resLen);
Oleksandr 2014/04/29 08:56:51 Apparently IE will report random mime type if ther
Eric 2014/05/01 15:04:53 This behavior belongs in a comment, since it's cer
140 pOIBindInfo->GetBindString(BINDSTRING_ACCEPT_MIMES, &mime, 1, &resLen);
141 if (mime && resLen > 0) 141 if (mime && resLen > 0)
142 { 142 {
143 mimeType.SetString(mime); 143 mimeType.SetString(mime[0]);
144 } 144 }
145 LPOLESTR bindToObject = 0; 145 LPOLESTR bindToObject = 0;
146 pOIBindInfo->GetBindString(BINDSTRING_FLAG_BIND_TO_OBJECT, &bindToObject, 1, &resLen); 146 pOIBindInfo->GetBindString(BINDSTRING_FLAG_BIND_TO_OBJECT, &bindToObject, 1, &resLen);
147 LPOLESTR domainRetrieved = 0; 147 LPOLESTR domainRetrieved = 0;
148 if (resLen == 0 || wcscmp(bindToObject, L"FALSE") == 0) 148 if (resLen == 0 || wcscmp(bindToObject, L"FALSE") == 0)
149 { 149 {
150 HRESULT hr = pOIBindInfo->GetBindString(BINDSTRING_XDR_ORIGIN, &domainRetr ieved, 1, &resLen); 150 HRESULT hr = pOIBindInfo->GetBindString(BINDSTRING_XDR_ORIGIN, &domainRetr ieved, 1, &resLen);
151 if ((hr == S_OK) && domainRetrieved && (resLen > 0)) 151 if ((hr == S_OK) && domainRetrieved && (resLen > 0))
152 { 152 {
153 boundDomain.SetString(domainRetrieved); 153 boundDomain.SetString(domainRetrieved);
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 CComPtr<IHttpNegotiate> spHttpNegotiate; 367 CComPtr<IHttpNegotiate> spHttpNegotiate;
368 QueryServiceFromClient(&spHttpNegotiate); 368 QueryServiceFromClient(&spHttpNegotiate);
369 369
370 return spHttpNegotiate ? spHttpNegotiate->OnResponse(dwResponseCode, szRespons eHeaders, szRequestHeaders, pszAdditionalRequestHeaders) : S_OK; 370 return spHttpNegotiate ? spHttpNegotiate->OnResponse(dwResponseCode, szRespons eHeaders, szRequestHeaders, pszAdditionalRequestHeaders) : S_OK;
371 } 371 }
372 372
373 STDMETHODIMP WBPassthruSink::ReportProgress(ULONG ulStatusCode, LPCWSTR szStatus Text) 373 STDMETHODIMP WBPassthruSink::ReportProgress(ULONG ulStatusCode, LPCWSTR szStatus Text)
374 { 374 {
375 return m_spInternetProtocolSink ? m_spInternetProtocolSink->ReportProgress(ulS tatusCode, szStatusText) : S_OK; 375 return m_spInternetProtocolSink ? m_spInternetProtocolSink->ReportProgress(ulS tatusCode, szStatusText) : S_OK;
376 } 376 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld