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

Unified Diff: include/AdblockPlus/JsEngine.h

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
« no previous file with comments | « include/AdblockPlus/FilterEngine.h ('k') | src/FilterEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/JsEngine.h
===================================================================
--- a/include/AdblockPlus/JsEngine.h
+++ b/include/AdblockPlus/JsEngine.h
@@ -60,17 +60,17 @@
* Scope based isolate manager. Creates a new isolate instance on
* constructing and disposes it on destructing.
*/
class ScopedV8Isolate
{
public:
ScopedV8Isolate();
~ScopedV8Isolate();
- v8::Isolate* Get()
+ v8::Isolate* Get() const
sergei 2017/04/11 10:36:50 I would like to not make this one and one below co
hub 2017/04/11 11:32:35 same for JsEngine::GetIsolate() then?
{
return isolate;
}
private:
ScopedV8Isolate(const ScopedV8Isolate&);
ScopedV8Isolate& operator=(const ScopedV8Isolate&);
v8::Isolate* isolate;
@@ -217,30 +217,30 @@
* convert.
* @return List of arguments converted to `JsValue` objects.
*/
JsValueList ConvertArguments(const v8::Arguments& arguments);
/**
* @see `SetFileSystem()`.
*/
- FileSystemPtr GetFileSystem();
+ FileSystemPtr GetFileSystem() const;
/**
* Sets the `FileSystem` implementation used for all file I/O.
* Setting this is optional, the engine will use a `DefaultFileSystem`
* instance by default, which might be sufficient.
* @param The `FileSystem` instance to use.
*/
void SetFileSystem(FileSystemPtr val);
/**
* @see `SetWebRequest()`.
*/
- WebRequestPtr GetWebRequest();
+ WebRequestPtr GetWebRequest() const;
/**
* Sets the `WebRequest` implementation used for XMLHttpRequests.
* Setting this is optional, the engine will use a `DefaultWebRequest`
* instance by default, which might be sufficient.
* @param The `WebRequest` instance to use.
*/
void SetWebRequest(WebRequestPtr val);
@@ -251,22 +251,22 @@
* @param callback callback function.
*/
void SetIsConnectionAllowedCallback(const IsConnectionAllowedCallback& callback);
/**
* Checks whether current connection is allowed. If
* IsConnectionAllowedCallback is not set then then it returns true.
*/
- bool IsConnectionAllowed();
+ bool IsConnectionAllowed() const;
/**
* @see `SetLogSystem()`.
*/
- LogSystemPtr GetLogSystem();
+ 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.
*/
@@ -277,17 +277,17 @@
* @param name Name of the property to set.
* @param value Value of the property to set.
*/
void SetGlobalProperty(const std::string& name, AdblockPlus::JsValuePtr value);
/**
* Returns a pointer to associated v8::Isolate.
*/
- v8::Isolate* GetIsolate()
+ v8::Isolate* GetIsolate() const
{
return isolate->Get();
}
private:
struct TimerTask
{
~TimerTask();
@@ -305,16 +305,16 @@
ScopedV8IsolatePtr isolate;
FileSystemPtr fileSystem;
WebRequestPtr webRequest;
LogSystemPtr logSystem;
std::unique_ptr<v8::Persistent<v8::Context>> context;
EventMap eventCallbacks;
std::mutex eventCallbacksMutex;
- std::mutex isConnectionAllowedMutex;
+ mutable std::mutex isConnectionAllowedMutex;
IsConnectionAllowedCallback isConnectionAllowed;
TimerTasks timerTasks;
TimerPtr timer;
};
}
#endif
« no previous file with comments | « include/AdblockPlus/FilterEngine.h ('k') | src/FilterEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld