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

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

Issue 5113230347206656: Issue #1356 - Improve detection of the issuer of the request (Closed)
Patch Set: Fix the deadlock Created Oct. 7, 2014, 11:22 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
« src/plugin/PluginClass.cpp ('K') | « src/plugin/PluginClass.cpp ('k') | 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 pOIBindInfo->GetBindString(BINDSTRING_ACCEPT_MIMES, mime, 10, &resLen); 145 pOIBindInfo->GetBindString(BINDSTRING_ACCEPT_MIMES, mime, 10, &resLen);
146 if (mime && resLen > 0) 146 if (mime && resLen > 0)
147 { 147 {
148 mimeType.SetString(mime[0]); 148 mimeType.SetString(mime[0]);
149 } 149 }
150 LPOLESTR bindToObject = 0; 150 LPOLESTR bindToObject = 0;
151 pOIBindInfo->GetBindString(BINDSTRING_FLAG_BIND_TO_OBJECT, &bindToObject, 1, &resLen); 151 pOIBindInfo->GetBindString(BINDSTRING_FLAG_BIND_TO_OBJECT, &bindToObject, 1, &resLen);
152 LPOLESTR domainRetrieved = 0; 152 LPOLESTR domainRetrieved = 0;
153 if (resLen == 0 || wcscmp(bindToObject, L"FALSE") == 0) 153 if (resLen == 0 || wcscmp(bindToObject, L"FALSE") == 0)
154 { 154 {
155 HRESULT hr = pOIBindInfo->GetBindString(BINDSTRING_XDR_ORIGIN, &domainRetr ieved, 1, &resLen); 155 HRESULT hr = S_OK;
156 if (CPluginClient::GetInstance()->GetIEVersion() > 8)
157 {
158 hr = pOIBindInfo->GetBindString(BINDSTRING_ROOTDOC_URL, &domainRetrieved , 1, &resLen);
159 }
160 else
161 {
162 hr = pOIBindInfo->GetBindString(BINDSTRING_XDR_ORIGIN, &domainRetrieved, 1, &resLen);
163 }
156 164
157 if ((hr == S_OK) && domainRetrieved && (resLen > 0)) 165 if ((hr == S_OK) && domainRetrieved && (resLen > 0))
158 { 166 {
159 boundDomain.SetString(domainRetrieved); 167 boundDomain.SetString(domainRetrieved);
160 } 168 }
161 } 169 }
162 } 170 }
163 171
164 CString cookie; 172 CString cookie;
165 ULONG len1 = 2048; 173 ULONG len1 = 2048;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 208
201 DEBUG_BLOCKER("Blocker::Blocking Http-request:" + src); 209 DEBUG_BLOCKER("Blocker::Blocking Http-request:" + src);
202 } 210 }
203 } 211 }
204 if (!isBlocked) 212 if (!isBlocked)
205 { 213 {
206 DEBUG_BLOCKER("Blocker::Ignoring Http-request:" + src) 214 DEBUG_BLOCKER("Blocker::Ignoring Http-request:" + src)
207 } 215 }
208 } 216 }
209 217
210 218 // Request from unknown thread, so we don't know the tab
211 if (tab == NULL) 219 if (tab == NULL)
212 { 220 {
213 contentType = GetContentType(mimeType, boundDomain, src); 221 contentType = GetContentType(mimeType, boundDomain, src);
222
223 if (CPluginClient::GetInstance()->GetIEVersion() > 8)
224 {
225 // Find tab based on document URL
226 tab = CPluginClass::GetTab(boundDomain.GetString());
227 if ((tab != 0) && (tab->IsFrameCached(src)))
Eric 2014/10/08 17:37:54 Prefer nullptr to 0, but the idiom we're using (as
228 {
229 contentType = CFilter::contentTypeSubdocument;
sergei 2014/10/09 13:46:22 I would leave the comment somewhere - that it's on
230 // add frame to a referrer chain
231 if (client->ShouldBlock(boundDomain, contentType, tab->GetDocumentUrl(), true))
sergei 2014/10/09 13:46:22 Instead of `boundDomain` there should be `src`
232 {
233 isBlocked = true;
234 }
235 }
236 }
214 if (client->ShouldBlock(src, contentType, boundDomain, true)) 237 if (client->ShouldBlock(src, contentType, boundDomain, true))
215 { 238 {
216 isBlocked = true; 239 isBlocked = true;
217 } 240 }
218 } 241 }
219 242
220 #ifdef _DEBUG 243 #ifdef _DEBUG
221 CString type; 244 CString type;
222 245
223 if (contentType == CFilter::contentTypeDocument) type = "DOCUMENT"; 246 if (contentType == CFilter::contentTypeDocument) type = "DOCUMENT";
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 } 436 }
414 437
415 STDMETHODIMP WBPassthru::UnlockRequest() 438 STDMETHODIMP WBPassthru::UnlockRequest()
416 { 439 {
417 if (m_shouldSupplyCustomContent) 440 if (m_shouldSupplyCustomContent)
418 { 441 {
419 return S_OK; 442 return S_OK;
420 } 443 }
421 return PassthroughAPP::CInternetProtocol<WBStartPolicy>::UnlockRequest(); 444 return PassthroughAPP::CInternetProtocol<WBStartPolicy>::UnlockRequest();
422 } 445 }
OLDNEW
« src/plugin/PluginClass.cpp ('K') | « src/plugin/PluginClass.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld