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

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

Issue 29424659: Noissue - generalize storing of `JsValue`s in `JsEngine` (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Left Patch Set: Created April 28, 2017, 10:27 a.m.
Right Patch Set: add empty line Created April 28, 2017, 10:49 a.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 | « no previous file | src/JsEngine.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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 * Stores `JsValue`s in a way they don't keep a strong reference to 224 * Stores `JsValue`s in a way they don't keep a strong reference to
225 * `JsEngine` and which are destroyed when `JsEngine` is destroyed. These 225 * `JsEngine` and which are destroyed when `JsEngine` is destroyed. These
226 * methods should be used when one needs to carry a JsValue in a callback 226 * methods should be used when one needs to carry a JsValue in a callback
227 * directly or indirectly passed to `JsEngine`. 227 * directly or indirectly passed to `JsEngine`.
228 * The method is thread-safe. 228 * The method is thread-safe.
229 * @param `JsValueList` to store. 229 * @param `JsValueList` to store.
230 * @return `JsWeakValuesID` of stored values which allows to restore them 230 * @return `JsWeakValuesID` of stored values which allows to restore them
231 * later. 231 * later.
232 */ 232 */
233 JsWeakValuesID StoreJsValues(const JsValueList& values); 233 JsWeakValuesID StoreJsValues(const JsValueList& values);
234
234 /** 235 /**
235 * Extracts and removes from `JsEngine` earlier stored `JsValue`s. 236 * Extracts and removes from `JsEngine` earlier stored `JsValue`s.
236 * The method is thread-safe. 237 * The method is thread-safe.
237 * @param id `JsWeakValuesID` of values. 238 * @param id `JsWeakValuesID` of values.
238 * @return `JsValueList` of stored values. 239 * @return `JsValueList` of stored values.
239 */ 240 */
240 JsValueList TakeJsValues(const JsWeakValuesID& id); 241 JsValueList TakeJsValues(const JsWeakValuesID& id);
241 242
242 /* 243 /*
243 * Private functionality required to implement timers. 244 * Private functionality required to implement timers.
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 std::mutex eventCallbacksMutex; 342 std::mutex eventCallbacksMutex;
342 mutable std::mutex isConnectionAllowedMutex; 343 mutable std::mutex isConnectionAllowedMutex;
343 IsConnectionAllowedCallback isConnectionAllowed; 344 IsConnectionAllowedCallback isConnectionAllowed;
344 JsWeakValuesLists jsWeakValuesLists; 345 JsWeakValuesLists jsWeakValuesLists;
345 std::mutex jsWeakValuesListsMutex; 346 std::mutex jsWeakValuesListsMutex;
346 TimerPtr timer; 347 TimerPtr timer;
347 }; 348 };
348 } 349 }
349 350
350 #endif 351 #endif
LEFTRIGHT
« no previous file | src/JsEngine.cpp » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld