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

Unified Diff: src/WebRequestJsObject.cpp

Issue 10252013: Implemented curl support for web requests (Closed)
Patch Set: Made abpshell use DefaultWebRequest Created April 11, 2013, 3:55 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/WebRequest.cpp ('k') | test/WebRequest.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
@@ -71,16 +71,17 @@ namespace
void Run()
{
AdblockPlus::ServerResponse result = webRequest->GET(url, headers);
const v8::Locker locker(isolate);
const v8::HandleScope handleScope;
const v8::Context::Scope contextScope(context);
v8::Local<v8::Object> resultObject = v8::Object::New();
+ resultObject->Set(v8::String::New("status"), v8::Number::New(result.status));
resultObject->Set(v8::String::New("responseStatus"), v8::Integer::New(result.responseStatus));
resultObject->Set(v8::String::New("responseText"), toV8String(result.responseText));
v8::Local<v8::Object> headersObject = v8::Object::New();
for (AdblockPlus::HeadersList::iterator it = result.responseHeaders.begin();
it != result.responseHeaders.end(); ++it)
{
headersObject->Set(toV8String(it->first), toV8String(it->second));
« no previous file with comments | « src/WebRequest.cpp ('k') | test/WebRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld