| 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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 if (converted.size() != 3u) | 97 if (converted.size() != 3u) |
| 98 throw std::runtime_error("GET requires exactly 3 arguments"); | 98 throw std::runtime_error("GET requires exactly 3 arguments"); |
| 99 thread = std::make_shared<WebRequestTask>(jsEngine, converted); | 99 thread = std::make_shared<WebRequestTask>(jsEngine, converted); |
| 100 } | 100 } |
| 101 catch (const std::exception& e) | 101 catch (const std::exception& e) |
| 102 { | 102 { |
| 103 using AdblockPlus::Utils::ToV8String; | 103 using AdblockPlus::Utils::ToV8String; |
| 104 v8::Isolate* isolate = arguments.GetIsolate(); | 104 v8::Isolate* isolate = arguments.GetIsolate(); |
| 105 return v8::ThrowException(ToV8String(isolate, e.what())); | 105 return v8::ThrowException(ToV8String(isolate, e.what())); |
| 106 } | 106 } |
| 107 AdblockPlus::Scheduler::StartImmediatelyInSingleUseThread(AdblockPlus::MakeH
eapFunction(thread)); | 107 StartImmediatelyInSingleUseDetachedThread(AdblockPlus::MakeHeapFunction(thre
ad)); |
| 108 return v8::Undefined(); | 108 return v8::Undefined(); |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 | 111 |
| 112 AdblockPlus::JsValuePtr AdblockPlus::WebRequestJsObject::Setup( | 112 AdblockPlus::JsValuePtr AdblockPlus::WebRequestJsObject::Setup( |
| 113 AdblockPlus::JsEnginePtr jsEngine, AdblockPlus::JsValuePtr obj) | 113 AdblockPlus::JsEnginePtr jsEngine, AdblockPlus::JsValuePtr obj) |
| 114 { | 114 { |
| 115 obj->SetProperty("GET", jsEngine->NewCallback(::GETCallback)); | 115 obj->SetProperty("GET", jsEngine->NewCallback(::GETCallback)); |
| 116 return obj; | 116 return obj; |
| 117 } | 117 } |
| OLD | NEW |