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

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

Issue 29442722: Issue 3593 - stop sharing v8::Isolate among tests (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Left Patch Set: address comments Created May 22, 2017, 8:06 a.m.
Right Patch Set: address comments Created May 26, 2017, 10:54 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 void SetGlobalProperty(const std::string& name, const AdblockPlus::JsValue& value); 300 void SetGlobalProperty(const std::string& name, const AdblockPlus::JsValue& value);
301 301
302 /** 302 /**
303 * Returns a pointer to associated v8::Isolate. 303 * Returns a pointer to associated v8::Isolate.
304 */ 304 */
305 v8::Isolate* GetIsolate() 305 v8::Isolate* GetIsolate()
306 { 306 {
307 return isolate.Get(); 307 return isolate.Get();
308 } 308 }
309 309
310 /**
311 * Notifies JS engine about critically low memory what should cause a
312 * garbage collection.
313 */
314 void NotifyLowMemory();
310 private: 315 private:
311 void CallTimerTask(const JsWeakValuesID& timerParamsID); 316 void CallTimerTask(const JsWeakValuesID& timerParamsID);
312 317
313 explicit JsEngine(TimerPtr timer, WebRequestPtr webRequest); 318 explicit JsEngine(TimerPtr timer, WebRequestPtr webRequest);
314 319
315 JsValue GetGlobalObject(); 320 JsValue GetGlobalObject();
316 321
317 /// Isolate must be disposed only after disposing of all objects which are 322 /// Isolate must be disposed only after disposing of all objects which are
318 /// using it. 323 /// using it.
319 ScopedV8Isolate isolate; 324 ScopedV8Isolate isolate;
320 325
321 FileSystemPtr fileSystem; 326 FileSystemPtr fileSystem;
322 LogSystemPtr logSystem; 327 LogSystemPtr logSystem;
323 std::unique_ptr<v8::Persistent<v8::Context>> context; 328 std::unique_ptr<v8::Persistent<v8::Context>> context;
324 EventMap eventCallbacks; 329 EventMap eventCallbacks;
325 std::mutex eventCallbacksMutex; 330 std::mutex eventCallbacksMutex;
326 JsWeakValuesLists jsWeakValuesLists; 331 JsWeakValuesLists jsWeakValuesLists;
327 std::mutex jsWeakValuesListsMutex; 332 std::mutex jsWeakValuesListsMutex;
328 TimerPtr timer; 333 TimerPtr timer;
329 WebRequestPtr webRequest; 334 WebRequestPtr webRequest;
330 WebRequestSharedPtr webRequestLegacy; 335 WebRequestSharedPtr webRequestLegacy;
331 }; 336 };
332 } 337 }
333 338
334 #endif 339 #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