| OLD | NEW |
| 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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 } | 55 } |
| 56 | 56 |
| 57 void Platform::SetUpJsEngine(const AppInfo& appInfo, std::unique_ptr<IV8IsolateP
rovider> isolate) | 57 void Platform::SetUpJsEngine(const AppInfo& appInfo, std::unique_ptr<IV8IsolateP
rovider> isolate) |
| 58 { | 58 { |
| 59 std::lock_guard<std::mutex> lock(modulesMutex); | 59 std::lock_guard<std::mutex> lock(modulesMutex); |
| 60 if (jsEngine) | 60 if (jsEngine) |
| 61 return; | 61 return; |
| 62 jsEngine = JsEngine::New(appInfo, *this, std::move(isolate)); | 62 jsEngine = JsEngine::New(appInfo, *this, std::move(isolate)); |
| 63 } | 63 } |
| 64 | 64 |
| 65 JsEngine& Platform::GetJsEngine() | 65 JsEngineTemplate<JsEngineNamespaceImpl>& Platform::GetJsEngine() |
| 66 { | 66 { |
| 67 SetUpJsEngine(); | 67 SetUpJsEngine(); |
| 68 return *jsEngine; | 68 return *jsEngine; |
| 69 } | 69 } |
| 70 | 70 |
| 71 void Platform::CreateFilterEngineAsync(const FilterEngine::CreationParameters& p
arameters, | 71 void Platform::CreateFilterEngineAsync(const FilterEngine::CreationParameters& p
arameters, |
| 72 const OnFilterEngineCreatedCallback& onCreated) | 72 const OnFilterEngineCreatedCallback& onCreated) |
| 73 { | 73 { |
| 74 std::shared_ptr<std::promise<FilterEnginePtr>> filterEnginePromise; | 74 std::shared_ptr<std::promise<FilterEnginePtr>> filterEnginePromise; |
| 75 { | 75 { |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 CreateDefaultTimer(); | 229 CreateDefaultTimer(); |
| 230 if (!fileSystem) | 230 if (!fileSystem) |
| 231 CreateDefaultFileSystem(); | 231 CreateDefaultFileSystem(); |
| 232 if (!webRequest) | 232 if (!webRequest) |
| 233 CreateDefaultWebRequest(); | 233 CreateDefaultWebRequest(); |
| 234 | 234 |
| 235 std::unique_ptr<Platform> platform(new DefaultPlatform(asyncExecutor, std::mov
e(*this))); | 235 std::unique_ptr<Platform> platform(new DefaultPlatform(asyncExecutor, std::mov
e(*this))); |
| 236 asyncExecutor.reset(); | 236 asyncExecutor.reset(); |
| 237 return platform; | 237 return platform; |
| 238 } | 238 } |
| OLD | NEW |