| 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 19 matching lines...) Expand all  Loading... | 
| 30     std::string prefsContents; | 30     std::string prefsContents; | 
| 31 | 31 | 
| 32     std::shared_ptr<std::istream> Read(const std::string& path) const | 32     std::shared_ptr<std::istream> Read(const std::string& path) const | 
| 33     { | 33     { | 
| 34       if (path == "prefs.json" && !prefsContents.empty()) | 34       if (path == "prefs.json" && !prefsContents.empty()) | 
| 35         return std::shared_ptr<std::istream>(new std::istringstream(prefsContent
     s)); | 35         return std::shared_ptr<std::istream>(new std::istringstream(prefsContent
     s)); | 
| 36 | 36 | 
| 37       return LazyFileSystem::Read(path); | 37       return LazyFileSystem::Read(path); | 
| 38     } | 38     } | 
| 39 | 39 | 
| 40     void Write(const std::string& path, std::shared_ptr<std::istream> content) | 40     void Write(const std::string& path, std::istream& content) | 
| 41     { | 41     { | 
| 42       if (path == "prefs.json") | 42       if (path == "prefs.json") | 
| 43       { | 43       { | 
| 44         std::stringstream ss; | 44         std::stringstream ss; | 
| 45         ss << content->rdbuf(); | 45         ss << content.rdbuf(); | 
| 46         prefsContents = ss.str(); | 46         prefsContents = ss.str(); | 
| 47       } | 47       } | 
| 48       else | 48       else | 
| 49         LazyFileSystem::Write(path, content); | 49         LazyFileSystem::Write(path, content); | 
| 50     } | 50     } | 
| 51 | 51 | 
| 52     StatResult Stat(const std::string& path) const | 52     StatResult Stat(const std::string& path) const | 
| 53     { | 53     { | 
| 54       if (path == "prefs.json") | 54       if (path == "prefs.json") | 
| 55       { | 55       { | 
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 207 | 207 | 
| 208   { | 208   { | 
| 209     ResetJsEngine(); | 209     ResetJsEngine(); | 
| 210     AdblockPlus::FilterEngine::Prefs preconfiguredPrefs; | 210     AdblockPlus::FilterEngine::Prefs preconfiguredPrefs; | 
| 211     preconfiguredPrefs["suppress_first_run_page"] = jsEngine->NewValue(true); | 211     preconfiguredPrefs["suppress_first_run_page"] = jsEngine->NewValue(true); | 
| 212     auto filterEngine = CreateFilterEngine(preconfiguredPrefs); | 212     auto filterEngine = CreateFilterEngine(preconfiguredPrefs); | 
| 213 | 213 | 
| 214     ASSERT_TRUE(filterEngine->GetPref("suppress_first_run_page")->IsBool()); | 214     ASSERT_TRUE(filterEngine->GetPref("suppress_first_run_page")->IsBool()); | 
| 215     ASSERT_FALSE(filterEngine->GetPref("suppress_first_run_page")->AsBool()); | 215     ASSERT_FALSE(filterEngine->GetPref("suppress_first_run_page")->AsBool()); | 
| 216   } | 216   } | 
| 217 } | 217 } | 
| OLD | NEW | 
|---|