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

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

Issue 5447868882092032: Issue 1793 - check whether the frame is whitelisted before injecting CSS (Closed)
Patch Set: update Created Jan. 13, 2015, 3:20 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
OLDNEW
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 #include "PluginSettings.h" 2 #include "PluginSettings.h"
3 #include "PluginSystem.h" 3 #include "PluginSystem.h"
4 #include "PluginFilter.h" 4 #include "PluginFilter.h"
5 #include "PluginClientFactory.h" 5 #include "PluginClientFactory.h"
6 #include "PluginMutex.h" 6 #include "PluginMutex.h"
7 #include "PluginClass.h" 7 #include "PluginClass.h"
8 8
9 #include "AdblockPlusClient.h" 9 #include "AdblockPlusClient.h"
10 10
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 { 249 {
250 bool isHidden; 250 bool isHidden;
251 m_criticalSectionFilter.Lock(); 251 m_criticalSectionFilter.Lock();
252 { 252 {
253 isHidden = filter && filter->IsElementHidden(tag, pEl, domain, indent); 253 isHidden = filter && filter->IsElementHidden(tag, pEl, domain, indent);
254 } 254 }
255 m_criticalSectionFilter.Unlock(); 255 m_criticalSectionFilter.Unlock();
256 return isHidden; 256 return isHidden;
257 } 257 }
258 258
259 bool CAdblockPlusClient::IsWhitelistedUrl(const std::wstring& url) 259 bool CAdblockPlusClient::IsWhitelistedUrl(const std::wstring& url, const std::ve ctor<std::string>& frameHierarchy)
260 { 260 {
261 DEBUG_GENERAL((L"IsWhitelistedUrl: " + url + L" start").c_str()); 261 DEBUG_GENERAL((L"IsWhitelistedUrl: " + url + L" start").c_str());
262 Communication::OutputBuffer request; 262 Communication::OutputBuffer request;
263 request << Communication::PROC_IS_WHITELISTED_URL << ToUtf8String(url); 263 request << Communication::PROC_IS_WHITELISTED_URL << ToUtf8String(url) << fram eHierarchy;
264 264
265 Communication::InputBuffer response; 265 Communication::InputBuffer response;
266 if (!CallEngine(request, response)) 266 if (!CallEngine(request, response))
267 return false; 267 return false;
268 268
269 bool isWhitelisted; 269 bool isWhitelisted;
270 response >> isWhitelisted; 270 response >> isWhitelisted;
271 271
272 DEBUG_GENERAL((L"IsWhitelistedUrl: " + url + L" end").c_str()); 272 DEBUG_GENERAL((L"IsWhitelistedUrl: " + url + L" end").c_str());
273 return isWhitelisted; 273 return isWhitelisted;
274 } 274 }
275 275
276 bool CAdblockPlusClient::IsElemhideWhitelistedOnDomain(const std::wstring& url) 276 bool CAdblockPlusClient::IsElemhideWhitelistedOnDomain(const std::wstring& url, const std::vector<std::string>& frameHierarchy)
277 { 277 {
278 Communication::OutputBuffer request; 278 Communication::OutputBuffer request;
279 request << Communication::PROC_IS_ELEMHIDE_WHITELISTED_ON_URL << ToUtf8String( url); 279 request << Communication::PROC_IS_ELEMHIDE_WHITELISTED_ON_URL << ToUtf8String( url) << frameHierarchy;
280 280
281 Communication::InputBuffer response; 281 Communication::InputBuffer response;
282 if (!CallEngine(request, response)) 282 if (!CallEngine(request, response))
283 return false; 283 return false;
284 284
285 bool isWhitelisted; 285 bool isWhitelisted;
286 response >> isWhitelisted; 286 response >> isWhitelisted;
287 return isWhitelisted; 287 return isWhitelisted;
288 } 288 }
289 289
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 DEBUG_GENERAL("CompareVersions"); 549 DEBUG_GENERAL("CompareVersions");
550 Communication::OutputBuffer request; 550 Communication::OutputBuffer request;
551 request << Communication::PROC_COMPARE_VERSIONS << ToUtf8String(v1) << ToUtf8S tring(v2); 551 request << Communication::PROC_COMPARE_VERSIONS << ToUtf8String(v1) << ToUtf8S tring(v2);
552 Communication::InputBuffer response; 552 Communication::InputBuffer response;
553 if (!CallEngine(request, response)) 553 if (!CallEngine(request, response))
554 return 0; 554 return 0;
555 int result; 555 int result;
556 response >> result; 556 response >> result;
557 return result; 557 return result;
558 } 558 }
OLDNEW

Powered by Google App Engine
This is Rietveld