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

Side by Side Diff: src/engine/Main.cpp

Issue 4784041706389504: Issue 1183 - Fix Acceptable Ads hiding (Closed)
Patch Set: Created Aug. 8, 2014, 3:51 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
« no previous file with comments | « no previous file | src/plugin/AdblockPlusClient.h » ('j') | src/plugin/PluginTabBase.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include <AdblockPlus.h> 1 #include <AdblockPlus.h>
2 #include <functional> 2 #include <functional>
3 #include <vector> 3 #include <vector>
4 #include <thread> 4 #include <thread>
5 #include <Windows.h> 5 #include <Windows.h>
6 6
7 #include "../shared/AutoHandle.h" 7 #include "../shared/AutoHandle.h"
8 #include "../shared/Communication.h" 8 #include "../shared/Communication.h"
9 #include "../shared/Dictionary.h" 9 #include "../shared/Dictionary.h"
10 #include "../shared/Utils.h" 10 #include "../shared/Utils.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 { 89 {
90 std::string url; 90 std::string url;
91 std::string type; 91 std::string type;
92 std::string documentUrl; 92 std::string documentUrl;
93 request >> url >> type >> documentUrl; 93 request >> url >> type >> documentUrl;
94 referrerMapping.Add(url, documentUrl); 94 referrerMapping.Add(url, documentUrl);
95 AdblockPlus::FilterPtr filter = filterEngine->Matches(url, type, referre rMapping.BuildReferrerChain(documentUrl)); 95 AdblockPlus::FilterPtr filter = filterEngine->Matches(url, type, referre rMapping.BuildReferrerChain(documentUrl));
96 response << (filter && filter->GetType() != AdblockPlus::Filter::TYPE_EX CEPTION); 96 response << (filter && filter->GetType() != AdblockPlus::Filter::TYPE_EX CEPTION);
97 break; 97 break;
98 } 98 }
99 case Communication::PROC_HIDING_ENABLED_ON_DOMAIN:
Felix Dahlke 2014/08/08 16:11:35 Since this is conceptually very similar to PROC_IS
100 {
101 std::string type;
Felix Dahlke 2014/08/08 16:11:35 Unused, isn't it?
102 std::string documentUrl;
103 request >> documentUrl;
104 AdblockPlus::FilterPtr filter = filterEngine->Matches(documentUrl, "ELEM HIDE", documentUrl);
105 response << (!filter);
Felix Dahlke 2014/08/08 16:11:35 Superfluous parentheses. More importantly, this o
106 break;
107 }
99 case Communication::PROC_GET_ELEMHIDE_SELECTORS: 108 case Communication::PROC_GET_ELEMHIDE_SELECTORS:
100 { 109 {
101 std::string domain; 110 std::string domain;
102 request >> domain; 111 request >> domain;
103 WriteStrings(response, filterEngine->GetElementHidingSelectors(domain)); 112 WriteStrings(response, filterEngine->GetElementHidingSelectors(domain));
104 break; 113 break;
105 } 114 }
106 case Communication::PROC_AVAILABLE_SUBSCRIPTIONS: 115 case Communication::PROC_AVAILABLE_SUBSCRIPTIONS:
107 { 116 {
108 WriteSubscriptions(response, filterEngine->FetchAvailableSubscriptions() ); 117 WriteSubscriptions(response, filterEngine->FetchAvailableSubscriptions() );
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 } 485 }
477 catch (const std::runtime_error& e) 486 catch (const std::runtime_error& e)
478 { 487 {
479 DebugException(e); 488 DebugException(e);
480 return 1; 489 return 1;
481 } 490 }
482 } 491 }
483 492
484 return 0; 493 return 0;
485 } 494 }
OLDNEW
« no previous file with comments | « no previous file | src/plugin/AdblockPlusClient.h » ('j') | src/plugin/PluginTabBase.cpp » ('J')

Powered by Google App Engine
This is Rietveld