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

Side by Side Diff: compiled/bindings/main.cpp

Issue 29606600: Issue 5146 - Implement DownloadableSubscription parsing in C++ (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Removed Md5sum and associated code Created Aug. 14, 2018, 12:38 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 | « compiled/StringScanner.h ('k') | compiled/storage/FilterStorage.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 .property("lastCheck", &DownloadableSubscription::GetLastCheck, &Downloa dableSubscription::SetLastCheck) 128 .property("lastCheck", &DownloadableSubscription::GetLastCheck, &Downloa dableSubscription::SetLastCheck)
129 .property("hardExpiration", &DownloadableSubscription::GetHardExpiration , &DownloadableSubscription::SetHardExpiration) 129 .property("hardExpiration", &DownloadableSubscription::GetHardExpiration , &DownloadableSubscription::SetHardExpiration)
130 .property("softExpiration", &DownloadableSubscription::GetSoftExpiration , &DownloadableSubscription::SetSoftExpiration) 130 .property("softExpiration", &DownloadableSubscription::GetSoftExpiration , &DownloadableSubscription::SetSoftExpiration)
131 .property("lastDownload", &DownloadableSubscription::GetLastDownload, &D ownloadableSubscription::SetLastDownload) 131 .property("lastDownload", &DownloadableSubscription::GetLastDownload, &D ownloadableSubscription::SetLastDownload)
132 .property("downloadStatus", &DownloadableSubscription::GetDownloadStatus , &DownloadableSubscription::SetDownloadStatus) 132 .property("downloadStatus", &DownloadableSubscription::GetDownloadStatus , &DownloadableSubscription::SetDownloadStatus)
133 .property("lastSuccess", &DownloadableSubscription::GetLastSuccess, &Dow nloadableSubscription::SetLastSuccess) 133 .property("lastSuccess", &DownloadableSubscription::GetLastSuccess, &Dow nloadableSubscription::SetLastSuccess)
134 .property("errorCount", &DownloadableSubscription::GetErrorCount, &Downl oadableSubscription::SetErrorCount) 134 .property("errorCount", &DownloadableSubscription::GetErrorCount, &Downl oadableSubscription::SetErrorCount)
135 .property("dataRevision", &DownloadableSubscription::GetDataRevision, &D ownloadableSubscription::SetDataRevision) 135 .property("dataRevision", &DownloadableSubscription::GetDataRevision, &D ownloadableSubscription::SetDataRevision)
136 .property("requiredVersion", &DownloadableSubscription::GetRequiredVersi on, &DownloadableSubscription::SetRequiredVersion) 136 .property("requiredVersion", &DownloadableSubscription::GetRequiredVersi on, &DownloadableSubscription::SetRequiredVersion)
137 .property("downloadCount", &DownloadableSubscription::GetDownloadCount, &DownloadableSubscription::SetDownloadCount) 137 .property("downloadCount", &DownloadableSubscription::GetDownloadCount, &DownloadableSubscription::SetDownloadCount)
138 .class_function("parseDownload", &DownloadableSubscription::ParseDownloa d)
138 .function("serialize", &DownloadableSubscription::Serialize); 139 .function("serialize", &DownloadableSubscription::Serialize);
139 140
141 class_<DownloadableSubscription_Parser>("DownloadableSubscription_Parser")
142 .property("redirect", &DownloadableSubscription_Parser::GetRedirect)
143 .property("homepage", &DownloadableSubscription_Parser::GetHomepage)
144 .function("process", &DownloadableSubscription_Parser::Process)
145 .function("finalize", &DownloadableSubscription_Parser::Finalize);
146
140 singleton<FilterStorage>("FilterStorage", &FilterStorage::GetInstance) 147 singleton<FilterStorage>("FilterStorage", &FilterStorage::GetInstance)
141 .property("subscriptionCount", &FilterStorage::GetSubscriptionCount) 148 .property("subscriptionCount", &FilterStorage::GetSubscriptionCount)
142 .function("subscriptionAt", &FilterStorage::SubscriptionAt) 149 .function("subscriptionAt", &FilterStorage::SubscriptionAt)
143 .function("indexOfSubscription", &FilterStorage::IndexOfSubscription) 150 .function("indexOfSubscription", &FilterStorage::IndexOfSubscription)
144 .function("getSubscriptionForFilter", &FilterStorage::GetSubscriptionFor Filter) 151 .function("getSubscriptionForFilter", &FilterStorage::GetSubscriptionFor Filter)
145 .function("addSubscription", &FilterStorage::AddSubscription) 152 .function("addSubscription", &FilterStorage::AddSubscription)
146 .function("removeSubscription", &FilterStorage::RemoveSubscription) 153 .function("removeSubscription", &FilterStorage::RemoveSubscription)
147 .function("moveSubscription", &FilterStorage::MoveSubscription); 154 .function("moveSubscription", &FilterStorage::MoveSubscription)
155 .function("clearSubscriptionFilters", &FilterStorage::ClearSubscriptionF ilters);
148 156
149 class_<ElemHide_SelectorList>("ElemHide_SelectorList") 157 class_<ElemHide_SelectorList>("ElemHide_SelectorList")
150 .property("selectorCount", &ElemHide_SelectorList::GetSelectorCount) 158 .property("selectorCount", &ElemHide_SelectorList::GetSelectorCount)
151 .function("selectorAt", &ElemHide_SelectorList::SelectorAt) 159 .function("selectorAt", &ElemHide_SelectorList::SelectorAt)
152 .function("filterKeyAt", &ElemHide_SelectorList::FilterKeyAt); 160 .function("filterKeyAt", &ElemHide_SelectorList::FilterKeyAt);
153 161
154 class_<ElemHide>("ElemHide") 162 class_<ElemHide>("ElemHide")
155 .class_function("create", &ElemHide::Create) 163 .class_function("create", &ElemHide::Create)
156 .function("add", &ElemHide::Add) 164 .function("add", &ElemHide::Add)
157 .function("remove", &ElemHide::Remove) 165 .function("remove", &ElemHide::Remove)
(...skipping 20 matching lines...) Expand all
178 } 186 }
179 catch (const std::exception& e) 187 catch (const std::exception& e)
180 { 188 {
181 EM_ASM_ARGS( 189 EM_ASM_ARGS(
182 console.error("Error occurred generating JavaScript bindings: " + 190 console.error("Error occurred generating JavaScript bindings: " +
183 Module.AsciiToString($0)), e.what() 191 Module.AsciiToString($0)), e.what()
184 ); 192 );
185 return 1; 193 return 1;
186 } 194 }
187 } 195 }
OLDNEW
« no previous file with comments | « compiled/StringScanner.h ('k') | compiled/storage/FilterStorage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld