Index: src/JsEngine.cpp |
=================================================================== |
--- a/src/JsEngine.cpp |
+++ b/src/JsEngine.cpp |
@@ -181,17 +181,17 @@ |
} |
void AdblockPlus::JsEngine::RemoveEventCallback(const std::string& eventName) |
{ |
std::lock_guard<std::mutex> lock(eventCallbacksMutex); |
eventCallbacks.erase(eventName); |
} |
-void AdblockPlus::JsEngine::TriggerEvent(const std::string& eventName, const AdblockPlus::JsValueList& params) |
+void AdblockPlus::JsEngine::TriggerEvent(const std::string& eventName, const AdblockPlus::JsConstValueList& params) |
{ |
EventCallback callback; |
{ |
std::lock_guard<std::mutex> lock(eventCallbacksMutex); |
auto it = eventCallbacks.find(eventName); |
if (it == eventCallbacks.end()) |
return; |
callback = it->second; |
@@ -251,20 +251,20 @@ |
std::weak_ptr<JsEngine>* data = |
static_cast<std::weak_ptr<JsEngine>*>(external->Value()); |
JsEnginePtr result = data->lock(); |
if (!result) |
throw std::runtime_error("Oops, our JsEngine is gone, how did that happen?"); |
return result; |
} |
-AdblockPlus::JsValueList AdblockPlus::JsEngine::ConvertArguments(const v8::Arguments& arguments) |
+AdblockPlus::JsConstValueList AdblockPlus::JsEngine::ConvertArguments(const v8::Arguments& arguments) |
{ |
const JsContext context(shared_from_this()); |
- JsValueList list; |
+ JsConstValueList list; |
for (int i = 0; i < arguments.Length(); i++) |
list.push_back(JsValuePtr(new JsValue(shared_from_this(), arguments[i]))); |
return list; |
} |
AdblockPlus::FileSystemPtr AdblockPlus::JsEngine::GetFileSystem() const |
{ |
return fileSystem; |
@@ -321,15 +321,15 @@ |
if (!val) |
throw std::runtime_error("LogSystem cannot be null"); |
logSystem = val; |
} |
void AdblockPlus::JsEngine::SetGlobalProperty(const std::string& name, |
- const AdblockPlus::JsValuePtr& value) |
+ const AdblockPlus::JsValue& value) |
{ |
auto global = GetGlobalObject(); |
if (!global) |
throw std::runtime_error("Global object cannot be null"); |
global->SetProperty(name, value); |
} |