Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 | 79 |
80 AdblockPlus::ScopedV8Isolate::ScopedV8Isolate() | 80 AdblockPlus::ScopedV8Isolate::ScopedV8Isolate() |
81 { | 81 { |
82 V8Initializer::Init(); | 82 V8Initializer::Init(); |
83 isolate = v8::Isolate::New(); | 83 isolate = v8::Isolate::New(); |
84 } | 84 } |
85 | 85 |
86 AdblockPlus::ScopedV8Isolate::~ScopedV8Isolate() | 86 AdblockPlus::ScopedV8Isolate::~ScopedV8Isolate() |
87 { | 87 { |
88 auto capturedIsolatePtr = isolate; | 88 auto capturedIsolatePtr = isolate; |
89 std::thread([capturedIsolatePtr]{ | 89 std::thread([capturedIsolatePtr] |
anton
2018/02/07 14:43:12
shouldn't `{`it be on the next line?
sergei
2018/02/07 14:54:20
Done.
| |
90 { | |
90 std::chrono::seconds timeout(60 * 10); | 91 std::chrono::seconds timeout(60 * 10); |
91 std::this_thread::sleep_for(timeout); | 92 std::this_thread::sleep_for(timeout); |
92 capturedIsolatePtr->Dispose(); | 93 capturedIsolatePtr->Dispose(); |
93 }).detach(); | 94 }).detach(); |
94 isolate = nullptr; | 95 isolate = nullptr; |
95 } | 96 } |
96 | 97 |
97 JsEngine::JsWeakValuesList::~JsWeakValuesList() | 98 JsEngine::JsWeakValuesList::~JsWeakValuesList() |
98 { | 99 { |
99 for (auto& value : values) | 100 for (auto& value : values) |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
344 logSystem = val; | 345 logSystem = val; |
345 } | 346 } |
346 | 347 |
347 | 348 |
348 void AdblockPlus::JsEngine::SetGlobalProperty(const std::string& name, | 349 void AdblockPlus::JsEngine::SetGlobalProperty(const std::string& name, |
349 const AdblockPlus::JsValue& value) | 350 const AdblockPlus::JsValue& value) |
350 { | 351 { |
351 auto global = GetGlobalObject(); | 352 auto global = GetGlobalObject(); |
352 global.SetProperty(name, value); | 353 global.SetProperty(name, value); |
353 } | 354 } |
LEFT | RIGHT |