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

Unified Diff: src/FilterEngine.cpp

Issue 10011043: Move ABP JS code loading to FilterEngine and make it optional (Closed)
Patch Set: Created April 2, 2013, 10:32 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « libadblockplus.gyp ('k') | src/JsEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/FilterEngine.cpp
===================================================================
--- a/src/FilterEngine.cpp
+++ b/src/FilterEngine.cpp
@@ -2,6 +2,10 @@
using namespace AdblockPlus;
+#if !FILTER_ENGINE_STUBS
+extern const char* jsSources[];
+#endif
+
Subscription::Subscription(const std::string& url, const std::string& title)
: url(url), title(title)
{
@@ -9,9 +13,10 @@
FilterEngine::FilterEngine(JsEngine& jsEngine) : jsEngine(jsEngine)
{
- // TODO: Load ABP:
- // jsEngine.Load("adblockplus_compat.js");
- // jsEngine.Load("adblockplus.js");
+#if !FILTER_ENGINE_STUBS
+ for (int i = 0; jsSources[i] && jsSources[i + 1]; i += 2)
+ jsEngine.Evaluate(jsSources[i + 1], jsSources[i]);
+#endif
}
void FilterEngine::AddSubscription(Subscription subscription)
« no previous file with comments | « libadblockplus.gyp ('k') | src/JsEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld