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

Unified Diff: src/FilterEngine.cpp

Issue 29408747: Issue 5013 - Mark more method as const (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created April 10, 2017, 3:08 p.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
Index: src/FilterEngine.cpp
===================================================================
--- a/src/FilterEngine.cpp
+++ b/src/FilterEngine.cpp
@@ -328,17 +328,17 @@
return jsEngine->Evaluate("API.isAASubscriptionEnabled()")->AsBool();
}
std::string FilterEngine::GetAAUrl() const
{
return GetPref("subscriptions_exceptionsurl")->AsString();
}
-void FilterEngine::ShowNextNotification(const std::string& url)
+void FilterEngine::ShowNextNotification(const std::string& url) const
{
JsValuePtr func = jsEngine->Evaluate("API.showNextNotification");
JsConstValueList params;
if (!url.empty())
{
params.push_back(jsEngine->NewValue(url));
}
func->Call(params);
@@ -457,17 +457,17 @@
}
void FilterEngine::RemoveUpdateAvailableCallback()
{
jsEngine->RemoveEventCallback("updateAvailable");
}
void FilterEngine::UpdateAvailable(
- FilterEngine::UpdateAvailableCallback callback, JsValueList& params)
+ FilterEngine::UpdateAvailableCallback callback, JsValueList& params) const
{
if (params.size() >= 1 && !params[0]->IsNull())
callback(params[0]->AsString());
}
void FilterEngine::ForceUpdateCheck(
const FilterEngine::UpdateCheckDoneCallback& callback)
{
@@ -511,25 +511,25 @@
std::unique_ptr<std::string> FilterEngine::GetAllowedConnectionType() const
{
auto prefValue = GetPref("allowed_connection_type");
if (prefValue->AsString().empty())
return nullptr;
return std::unique_ptr<std::string>(new std::string(prefValue->AsString()));
}
-void FilterEngine::FilterChanged(FilterEngine::FilterChangeCallback callback, JsValueList& params)
+void FilterEngine::FilterChanged(FilterEngine::FilterChangeCallback callback, JsValueList& params) const
{
std::string action(params.size() >= 1 && !params[0]->IsNull() ? params[0]->AsString() : "");
JsValuePtr item(params.size() >= 2 ? params[1] : jsEngine->NewValue(false));
callback(action, item);
}
void FilterEngine::ShowNotification(const ShowNotificationCallback& callback,
- const JsValueList& params)
+ const JsValueList& params) const
{
if (params.size() < 1)
return;
if (!params[0]->IsObject())
{
return;
}

Powered by Google App Engine
This is Rietveld