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

Delta Between Two Patch Sets: compiled/bindings/main.cpp

Issue 29556737: Issue 5141 - Convert filter match to C++ (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Addressed most of the comment. Fixed some issues. Created Oct. 3, 2017, 7:31 p.m.
Right Patch Set: Fixed many issues. One test left out. Created Oct. 6, 2017, 1:45 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
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 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 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 .property("lastDownload", &DownloadableSubscription::GetLastDownload, &D ownloadableSubscription::SetLastDownload) 126 .property("lastDownload", &DownloadableSubscription::GetLastDownload, &D ownloadableSubscription::SetLastDownload)
127 .property("downloadStatus", &DownloadableSubscription::GetDownloadStatus , &DownloadableSubscription::SetDownloadStatus) 127 .property("downloadStatus", &DownloadableSubscription::GetDownloadStatus , &DownloadableSubscription::SetDownloadStatus)
128 .property("lastSuccess", &DownloadableSubscription::GetLastSuccess, &Dow nloadableSubscription::SetLastSuccess) 128 .property("lastSuccess", &DownloadableSubscription::GetLastSuccess, &Dow nloadableSubscription::SetLastSuccess)
129 .property("errors", &DownloadableSubscription::GetErrorCount, &Downloada bleSubscription::SetErrorCount) 129 .property("errors", &DownloadableSubscription::GetErrorCount, &Downloada bleSubscription::SetErrorCount)
130 .property("version", &DownloadableSubscription::GetDataRevision, &Downlo adableSubscription::SetDataRevision) 130 .property("version", &DownloadableSubscription::GetDataRevision, &Downlo adableSubscription::SetDataRevision)
131 .property("requiredVersion", &DownloadableSubscription::GetRequiredVersi on, &DownloadableSubscription::SetRequiredVersion) 131 .property("requiredVersion", &DownloadableSubscription::GetRequiredVersi on, &DownloadableSubscription::SetRequiredVersion)
132 .property("downloadCount", &DownloadableSubscription::GetDownloadCount, &DownloadableSubscription::SetDownloadCount) 132 .property("downloadCount", &DownloadableSubscription::GetDownloadCount, &DownloadableSubscription::SetDownloadCount)
133 .function("serialize", &DownloadableSubscription::Serialize); 133 .function("serialize", &DownloadableSubscription::Serialize);
134 134
135 class_<ReMatchResults>("ReMatchResults") 135 class_<ReMatchResults>("ReMatchResults")
136 .function("push", &ReMatchResults::push); 136 .function("push", &ReMatchResults::push);
Wladimir Palant 2017/10/09 08:39:47 Why do we need to export what is clearly an intern
sergei 2017/10/09 15:27:51 This class is used as a callback to obtain the res
hub 2017/10/10 13:46:15 The sole purpose of this class is to be able to ge
137 137
138 class_<CombinedMatcher>("CombinedMatcher") 138 class_<CombinedMatcher>("CombinedMatcher")
139 .class_function("create", &CombinedMatcher::Create)
139 .function("add", &CombinedMatcher::Add) 140 .function("add", &CombinedMatcher::Add)
140 .function("remove", &CombinedMatcher::Remove) 141 .function("remove", &CombinedMatcher::Remove)
141 .function("matchesAny", &CombinedMatcher::MatchesAny) 142 .function("matchesAny", &CombinedMatcher::MatchesAny)
142 .function("clear", &CombinedMatcher::Clear) 143 .function("clear", &CombinedMatcher::Clear)
143 .function("hasFilter", &CombinedMatcher::HasFilter) 144 .function("hasFilter", &CombinedMatcher::HasFilter)
144 .function("getKeywordForFilter", &CombinedMatcher::GetKeywordForFilter) 145 .function("getKeywordForFilter", &CombinedMatcher::GetKeywordForFilter)
145 .function("findKeyword", &CombinedMatcher::FindKeyword); 146 .function("findKeyword", &CombinedMatcher::FindKeyword);
Wladimir Palant 2017/10/09 08:39:47 The three methods above shouldn't be exported, the
sergei 2017/10/09 15:27:52 I think they are currently exported for the sake o
Wladimir Palant 2017/10/10 07:39:05 Yes, that's probably it. We should remove/rewrite
hub 2017/10/10 13:46:15 Note that currently these are test that exist in m
146 147
147 class_<Matcher>("Matcher") 148 class_<Matcher>("Matcher")
149 .class_function("create", &Matcher::Create)
148 .function("add", &Matcher::Add) 150 .function("add", &Matcher::Add)
149 .function("remove", &Matcher::Remove) 151 .function("remove", &Matcher::Remove)
150 .function("matchesAny", &Matcher::MatchesAny) 152 .function("matchesAny", &Matcher::MatchesAny)
151 .function("clear", &Matcher::Clear) 153 .function("clear", &Matcher::Clear)
152 .function("hasFilter", &Matcher::HasFilter) 154 .function("hasFilter", &Matcher::HasFilter)
153 .function("getKeywordForFilter", &Matcher::GetKeywordForFilter) 155 .function("getKeywordForFilter", &Matcher::GetKeywordForFilter)
154 .function("findKeyword", &Matcher::FindKeyword); 156 .function("findKeyword", &Matcher::FindKeyword);
155 157
156 singleton<FilterStorage>("FilterStorage", &FilterStorage::GetInstance) 158 singleton<FilterStorage>("FilterStorage", &FilterStorage::GetInstance)
157 .property("subscriptionCount", &FilterStorage::GetSubscriptionCount) 159 .property("subscriptionCount", &FilterStorage::GetSubscriptionCount)
(...skipping 12 matching lines...) Expand all
170 } 172 }
171 catch (const std::exception& e) 173 catch (const std::exception& e)
172 { 174 {
173 EM_ASM_ARGS( 175 EM_ASM_ARGS(
174 console.error("Error occurred generating JavaScript bindings: " + 176 console.error("Error occurred generating JavaScript bindings: " +
175 Module.AsciiToString($0)), e.what() 177 Module.AsciiToString($0)), e.what()
176 ); 178 );
177 return 1; 179 return 1;
178 } 180 }
179 } 181 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld