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

Unified Diff: src/WebRequestJsObject.cpp

Issue 10727002: Get rid of dependencies on v8.h in public header files (Closed)
Patch Set: Created May 23, 2013, 2:43 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/JsValue.cpp ('k') | test/JsEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/WebRequestJsObject.cpp
===================================================================
--- a/src/WebRequestJsObject.cpp
+++ b/src/WebRequestJsObject.cpp
@@ -13,18 +13,20 @@
*
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
#include <map>
#include <AdblockPlus/JsValue.h>
#include <AdblockPlus/WebRequest.h>
+
+#include "JsContext.h"
+#include "Thread.h"
#include "WebRequestJsObject.h"
-#include "Thread.h"
namespace
{
class WebRequestThread : public AdblockPlus::Thread
{
public:
WebRequestThread(AdblockPlus::JsEnginePtr jsEngine, AdblockPlus::JsValueList& arguments)
: jsEngine(jsEngine), url(arguments[0]->AsString())
@@ -52,17 +54,17 @@ namespace
if (!callback->IsFunction())
throw std::runtime_error("Third argument to GET must be a function");
}
void Run()
{
AdblockPlus::ServerResponse result = jsEngine->GetWebRequest()->GET(url, headers);
- AdblockPlus::JsEngine::Context context(jsEngine);
+ AdblockPlus::JsContext context(jsEngine);
AdblockPlus::JsValuePtr resultObject = jsEngine->NewObject();
resultObject->SetProperty("status", result.status);
resultObject->SetProperty("responseStatus", result.responseStatus);
resultObject->SetProperty("responseText", result.responseText);
AdblockPlus::JsValuePtr headersObject = jsEngine->NewObject();
for (AdblockPlus::HeaderList::iterator it = result.responseHeaders.begin();
« no previous file with comments | « src/JsValue.cpp ('k') | test/JsEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld