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

Unified Diff: src/FileSystemJsObject.cpp

Issue 29393589: Issue 5013 - Make more methods const.- introduced JsConstValuePtr and JsConstValueList- JsValue:… (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Rebased on master Created March 24, 2017, 2:40 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
« no previous file with comments | « include/AdblockPlus/JsValue.h ('k') | src/FilterEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/FileSystemJsObject.cpp
===================================================================
--- a/src/FileSystemJsObject.cpp
+++ b/src/FileSystemJsObject.cpp
@@ -71,17 +71,17 @@ namespace
{
error = "Unknown error while reading from " + path;
}
const JsContext context(jsEngine);
JsValuePtr result = jsEngine->NewObject();
result->SetProperty("content", content);
result->SetProperty("error", error);
- JsValueList params;
+ JsConstValueList params;
params.push_back(result);
callback->Call(params);
}
private:
std::string path;
};
@@ -109,17 +109,17 @@ namespace
}
catch (...)
{
error = "Unknown error while writing to " + path;
}
const JsContext context(jsEngine);
JsValuePtr errorValue = jsEngine->NewValue(error);
- JsValueList params;
+ JsConstValueList params;
params.push_back(errorValue);
callback->Call(params);
}
private:
std::string path;
std::string content;
};
@@ -146,17 +146,17 @@ namespace
}
catch (...)
{
error = "Unknown error while moving " + fromPath + " to " + toPath;
}
const JsContext context(jsEngine);
JsValuePtr errorValue = jsEngine->NewValue(error);
- JsValueList params;
+ JsConstValueList params;
params.push_back(errorValue);
callback->Call(params);
}
private:
std::string fromPath;
std::string toPath;
};
@@ -183,17 +183,17 @@ namespace
}
catch (...)
{
error = "Unknown error while removing " + path;
}
const JsContext context(jsEngine);
JsValuePtr errorValue = jsEngine->NewValue(error);
- JsValueList params;
+ JsConstValueList params;
params.push_back(errorValue);
callback->Call(params);
}
private:
std::string path;
};
@@ -227,17 +227,17 @@ namespace
const JsContext context(jsEngine);
JsValuePtr result = jsEngine->NewObject();
result->SetProperty("exists", statResult.exists);
result->SetProperty("isFile", statResult.isFile);
result->SetProperty("isDirectory", statResult.isDirectory);
result->SetProperty("lastModified", statResult.lastModified);
result->SetProperty("error", error);
- JsValueList params;
+ JsConstValueList params;
params.push_back(result);
callback->Call(params);
}
private:
std::string path;
};
« no previous file with comments | « include/AdblockPlus/JsValue.h ('k') | src/FilterEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld