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

Issue 10252013: Implemented curl support for web requests (Closed)

Created:
April 11, 2013, 3:52 p.m. by Wladimir Palant
Modified:
April 17, 2013, 7:06 a.m.
Reviewers:
Felix Dahlke, Oleksandr
Visibility:
Public.

Description

Implemented curl support for web requests

Patch Set 1 #

Patch Set 2 : Made abpshell use DefaultWebRequest #

Patch Set 3 : Unbitrotted the patch #

Total comments: 8

Patch Set 4 : Addressed review comments #

Total comments: 12
Unified diffs Side-by-side diffs Delta from patch set Stats (+52 lines, -238 lines) Patch
M check_curl.py View 1 2 3 1 chunk +4 lines, -1 line 0 comments Download
M include/AdblockPlus/WebRequest.h View 1 2 3 1 chunk +19 lines, -19 lines 7 comments Download
M libadblockplus.gyp View 1 2 3 1 chunk +10 lines, -2 lines 0 comments Download
M src/DefaultWebRequestCurl.cpp View 1 2 3 4 chunks +16 lines, -33 lines 0 comments Download
M src/DefaultWebRequestDummy.cpp View 1 2 3 1 chunk +0 lines, -180 lines 0 comments Download
M test/WebRequest.cpp View 1 2 3 2 chunks +3 lines, -3 lines 5 comments Download

Messages

