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

Delta Between Two Patch Sets: src/JsEngine.cpp

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 | « include/AdblockPlus/JsEngine.h ('k') | test/BaseJsTest.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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 isolate->Dispose(); 88 isolate->Dispose();
89 isolate = nullptr; 89 isolate = nullptr;
90 } 90 }
91 91
92 JsEngine::JsWeakValuesList::~JsWeakValuesList() 92 JsEngine::JsWeakValuesList::~JsWeakValuesList()
93 { 93 {
94 for (auto& value : values) 94 for (auto& value : values)
95 value->Dispose(); 95 value->Dispose();
96 } 96 }
97 97
98 void JsEngine::NotifyLowMemory()
99 {
100 const JsContext context(*this);
101 v8::V8::LowMemoryNotification();
102 }
103
98 void JsEngine::ScheduleTimer(const v8::Arguments& arguments) 104 void JsEngine::ScheduleTimer(const v8::Arguments& arguments)
99 { 105 {
100 auto jsEngine = FromArguments(arguments); 106 auto jsEngine = FromArguments(arguments);
101 if (arguments.Length() < 2) 107 if (arguments.Length() < 2)
102 throw std::runtime_error("setTimeout requires at least 2 parameters"); 108 throw std::runtime_error("setTimeout requires at least 2 parameters");
103 109
104 if (!arguments[0]->IsFunction()) 110 if (!arguments[0]->IsFunction())
105 throw std::runtime_error("First argument to setTimeout must be a function"); 111 throw std::runtime_error("First argument to setTimeout must be a function");
106 112
107 auto jsValueArguments = jsEngine->ConvertArguments(arguments); 113 auto jsValueArguments = jsEngine->ConvertArguments(arguments);
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 logSystem = val; 339 logSystem = val;
334 } 340 }
335 341
336 342
337 void AdblockPlus::JsEngine::SetGlobalProperty(const std::string& name, 343 void AdblockPlus::JsEngine::SetGlobalProperty(const std::string& name,
338 const AdblockPlus::JsValue& value) 344 const AdblockPlus::JsValue& value)
339 { 345 {
340 auto global = GetGlobalObject(); 346 auto global = GetGlobalObject();
341 global.SetProperty(name, value); 347 global.SetProperty(name, value);
342 } 348 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld