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

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

Issue 5070706781978624: Issue #276 - introduce class BSTR_Argument (Closed)
Left Patch Set: Created July 25, 2014, 9:32 p.m.
Right Patch Set: clarified documentation for operator&, updated to_wstring(CString) Created July 30, 2014, 2:13 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/PluginFilter.h ('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 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include "PluginFilter.h" 3 #include "PluginFilter.h"
4 4
5 #include "COM_Value.h" 5 #include "COM_Value.h"
6 #if (defined PRODUCT_ADBLOCKPLUS) 6 #if (defined PRODUCT_ADBLOCKPLUS)
7 #include "PluginSettings.h" 7 #include "PluginSettings.h"
8 #include "PluginClient.h" 8 #include "PluginClient.h"
9 #include "PluginClientFactory.h" 9 #include "PluginClientFactory.h"
10 #endif 10 #endif
11 11
12 #include "PluginMutex.h" 12 #include "PluginMutex.h"
13 #include "PluginSettings.h" 13 #include "PluginSettings.h"
14 #include "PluginSystem.h" 14 #include "PluginSystem.h"
15 #include "PluginClass.h" 15 #include "PluginClass.h"
16 #include "mlang.h" 16 #include "mlang.h"
17 17
18 #include "..\shared\CriticalSection.h" 18 #include "..\shared\CriticalSection.h"
19 19
20 // The filters are described at http://adblockplus.org/en/filters 20 // The filters are described at http://adblockplus.org/en/filters
21 21
22 static CriticalSection s_criticalSectionFilterMap; 22 static CriticalSection s_criticalSectionFilterMap;
23 23
24 // ============================================================================ 24 // ============================================================================
25 // CFilterElementHideAttrSelector 25 // CFilterElementHideAttrSelector
26 // ============================================================================ 26 // ============================================================================
27 27
28 CFilterElementHideAttrSelector::CFilterElementHideAttrSelector() : m_type(TYPE_N ONE), m_pos(POS_NONE), m_attr(L"") 28 CFilterElementHideAttrSelector::CFilterElementHideAttrSelector() : m_type(TYPE_N ONE), m_pos(POS_NONE)
sergei 2014/07/28 09:18:26 CString should have a default constructor, just re
Eric 2014/07/29 16:59:27 Done.
29 { 29 {
30 } 30 }
31 31
32 CFilterElementHideAttrSelector::CFilterElementHideAttrSelector(const CFilterElem entHideAttrSelector& filter) 32 CFilterElementHideAttrSelector::CFilterElementHideAttrSelector(const CFilterElem entHideAttrSelector& filter)
33 { 33 {
34 m_type = filter.m_type; 34 m_type = filter.m_type;
35 m_pos = filter.m_pos; 35 m_pos = filter.m_pos;
36 m_attr = filter.m_attr; 36 m_attr = filter.m_attr;
37 37
38 m_value = filter.m_value; 38 m_value = filter.m_value;
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 bool CPluginFilter::IsElementHidden(const CString& tag, IHTMLElement* pEl, const CString& domain, const CString& indent) const 517 bool CPluginFilter::IsElementHidden(const CString& tag, IHTMLElement* pEl, const CString& domain, const CString& indent) const
518 { 518 {
519 CString id; 519 CString id;
520 AdblockPlus::COM::BSTR_Argument result; 520 AdblockPlus::COM::BSTR_Argument result;
521 if (SUCCEEDED(pEl->get_id(&result))) 521 if (SUCCEEDED(pEl->get_id(&result)))
522 { 522 {
523 id = to_CString(result); 523 id = to_CString(result);
524 } 524 }
525 525
526 CString classNames; 526 CString classNames;
527 // reuse of 'result' is not an error, since address-of operator permits it 527 // reuse of 'result' is not an error, since address-of operator permits it
sergei 2014/07/28 09:18:26 It's too specific and requires additional comment
Eric 2014/07/29 16:59:27 It will also disappear by itself, since these are
sergei 2014/07/30 10:10:54 Sorry, not clear.
Eric 2014/07/30 14:14:42 What is your question?
528 if (SUCCEEDED(pEl->get_className(&result))) 528 if (SUCCEEDED(pEl->get_className(&result)))
529 { 529 {
530 classNames = to_CString(result); 530 classNames = to_CString(result);
531 } 531 }
532 532
533 CriticalSection::Lock filterEngineLock(s_criticalSectionFilterMap); 533 CriticalSection::Lock filterEngineLock(s_criticalSectionFilterMap);
534 { 534 {
535 CString domainTest = domain; 535 CString domainTest = domain;
536 536
537 // Search tag/id filters 537 // Search tag/id filters
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 DEBUG_FILTER("Filter::ShouldBlock " + type + " YES") 720 DEBUG_FILTER("Filter::ShouldBlock " + type + " YES")
721 721
722 #ifdef ENABLE_DEBUG_RESULT 722 #ifdef ENABLE_DEBUG_RESULT
723 CPluginDebug::DebugResultBlocking(type, src, domain); 723 CPluginDebug::DebugResultBlocking(type, src, domain);
724 #endif 724 #endif
725 } 725 }
726 return true; 726 return true;
727 } 727 }
728 return false; 728 return false;
729 } 729 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld