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

Issue 10085006: Implement setTimeout (Closed)

Created:
April 5, 2013, 3:49 p.m. by Felix Dahlke
Modified:
April 8, 2013, 3:10 p.m.
Reviewers:
Wladimir Palant
CC:
Oleksandr
Visibility:
Public.

Description

Not using an event loop, but a separate thread for the timeout instead, as discussed.

Patch Set 1 #

Total comments: 13

Patch Set 2 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+141 lines, -4 lines) Patch
M include/AdblockPlus/JsEngine.h View 1 2 chunks +4 lines, -3 lines 0 comments Download
M lib/compat.js View 1 chunk +0 lines, -1 line 0 comments Download
M libadblockplus.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M src/GlobalJsObject.cpp View 1 2 chunks +83 lines, -0 lines 2 comments Download
M src/JsEngine.cpp View 1 1 chunk +13 lines, -0 lines 0 comments Download
A test/GlobalJsObject.cpp View 1 1 chunk +40 lines, -0 lines 0 comments Download

Messages

Total messages: 5
Felix Dahlke
April 5, 2013, 3:51 p.m. (2013-04-05 15:51:24 UTC) #1
Wladimir Palant
http://codereview.adblockplus.org/10085006/diff/1/src/GlobalJsObject.cpp File src/GlobalJsObject.cpp (right): http://codereview.adblockplus.org/10085006/diff/1/src/GlobalJsObject.cpp#newcode17 src/GlobalJsObject.cpp:17: isolate, v8::Local<v8::Function>::Cast(arguments[0])); What will this produce if the first ...
April 8, 2013, 8:36 a.m. (2013-04-08 08:36:00 UTC) #2
Felix Dahlke
Uploaded a new patch set addressing all issues. http://codereview.adblockplus.org/10085006/diff/1/src/GlobalJsObject.cpp File src/GlobalJsObject.cpp (right): http://codereview.adblockplus.org/10085006/diff/1/src/GlobalJsObject.cpp#newcode17 src/GlobalJsObject.cpp:17: isolate, ...
April 8, 2013, 1:07 p.m. (2013-04-08 13:07:48 UTC) #3
Wladimir Palant
LGTM, feel free to address the nits however. http://codereview.adblockplus.org/10085006/diff/1/src/GlobalJsObject.cpp File src/GlobalJsObject.cpp (right): http://codereview.adblockplus.org/10085006/diff/1/src/GlobalJsObject.cpp#newcode40 src/GlobalJsObject.cpp:40: delete ...
April 8, 2013, 2:03 p.m. (2013-04-08 14:03:47 UTC) #4
Felix Dahlke
April 8, 2013, 3:10 p.m. (2013-04-08 15:10:15 UTC) #5
On 2013/04/08 14:03:47, Wladimir Palant wrote:
> LGTM, feel free to address the nits however.
> 
> http://codereview.adblockplus.org/10085006/diff/1/src/GlobalJsObject.cpp
> File src/GlobalJsObject.cpp (right):
> 
>
http://codereview.adblockplus.org/10085006/diff/1/src/GlobalJsObject.cpp#newc...
> src/GlobalJsObject.cpp:40: delete this;
> I checked, delete is actually thread-safe - so no issue here. The deleting
part
> might be made a bit nicer with smart pointers but probably not worth it.
> 
> http://codereview.adblockplus.org/10085006/diff/6001/src/GlobalJsObject.cpp
> File src/GlobalJsObject.cpp (right):
> 
>
http://codereview.adblockplus.org/10085006/diff/6001/src/GlobalJsObject.cpp#n...
> src/GlobalJsObject.cpp:22: throw std::runtime_error("No valid function passed
to
> setTimeout");
> Nit: I think the canonical message is: "First argument to setTimeout must be a
> function".
> 
>
http://codereview.adblockplus.org/10085006/diff/6001/src/GlobalJsObject.cpp#n...
> src/GlobalJsObject.cpp:26: throw std::runtime_error("No valid delay passed to
> setTimeout");
> Nit: I think the canonical message is: "Second argument to setTimeout must be
a
> number".

Fixed the nits.

Powered by Google App Engine
This is Rietveld