| 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-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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 for (int i = 0; i < arguments.Length(); i++) | 324 for (int i = 0; i < arguments.Length(); i++) |
| 325 list.push_back(JsValue(shared_from_this(), arguments[i])); | 325 list.push_back(JsValue(shared_from_this(), arguments[i])); |
| 326 return list; | 326 return list; |
| 327 } | 327 } |
| 328 | 328 |
| 329 AdblockPlus::FileSystemPtr AdblockPlus::JsEngine::GetAsyncFileSystem() const | 329 AdblockPlus::FileSystemPtr AdblockPlus::JsEngine::GetAsyncFileSystem() const |
| 330 { | 330 { |
| 331 return fileSystem; | 331 return fileSystem; |
| 332 } | 332 } |
| 333 | 333 |
| 334 void AdblockPlus::JsEngine::SetFileSystem(const AdblockPlus::FileSystemSyncPtr&
val) | |
| 335 { | |
| 336 if (!val) | |
| 337 throw std::runtime_error("FileSystem cannot be null"); | |
| 338 | |
| 339 fileSystem.reset(new DefaultFileSystem(val)); | |
| 340 } | |
| 341 | |
| 342 AdblockPlus::LogSystem& AdblockPlus::JsEngine::GetLogSystem() | 334 AdblockPlus::LogSystem& AdblockPlus::JsEngine::GetLogSystem() |
| 343 { | 335 { |
| 344 return *logSystem; | 336 return *logSystem; |
| 345 } | 337 } |
| 346 | 338 |
| 347 void AdblockPlus::JsEngine::SetGlobalProperty(const std::string& name, | 339 void AdblockPlus::JsEngine::SetGlobalProperty(const std::string& name, |
| 348 const AdblockPlus::JsValue& value) | 340 const AdblockPlus::JsValue& value) |
| 349 { | 341 { |
| 350 auto global = GetGlobalObject(); | 342 auto global = GetGlobalObject(); |
| 351 global.SetProperty(name, value); | 343 global.SetProperty(name, value); |
| 352 } | 344 } |
| OLD | NEW |