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

Unified Diff: include/AdblockPlus/JsEngine.h

Issue 29498576: Issue 4832 - remove API allowing changing of LogSystem after Initialization of JsEngine (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created July 26, 2017, 2:43 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 | « no previous file | include/AdblockPlus/LogSystem.h » ('j') | include/AdblockPlus/LogSystem.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/JsEngine.h
diff --git a/include/AdblockPlus/JsEngine.h b/include/AdblockPlus/JsEngine.h
index f4a3d3bb1a8c789b70750e7196ae570f38eebd53..0fdc0fa485d23fc516c209a7dec8e8ecd49f7e76 100644
--- a/include/AdblockPlus/JsEngine.h
+++ b/include/AdblockPlus/JsEngine.h
@@ -66,6 +66,11 @@ namespace AdblockPlus
WebRequestPtr CreateDefaultWebRequest();
/**
+ * A factory to construct LogSystem.
+ */
+ LogSystemPtr CreateDefaultLogSystem();
+
+ /**
* Scope based isolate manager. Creates a new isolate instance on
* constructing and disposes it on destructing.
*/
@@ -126,12 +131,14 @@ namespace AdblockPlus
* @param timer Implementation of timer.
* @param fileSystem Implementation of filesystem.
* @param webRequest Implementation of web request.
+ * @param logSystem Implementation of log system.
* @return New `JsEngine` instance.
*/
static JsEnginePtr New(const AppInfo& appInfo = AppInfo(),
TimerPtr timer = CreateDefaultTimer(),
FileSystemPtr fileSystem = CreateDefaultFileSystem(),
- WebRequestPtr webRequest = CreateDefaultWebRequest());
+ WebRequestPtr webRequest = CreateDefaultWebRequest(),
+ LogSystemPtr logSystem = CreateDefaultLogSystem());
/**
* Registers the callback function for an event.
@@ -277,18 +284,10 @@ namespace AdblockPlus
void SetFileSystem(const FileSystemSyncPtr& val);
/**
- * @see `SetLogSystem()`.
- */
- LogSystemPtr GetLogSystem() const;
-
- /**
- * Sets the `LogSystem` implementation used for logging (e.g. to handle
- * `console.log()` calls from JavaScript).
- * Setting this is optional, the engine will use a `DefaultLogSystem`
- * instance by default, which might be sufficient.
- * @param The `LogSystem` instance to use.
+ * Private functionality.
+ * @return The LogSystem implementation.
*/
- void SetLogSystem(const LogSystemPtr& val);
+ LogSystem& GetLogSystem();
/**
* Sets a global property that can be accessed by all the scripts.
@@ -313,7 +312,7 @@ namespace AdblockPlus
private:
void CallTimerTask(const JsWeakValuesID& timerParamsID);
- explicit JsEngine(TimerPtr timer, FileSystemPtr fileSystem, WebRequestPtr webRequest);
+ explicit JsEngine(TimerPtr timer, FileSystemPtr fileSystem, WebRequestPtr webRequest, LogSystemPtr logSystem);
JsValue GetGlobalObject();
« no previous file with comments | « no previous file | include/AdblockPlus/LogSystem.h » ('j') | include/AdblockPlus/LogSystem.h » ('J')

Powered by Google App Engine
This is Rietveld