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

Delta Between Two Patch Sets: include/AdblockPlus/JsValue.h

Issue 29410664: Issue 5013 - Use const JsValue and pass reference where applicable (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Left Patch Set: Remove the SetProperty() changes. Created April 13, 2017, 1:16 p.m.
Right Patch Set: Fixed comment Created April 13, 2017, 3:45 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « include/AdblockPlus/JsEngine.h ('k') | src/ConsoleJsObject.cpp » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 * Invokes the value as a function (see `IsFunction()`) with single 131 * Invokes the value as a function (see `IsFunction()`) with single
132 * parameter. 132 * parameter.
133 * @param arg A single required parameter. 133 * @param arg A single required parameter.
134 * @return Value returned by the function. 134 * @return Value returned by the function.
135 */ 135 */
136 JsValue Call(const JsValue& arg) const; 136 JsValue Call(const JsValue& arg) const;
137 137
138 v8::Local<v8::Value> UnwrapValue() const; 138 v8::Local<v8::Value> UnwrapValue() const;
139 139
140 /** 140 /**
141 * Clone this value wrapper to new one. I still hold the same internal handl e 141 * Creates a new `JsValue` wrapper for the same JavaScript value.
sergei 2017/04/13 13:55:44 What about "Creates a new `JsValue` wrapper for th
hub 2017/04/13 15:46:00 Acknowledged.
142 * @return Value wrapper clone 142 * @return Value new `JsValue`
143 */ 143 */
144 JsValue Clone() const; 144 JsValue Clone() const;
145 protected: 145 protected:
146 JsEnginePtr jsEngine; 146 JsEnginePtr jsEngine;
147 private: 147 private:
148 JsValue(JsEnginePtr jsEngine, v8::Handle<v8::Value> value); 148 JsValue(JsEnginePtr jsEngine, v8::Handle<v8::Value> value);
149 void SetProperty(const std::string& name, v8::Handle<v8::Value> val); 149 void SetProperty(const std::string& name, v8::Handle<v8::Value> val);
150 // Parameter args is not const because a pointer to its internal arrays is 150 // Parameter args is not const because a pointer to its internal arrays is
151 // passed to v8::Function::Call but the latter does not expect a const point er. 151 // passed to v8::Function::Call but the latter does not expect a const point er.
152 JsValue Call(std::vector<v8::Handle<v8::Value>>& args, v8::Local<v8::Object> thisObj) const; 152 JsValue Call(std::vector<v8::Handle<v8::Value>>& args, v8::Local<v8::Object> thisObj) const;
153 153
154 std::unique_ptr<v8::Persistent<v8::Value>> value; 154 std::unique_ptr<v8::Persistent<v8::Value>> value;
155 }; 155 };
156 } 156 }
157 157
158 #endif 158 #endif
LEFTRIGHT

Powered by Google App Engine
This is Rietveld