| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 { | 87 { |
| 88 case Communication::PROC_MATCHES: | 88 case Communication::PROC_MATCHES: |
| 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; | |
| 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; | 97 break; |
| 107 } | 98 } |
| 108 case Communication::PROC_GET_ELEMHIDE_SELECTORS: | 99 case Communication::PROC_GET_ELEMHIDE_SELECTORS: |
| 109 { | 100 { |
| 110 std::string domain; | 101 std::string domain; |
| 111 request >> domain; | 102 request >> domain; |
| 112 WriteStrings(response, filterEngine->GetElementHidingSelectors(domain)); | 103 WriteStrings(response, filterEngine->GetElementHidingSelectors(domain)); |
| 113 break; | 104 break; |
| 114 } | 105 } |
| 115 case Communication::PROC_AVAILABLE_SUBSCRIPTIONS: | 106 case Communication::PROC_AVAILABLE_SUBSCRIPTIONS: |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 } | 186 } |
| 196 | 187 |
| 197 WriteStrings(response, domains); | 188 WriteStrings(response, domains); |
| 198 break; | 189 break; |
| 199 } | 190 } |
| 200 case Communication::PROC_IS_WHITELISTED_URL: | 191 case Communication::PROC_IS_WHITELISTED_URL: |
| 201 { | 192 { |
| 202 std::string url; | 193 std::string url; |
| 203 request >> url; | 194 request >> url; |
| 204 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); | |
| 197 break; | |
| 198 } | |
| 199 case Communication::PROC_IS_ELEMHIDE_WHITELISTED_ON_URL: | |
| 200 { | |
| 201 std::string url; | |
| 202 request >> url; | |
| 203 AdblockPlus::FilterPtr match = filterEngine->Matches(url, "ELEMHIDE", ur l); | |
| 205 response << (match && match->GetType() == AdblockPlus::Filter::TYPE_EXCE PTION); | 204 response << (match && match->GetType() == AdblockPlus::Filter::TYPE_EXCE PTION); |
| 206 break; | 205 break; |
| 207 } | 206 } |
| 208 case Communication::PROC_ADD_FILTER: | 207 case Communication::PROC_ADD_FILTER: |
| 209 { | 208 { |
| 210 std::string text; | 209 std::string text; |
| 211 request >> text; | 210 request >> text; |
| 212 | 211 |
| 213 filterEngine->GetFilter(text)->AddToList(); | 212 filterEngine->GetFilter(text)->AddToList(); |
| 214 break; | 213 break; |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 485 } | 484 } |
| 486 catch (const std::runtime_error& e) | 485 catch (const std::runtime_error& e) |
| 487 { | 486 { |
| 488 DebugException(e); | 487 DebugException(e); |
| 489 return 1; | 488 return 1; |
| 490 } | 489 } |
| 491 } | 490 } |
| 492 | 491 |
| 493 return 0; | 492 return 0; |
| 494 } | 493 } |
| LEFT | RIGHT |