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

Side by Side Diff: src/JsEngine.cpp

Issue 29498586: Issue 4832 - remove API allowing changing of FileSystem after Initialization of JsEngine (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created July 26, 2017, 2:46 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/AdblockPlus/JsEngine.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « include/AdblockPlus/JsEngine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld