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

Unified Diff: include/AdblockPlus/ITimer.h

Issue 29397642: Noissue - update to libadblockplus revision b59b88dcad1a (Closed)
Patch Set: Created March 29, 2017, 4:16 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 | « android_x86/libv8_snapshot.a ('k') | include/AdblockPlus/JsEngine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/ITimer.h
diff --git a/include/AdblockPlus/LogSystem.h b/include/AdblockPlus/ITimer.h
similarity index 52%
copy from include/AdblockPlus/LogSystem.h
copy to include/AdblockPlus/ITimer.h
index 6a71d5cfa98daf9390825e913143bf9f5b54f436..291e56f1626418daa7dacd9ddfd0a53611137fe5 100644
--- a/include/AdblockPlus/LogSystem.h
+++ b/include/AdblockPlus/ITimer.h
@@ -15,42 +15,38 @@
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef ADBLOCK_PLUS_LOG_SYSTEM_H
-#define ADBLOCK_PLUS_LOG_SYSTEM_H
+#ifndef ADBLOCK_PLUS_TIMER_H
+#define ADBLOCK_PLUS_TIMER_H
-#include <string>
+#include <functional>
+#include <chrono>
#include <memory>
namespace AdblockPlus
{
/**
- * Logging interface.
+ * Timer manager interface.
*/
- class LogSystem
+ struct ITimer
anton 2017/03/30 05:27:30 This is obviously git/rietveld bug as the class di
{
- public:
/**
- * Log level.
- */
- enum LogLevel {LOG_LEVEL_TRACE, LOG_LEVEL_LOG, LOG_LEVEL_INFO, LOG_LEVEL_WARN, LOG_LEVEL_ERROR};
-
- virtual ~LogSystem() {}
+ * Callback type invoked after elapsing of timer timeout.
+ */
+ typedef std::function<void()> TimerCallback;
+ virtual ~ITimer() {};
/**
- * Writes a log message.
- * @param logLevel Log level.
- * @param message Log message.
- * @param source Source of the message, e.g. file name and line.
- * Ignored when empty.
+ * Sets a timer.
+ * @param timeout A timer callback will be called after that interval.
+ * @param timeCallback The callback which is called after timeout.
*/
- virtual void operator()(LogLevel logLevel, const std::string& message,
- const std::string& source) = 0;
+ virtual void SetTimer(const std::chrono::milliseconds& timeout, const TimerCallback& timerCallback) = 0;
};
/**
- * Shared smart pointer to a `LogSystem` instance.
+ * Unique smart pointer to an instance of `ITimer` implementation.
*/
- typedef std::shared_ptr<LogSystem> LogSystemPtr;
+ typedef std::unique_ptr<ITimer> TimerPtr;
}
#endif
« no previous file with comments | « android_x86/libv8_snapshot.a ('k') | include/AdblockPlus/JsEngine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld