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

Unified Diff: src/WebRequestJsObject.cpp

Issue 29409580: Issue 5013 - Make parameter const ref when applicable. (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: the input stream is no longer const. Created April 12, 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 | « src/WebRequestJsObject.h ('k') | test/BaseJsTest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/WebRequestJsObject.cpp
===================================================================
--- a/src/WebRequestJsObject.cpp
+++ b/src/WebRequestJsObject.cpp
@@ -24,17 +24,17 @@
#include "Utils.h"
#include "WebRequestJsObject.h"
namespace
{
class WebRequestThread : public AdblockPlus::Thread
{
public:
- WebRequestThread(AdblockPlus::JsEnginePtr jsEngine, AdblockPlus::JsValueList& arguments)
+ WebRequestThread(const AdblockPlus::JsEnginePtr& jsEngine, const AdblockPlus::JsValueList& arguments)
: Thread(true), jsEngine(jsEngine), url(arguments[0]->AsString())
{
if (!url.length())
throw std::runtime_error("Invalid string passed as first argument to GET");
{
AdblockPlus::JsValuePtr headersObj = arguments[1];
if (!headersObj->IsObject())
@@ -111,13 +111,13 @@
return v8::ThrowException(ToV8String(isolate, e.what()));
}
thread->Start();
return v8::Undefined();
}
}
AdblockPlus::JsValuePtr AdblockPlus::WebRequestJsObject::Setup(
- AdblockPlus::JsEnginePtr jsEngine, AdblockPlus::JsValuePtr obj)
+ AdblockPlus::JsEngine& jsEngine, const AdblockPlus::JsValuePtr& obj)
{
- obj->SetProperty("GET", jsEngine->NewCallback(::GETCallback));
+ obj->SetProperty("GET", jsEngine.NewCallback(::GETCallback));
return obj;
}
« no previous file with comments | « src/WebRequestJsObject.h ('k') | test/BaseJsTest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld