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: Addressed comments, reorganized the code Created Aug. 8, 2014, 4:37 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/AdblockPlusClient.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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 break; 189 break;
190 } 190 }
191 case Communication::PROC_IS_WHITELISTED_URL: 191 case Communication::PROC_IS_WHITELISTED_URL:
192 { 192 {
193 std::string url; 193 std::string url;
194 request >> url; 194 request >> url;
195 AdblockPlus::FilterPtr match = filterEngine->Matches(url, "DOCUMENT", ur l); 195 AdblockPlus::FilterPtr match = filterEngine->Matches(url, "DOCUMENT", ur l);
196 response << (match && match->GetType() == AdblockPlus::Filter::TYPE_EXCE PTION); 196 response << (match && match->GetType() == AdblockPlus::Filter::TYPE_EXCE PTION);
197 break; 197 break;
198 } 198 }
199 case Communication::PROC_IS_ELEMHIDE_WHITELISTED_ON_URL:
200 {
201 std::string documentUrl;
Felix Dahlke 2014/08/08 16:41:45 Would make more sense to rename this to "url" IMO,
202 request >> documentUrl;
203 AdblockPlus::FilterPtr match = filterEngine->Matches(documentUrl, "ELEMH IDE", documentUrl);
204 response << (match && match->GetType() == AdblockPlus::Filter::TYPE_EXCE PTION);
205 break;
206 }
199 case Communication::PROC_ADD_FILTER: 207 case Communication::PROC_ADD_FILTER:
200 { 208 {
201 std::string text; 209 std::string text;
202 request >> text; 210 request >> text;
203 211
204 filterEngine->GetFilter(text)->AddToList(); 212 filterEngine->GetFilter(text)->AddToList();
205 break; 213 break;
206 } 214 }
207 case Communication::PROC_REMOVE_FILTER: 215 case Communication::PROC_REMOVE_FILTER:
208 { 216 {
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 } 484 }
477 catch (const std::runtime_error& e) 485 catch (const std::runtime_error& e)
478 { 486 {
479 DebugException(e); 487 DebugException(e);
480 return 1; 488 return 1;
481 } 489 }
482 } 490 }
483 491
484 return 0; 492 return 0;
485 } 493 }
OLDNEW
« no previous file with comments | « no previous file | src/plugin/AdblockPlusClient.h » ('j') | src/plugin/AdblockPlusClient.cpp » ('J')

Powered by Google App Engine
This is Rietveld