Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* | |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | |
3 * Copyright (C) 2006-2015 Eyeo GmbH | |
4 * | |
5 * Adblock Plus is free software: you can redistribute it and/or modify | |
6 * it under the terms of the GNU General Public License version 3 as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * Adblock Plus is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License | |
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | |
16 */ | |
17 | |
1 #include <AdblockPlus.h> | 18 #include <AdblockPlus.h> |
2 #include <functional> | 19 #include <functional> |
3 #include <vector> | 20 #include <vector> |
4 #include <thread> | 21 #include <thread> |
5 #include <Windows.h> | 22 #include <Windows.h> |
6 | 23 |
7 #include "../shared/AutoHandle.h" | 24 #include "../shared/AutoHandle.h" |
8 #include "../shared/Communication.h" | 25 #include "../shared/Communication.h" |
9 #include "../shared/Dictionary.h" | 26 #include "../shared/Dictionary.h" |
10 #include "../shared/Utils.h" | 27 #include "../shared/Utils.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 { | 99 { |
83 Communication::OutputBuffer response; | 100 Communication::OutputBuffer response; |
84 | 101 |
85 Communication::ProcType procedure; | 102 Communication::ProcType procedure; |
86 request >> procedure; | 103 request >> procedure; |
87 switch (procedure) | 104 switch (procedure) |
88 { | 105 { |
89 case Communication::PROC_MATCHES: | 106 case Communication::PROC_MATCHES: |
90 { | 107 { |
91 std::string url; | 108 std::string url; |
109 using namespace AdblockPlus; | |
110 std::string documentUrl; | |
92 int32_t type; | 111 int32_t type; |
93 std::string documentUrl; | |
94 request >> url >> type >> documentUrl; | 112 request >> url >> type >> documentUrl; |
95 using namespace AdblockPlus; | 113 referrerMapping.Add(url, documentUrl); |
96 auto contentType = static_cast<FilterEngine::ContentType>(type); | 114 auto contentType = static_cast<FilterEngine::ContentType>(type); |
97 auto isFrame = contentType == FilterEngine::ContentType::CONTENT_TYPE_SU BDOCUMENT ? | 115 FilterPtr filter = filterEngine->Matches(url, contentType, referrerMappi ng.BuildReferrerChain(documentUrl)); |
98 ReferrerMapping::FrameIndicator::FRAME_INDICATOR_FRAME: | 116 response << (filter && filter->GetType() != Filter::TYPE_EXCEPTION); |
99 ReferrerMapping::FrameIndicator::FRAME_INDICATOR_NOT_FRAME; | |
Eric
2015/01/13 17:29:36
The indentation is off.
Also, the expression woul
sergei
2015/01/28 13:44:45
Indentation is fixed.
I don't find it easier to re
| |
100 | |
101 referrerMapping.Add(url, documentUrl, isFrame); | |
Eric
2015/01/13 17:29:36
ReferrerMapping::Add() is declared with only two a
sergei
2015/01/28 13:44:45
Sure, the main aim of the whole change is to updat
| |
102 AdblockPlus::FilterPtr filter = filterEngine->Matches(url, contentType, referrerMapping.BuildFrameStructure(documentUrl)); | |
103 response << (filter && filter->GetType() != AdblockPlus::Filter::TYPE_EX CEPTION); | |
104 break; | 117 break; |
105 } | 118 } |
106 case Communication::PROC_GET_ELEMHIDE_SELECTORS: | 119 case Communication::PROC_GET_ELEMHIDE_SELECTORS: |
107 { | 120 { |
108 std::string domain; | 121 std::string domain; |
109 request >> domain; | 122 request >> domain; |
110 WriteStrings(response, filterEngine->GetElementHidingSelectors(domain)); | 123 WriteStrings(response, filterEngine->GetElementHidingSelectors(domain)); |
111 break; | 124 break; |
112 } | 125 } |
113 case Communication::PROC_AVAILABLE_SUBSCRIPTIONS: | 126 case Communication::PROC_AVAILABLE_SUBSCRIPTIONS: |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
493 } | 506 } |
494 catch (const std::runtime_error& e) | 507 catch (const std::runtime_error& e) |
495 { | 508 { |
496 DebugException(e); | 509 DebugException(e); |
497 return 1; | 510 return 1; |
498 } | 511 } |
499 } | 512 } |
500 | 513 |
501 return 0; | 514 return 0; |
502 } | 515 } |
LEFT | RIGHT |