Total messages: 14
Wladimir Palant
April 11, 2013, 3:52 p.m. (2013-04-11 15:52:53 UTC) #1
Oleksandr
http://codereview.adblockplus.org/10252013/diff/6001/include/AdblockPlus/WebRequest.h File include/AdblockPlus/WebRequest.h (right): http://codereview.adblockplus.org/10252013/diff/6001/include/AdblockPlus/WebRequest.h#newcode47 include/AdblockPlus/WebRequest.h:47: }; Wouldn't it be better to have this class ...
April 11, 2013, 4:47 p.m. (2013-04-11 16:47:18 UTC) #2
Felix Dahlke
http://codereview.adblockplus.org/10252013/diff/6001/check_curl.py File check_curl.py (right): http://codereview.adblockplus.org/10252013/diff/6001/check_curl.py#newcode8 check_curl.py:8: (fd, name) = tempfile.mkstemp(dir=os.path.join(baseDir, 'build'), suffix='.h') This won't work ...
April 12, 2013, 3:53 a.m. (2013-04-12 03:53:50 UTC) #3
Wladimir Palant
http://codereview.adblockplus.org/10252013/diff/6001/src/WebRequest.cpp File src/WebRequest.cpp (right): http://codereview.adblockplus.org/10252013/diff/6001/src/WebRequest.cpp#newcode77 src/WebRequest.cpp:77: // Parse the status code out of something like ...
April 12, 2013, 1:39 p.m. (2013-04-12 13:39:32 UTC) #4
Felix Dahlke
Sorry, didn't notice the new change set. I'd still like to see DefaultWebRequest in its ...
April 16, 2013, 11:53 a.m. (2013-04-16 11:53:01 UTC) #5
Oleksandr
http://codereview.adblockplus.org/10252013/diff/14001/include/AdblockPlus/WebRequest.h File include/AdblockPlus/WebRequest.h (right): http://codereview.adblockplus.org/10252013/diff/14001/include/AdblockPlus/WebRequest.h#newcode45 include/AdblockPlus/WebRequest.h:45: { I don't quite understand the logic behind this ...
April 16, 2013, 12:02 p.m. (2013-04-16 12:02:01 UTC) #6
Felix Dahlke
http://codereview.adblockplus.org/10252013/diff/14001/include/AdblockPlus/WebRequest.h File include/AdblockPlus/WebRequest.h (right): http://codereview.adblockplus.org/10252013/diff/14001/include/AdblockPlus/WebRequest.h#newcode40 include/AdblockPlus/WebRequest.h:40: virtual inline ~WebRequest() {}; Oh, just noticed, inline is ...
April 16, 2013, 12:21 p.m. (2013-04-16 12:21:09 UTC) #7
Oleksandr
http://codereview.adblockplus.org/10252013/diff/14001/include/AdblockPlus/WebRequest.h File include/AdblockPlus/WebRequest.h (right): http://codereview.adblockplus.org/10252013/diff/14001/include/AdblockPlus/WebRequest.h#newcode45 include/AdblockPlus/WebRequest.h:45: { Let me rephrase my question: why do all ...
April 16, 2013, 12:26 p.m. (2013-04-16 12:26:18 UTC) #8
Felix Dahlke
On 2013/04/16 12:26:18, Oleksandr wrote: > http://codereview.adblockplus.org/10252013/diff/14001/include/AdblockPlus/WebRequest.h > File include/AdblockPlus/WebRequest.h (right): > > http://codereview.adblockplus.org/10252013/diff/14001/include/AdblockPlus/WebRequest.h#newcode45 > ...
April 16, 2013, 12:31 p.m. (2013-04-16 12:31:19 UTC) #9
Wladimir Palant
http://codereview.adblockplus.org/10252013/diff/14001/include/AdblockPlus/WebRequest.h File include/AdblockPlus/WebRequest.h (right): http://codereview.adblockplus.org/10252013/diff/14001/include/AdblockPlus/WebRequest.h#newcode40 include/AdblockPlus/WebRequest.h:40: virtual inline ~WebRequest() {}; On 2013/04/16 12:21:09, Felix H. ...
April 16, 2013, 1:30 p.m. (2013-04-16 13:30:32 UTC) #10
Felix Dahlke
http://codereview.adblockplus.org/10252013/diff/14001/include/AdblockPlus/WebRequest.h File include/AdblockPlus/WebRequest.h (right): http://codereview.adblockplus.org/10252013/diff/14001/include/AdblockPlus/WebRequest.h#newcode40 include/AdblockPlus/WebRequest.h:40: virtual inline ~WebRequest() {}; On 2013/04/16 13:30:32, Wladimir Palant ...
April 16, 2013, 2:51 p.m. (2013-04-16 14:51:37 UTC) #11
Oleksandr
LGTM
April 16, 2013, 2:59 p.m. (2013-04-16 14:59:07 UTC) #12
Wladimir Palant
http://codereview.adblockplus.org/10252013/diff/14001/test/WebRequest.cpp File test/WebRequest.cpp (right): http://codereview.adblockplus.org/10252013/diff/14001/test/WebRequest.cpp#newcode70 test/WebRequest.cpp:70: ASSERT_EQ("text/plain", jsEngine.Evaluate("foo.responseHeaders['content-type'].substr(0, 10)")); On 2013/04/16 14:51:37, Felix H. Dahlke ...
April 17, 2013, 6:56 a.m. (2013-04-17 06:56:20 UTC) #13
Felix Dahlke
April 17, 2013, 7:06 a.m. (2013-04-17 07:06:15 UTC) #14
On 2013/04/17 06:56:20, Wladimir Palant wrote:
> http://codereview.adblockplus.org/10252013/diff/14001/test/WebRequest.cpp
> File test/WebRequest.cpp (right):
> 
>
http://codereview.adblockplus.org/10252013/diff/14001/test/WebRequest.cpp#new...
> test/WebRequest.cpp:70: ASSERT_EQ("text/plain",
> jsEngine.Evaluate("foo.responseHeaders['content-type'].substr(0, 10)"));
> On 2013/04/16 14:51:37, Felix H. Dahlke wrote:
> > It only lower cases the header name in the argument though. I think it's
> > easiest/safest if we just lower case them in XMLHttpRequest or
> > WebRequestJsObject, then it won't matter what the implementation does.
> 
> I don't quite get this suggestion, WebRequestJsObject works with plain JS
> objects for headers - it cannot impose any semantics on them (and it's an
> internal implementation detail anyway, real code should always use
> XMLHttpRequest). XMLHttpRequest on the other hand can ensure that headers are
> treated in a case-insensitive way (per spec).

I'm just saying that we might want to make sure the headers are lower case,
either in WebRequestJsObject or our XMLHttpRequest implementation.

It would result in very subtle errors if an implementation of WebRequest does
not make sure that all header names are lower case. Then again, it's not really
our problem, as long as we specify that they have to be lower case.

LGTM anyway

Powered by Google App Engine
This is Rietveld