| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2013 Eyeo GmbH | 3 * Copyright (C) 2006-2013 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 } | 181 } |
| 182 | 182 |
| 183 void AdblockPlus::JsEngine::SetWebRequest(AdblockPlus::WebRequestPtr val) | 183 void AdblockPlus::JsEngine::SetWebRequest(AdblockPlus::WebRequestPtr val) |
| 184 { | 184 { |
| 185 if (!val) | 185 if (!val) |
| 186 throw std::runtime_error("WebRequest cannot be null"); | 186 throw std::runtime_error("WebRequest cannot be null"); |
| 187 | 187 |
| 188 webRequest = val; | 188 webRequest = val; |
| 189 } | 189 } |
| 190 | 190 |
| 191 AdblockPlus::ErrorCallbackPtr AdblockPlus::JsEngine::GetErrorCallback() | 191 AdblockPlus::LogSystemPtr AdblockPlus::JsEngine::GetLogSystem() |
| 192 { | 192 { |
| 193 if (!errorCallback) | 193 if (!logSystem) |
| 194 errorCallback.reset(new DefaultErrorCallback()); | 194 logSystem.reset(new DefaultLogSystem()); |
| 195 return errorCallback; | 195 return logSystem; |
| 196 } | 196 } |
| 197 | 197 |
| 198 void AdblockPlus::JsEngine::SetErrorCallback(AdblockPlus::ErrorCallbackPtr val) | 198 void AdblockPlus::JsEngine::SetLogSystem(AdblockPlus::LogSystemPtr val) |
| 199 { | 199 { |
| 200 if (!val) | 200 if (!val) |
| 201 throw std::runtime_error("ErrorCallback cannot be null"); | 201 throw std::runtime_error("LogSystem cannot be null"); |
| 202 | 202 |
| 203 errorCallback = val; | 203 logSystem = val; |
| 204 } | 204 } |
| 205 | 205 |
| 206 AdblockPlus::JsEngine::Context::Context(const JsEnginePtr jsEngine) | 206 AdblockPlus::JsEngine::Context::Context(const JsEnginePtr jsEngine) |
| 207 : locker(jsEngine->isolate), handleScope(), | 207 : locker(jsEngine->isolate), handleScope(), |
| 208 contextScope(jsEngine->context) | 208 contextScope(jsEngine->context) |
| 209 { | 209 { |
| 210 } | 210 } |
| OLD | NEW |