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

Unified Diff: include/AdblockPlus/IFileSystem.h

Issue 29731562: Issue 6477 - separate done and error callbacks in IFileSystem::Read (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git@c0a6434596a83383e37678ef3b6ecef00ed6a261
Patch Set: Created March 23, 2018, 10:58 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 | « no previous file | include/AdblockPlus/JsEngine.h » ('j') | src/FileSystemJsObject.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/IFileSystem.h
diff --git a/include/AdblockPlus/IFileSystem.h b/include/AdblockPlus/IFileSystem.h
index 619b27139b6b1b744c2aaa2b11b44453d03f90e6..db69a410fb6dce8b465a4f302e4dfb35af90099c 100644
--- a/include/AdblockPlus/IFileSystem.h
+++ b/include/AdblockPlus/IFileSystem.h
@@ -69,18 +69,20 @@ namespace AdblockPlus
/**
* Callback type for the asynchronous Read call.
* @param Output char array with file content.
- * @param An error string. Empty if success.
*/
- typedef std::function<void(IOBuffer&&,
- const std::string&)> ReadCallback;
+ typedef std::function<void(IOBuffer&&)> ReadCallback;
/**
* Reads from a file.
* @param fileName File name.
- * @param callback The function called on completion with the input data.
+ * @param doneCallback The function called on completion with the input
+ * data. If this function throws then the implementation should call
+ * `errorCallback`.
+ * @param errorCallback The function called if an error occured.
*/
virtual void Read(const std::string& fileName,
- const ReadCallback& callback) const = 0;
+ const ReadCallback& doneCallback,
+ const Callback& errorCallback) const = 0;
/**
* Writes to a file.
« no previous file with comments | « no previous file | include/AdblockPlus/JsEngine.h » ('j') | src/FileSystemJsObject.cpp » ('J')

Powered by Google App Engine
This is Rietveld