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

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

Issue 29426559: Issue 5137 - [emscripten] Added basic filter storage implementation (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Left Patch Set: Improved type names and added finally block Created May 8, 2017, 12:53 p.m.
Right Patch Set: Fixed bogus assert Created Aug. 31, 2017, 12:44 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
« no previous file with change/comment | « compiled/bindings/generator.cpp ('k') | compiled/library.h » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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-2017 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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 .property("softExpiration", &DownloadableSubscription::GetSoftExpiration , &DownloadableSubscription::SetSoftExpiration) 124 .property("softExpiration", &DownloadableSubscription::GetSoftExpiration , &DownloadableSubscription::SetSoftExpiration)
125 .property("lastDownload", &DownloadableSubscription::GetLastDownload, &D ownloadableSubscription::SetLastDownload) 125 .property("lastDownload", &DownloadableSubscription::GetLastDownload, &D ownloadableSubscription::SetLastDownload)
126 .property("downloadStatus", &DownloadableSubscription::GetDownloadStatus , &DownloadableSubscription::SetDownloadStatus) 126 .property("downloadStatus", &DownloadableSubscription::GetDownloadStatus , &DownloadableSubscription::SetDownloadStatus)
127 .property("lastSuccess", &DownloadableSubscription::GetLastSuccess, &Dow nloadableSubscription::SetLastSuccess) 127 .property("lastSuccess", &DownloadableSubscription::GetLastSuccess, &Dow nloadableSubscription::SetLastSuccess)
128 .property("errors", &DownloadableSubscription::GetErrorCount, &Downloada bleSubscription::SetErrorCount) 128 .property("errors", &DownloadableSubscription::GetErrorCount, &Downloada bleSubscription::SetErrorCount)
129 .property("version", &DownloadableSubscription::GetDataRevision, &Downlo adableSubscription::SetDataRevision) 129 .property("version", &DownloadableSubscription::GetDataRevision, &Downlo adableSubscription::SetDataRevision)
130 .property("requiredVersion", &DownloadableSubscription::GetRequiredVersi on, &DownloadableSubscription::SetRequiredVersion) 130 .property("requiredVersion", &DownloadableSubscription::GetRequiredVersi on, &DownloadableSubscription::SetRequiredVersion)
131 .property("downloadCount", &DownloadableSubscription::GetDownloadCount, &DownloadableSubscription::SetDownloadCount) 131 .property("downloadCount", &DownloadableSubscription::GetDownloadCount, &DownloadableSubscription::SetDownloadCount)
132 .function("serialize", &DownloadableSubscription::Serialize); 132 .function("serialize", &DownloadableSubscription::Serialize);
133 133
134 namespace_("FilterStorage") 134 singleton<FilterStorage>("FilterStorage", &FilterStorage::GetInstance)
135 .property("subscriptionCount", &FilterStorage::GetSubscriptionCount) 135 .property("subscriptionCount", &FilterStorage::GetSubscriptionCount)
136 .function("subscriptionAt", &FilterStorage::SubscriptionAt) 136 .function("subscriptionAt", &FilterStorage::SubscriptionAt)
137 .function("indexOfSubscription", &FilterStorage::IndexOfSubscription) 137 .function("indexOfSubscription", &FilterStorage::IndexOfSubscription)
138 .function("getSubscriptionForFilter", &FilterStorage::GetSubscriptionFor Filter) 138 .function("getSubscriptionForFilter", &FilterStorage::GetSubscriptionFor Filter)
139 .function("addSubscription", &FilterStorage::AddSubscription) 139 .function("addSubscription", &FilterStorage::AddSubscription)
140 .function("removeSubscription", &FilterStorage::RemoveSubscription) 140 .function("removeSubscription", &FilterStorage::RemoveSubscription)
141 .function("moveSubscription", &FilterStorage::MoveSubscription); 141 .function("moveSubscription", &FilterStorage::MoveSubscription);
142 142
143 printBindings(); 143 printBindings();
144 RegExpFilter::GenerateCustomBindings(); 144 RegExpFilter::GenerateCustomBindings();
145 FilterNotifier::GenerateCustomBindings(); 145 FilterNotifier::GenerateCustomBindings();
146 146
147 return 0; 147 return 0;
148 } 148 }
149 catch (const std::exception& e) 149 catch (const std::exception& e)
150 { 150 {
151 EM_ASM_ARGS( 151 EM_ASM_ARGS(
152 console.error("Error occurred generating JavaScript bindings: " + 152 console.error("Error occurred generating JavaScript bindings: " +
153 Module.AsciiToString($0)), e.what() 153 Module.AsciiToString($0)), e.what()
154 ); 154 );
155 return 1; 155 return 1;
156 } 156 }
157 } 157 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld