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

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

Issue 5447868882092032: Issue 1793 - check whether the frame is whitelisted before injecting CSS (Closed)
Left Patch Set: reduce the amount of code Created Nov. 18, 2015, 3:03 p.m.
Right Patch Set: rebase and rename webBrowser to parentBrowser Created Nov. 30, 2015, 3:27 p.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/AdblockPlusClient.cpp ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // https://msdn.microsoft.com/en-us/library/aa752136(v=vs.85).aspx 217 // https://msdn.microsoft.com/en-us/library/aa752136(v=vs.85).aspx
218 if (parentDispatch.IsEqualObject(&browser)) 218 if (parentDispatch.IsEqualObject(&browser))
219 { 219 {
220 return nullptr; 220 return nullptr;
221 } 221 }
222 ATL::CComQIPtr<IServiceProvider> parentDocumentServiceProvider = parentDispa tch; 222 ATL::CComQIPtr<IServiceProvider> parentDocumentServiceProvider = parentDispa tch;
223 if (!parentDocumentServiceProvider) 223 if (!parentDocumentServiceProvider)
224 { 224 {
225 return nullptr; 225 return nullptr;
226 } 226 }
227 ATL::CComPtr<IWebBrowser2> webBrowser; 227 ATL::CComPtr<IWebBrowser2> parentBrowser;
sergei 2015/11/18 15:06:37 Changed to use QueryService obtaining IWebBrowser2
Eric 2015/11/20 15:43:51 For what it's worth, I suggest naming this variabl
228 if (FAILED(parentDocumentServiceProvider->QueryService(IID_IWebBrowserApp, & webBrowser))) 228 if (FAILED(parentDocumentServiceProvider->QueryService(SID_SWebBrowserApp, & parentBrowser)))
Eric 2015/11/18 15:25:22 I believe you want "IID_IWebBrowser2" here. Other
Oleksandr 2015/11/20 03:03:14 No, I think its correct as it is now. Technically,
Eric 2015/11/20 15:43:51 The previous patch set did that. The present one d
sergei 2015/11/30 15:29:32 Yes, it's a common technique for type-safeness, we
Eric 2015/11/30 17:23:26 Actually, we're mostly _not_ using it for QI. plu
229 { 229 {
230 return nullptr; 230 return nullptr;
231 } 231 }
232 return webBrowser; 232 return parentBrowser;
233 } 233 }
234 234
235 bool IsFrameWhiteListed(ATL::CComPtr<IWebBrowser2> frame) 235 bool IsFrameWhiteListed(ATL::CComPtr<IWebBrowser2> frame)
236 { 236 {
237 if (!frame) 237 if (!frame)
238 { 238 {
239 return false; 239 return false;
240 } 240 }
241 auto url = GetLocationUrl(*frame); 241 auto url = GetLocationUrl(*frame);
242 std::vector<std::string> frameHierarchy; 242 std::vector<std::string> frameHierarchy;
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 LogQueue::LogPluginError(pluginError.GetErrorCode(), pluginError.GetEr rorId(), pluginError.GetErrorSubid(), pluginError.GetErrorDescription(), true, p luginError.GetProcessId(), pluginError.GetThreadId()); 432 LogQueue::LogPluginError(pluginError.GetErrorCode(), pluginError.GetEr rorId(), pluginError.GetErrorSubid(), pluginError.GetErrorDescription(), true, p luginError.GetProcessId(), pluginError.GetThreadId());
433 } 433 }
434 434
435 // Non-hanging sleep 435 // Non-hanging sleep
436 Sleep(50); 436 Sleep(50);
437 } 437 }
438 438
439 tabLoopIteration++; 439 tabLoopIteration++;
440 } 440 }
441 } 441 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld