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

Issue 29371607: Issue #3593 - Make isolate a fully internal member of the engine

Created:
Jan. 12, 2017, 2:24 p.m. by Eric
Modified:
Jan. 17, 2017, 4:35 p.m.
Reviewers:
sergei, Felix Dahlke
Visibility:
Public.

Description

Issue #3593 - Make isolate a fully internal member of the engine Remove the isolate argument from the `JsEngine` factory method. This is an API change. This argument was, however, only introduced to deal with #3593, and it should not affect ordinary clients. Create the isolate in the engine factory method instead of using an external isolate or one from an argument default. Remove class `ScopedV8Isolate`, which is no longer necessary. Its behavior has been moved into the constructors and the factory. Added an engine destructor, needed to call `Dispose()` on the isolate, which call was previously performed by the removed class. Clean up unit tests in the wake of not sharing an isolate. Added test points to ensure that every use of the engine only has a single remaining (strong) reference at the time it's destroyed (and fixed defective versions of this test). This entails waiting for asynchronous tasks--I/O tasks must finish, timers are interrupted. Replaced explicit calls to `new` with calls to `make_shared`. In all cases this shortened the code; in a few cases it eliminated some memory leaks.

Patch Set 1 : #

Total comments: 1

Patch Set 2 : improve unit tests to go with isolate change #

Unified diffs Side-by-side diffs Delta from patch set Stats (+160 lines, -118 lines) Patch
M include/AdblockPlus/JsEngine.h View 4 chunks +19 lines, -32 lines 0 comments Download
M src/JsEngine.cpp View 3 chunks +23 lines, -27 lines 0 comments Download
M src/JsEngineInternal.h View 1 chunk +1 line, -1 line 0 comments Download
M test/AppInfoJsObject.cpp View 1 1 chunk +6 lines, -2 lines 0 comments Download
M test/BaseJsTest.h View 1 1 chunk +1 line, -1 line 0 comments Download
M test/BaseJsTest.cpp View 1 1 chunk +4 lines, -4 lines 0 comments Download
M test/ConsoleJsObject.cpp View 1 1 chunk +7 lines, -1 line 0 comments Download
M test/DefaultFileSystem.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M test/FileSystemJsObject.cpp View 1 2 chunks +9 lines, -3 lines 0 comments Download
M test/FilterEngine.cpp View 1 8 chunks +44 lines, -23 lines 0 comments Download
M test/JsEngine.cpp View 1 1 chunk +19 lines, -8 lines 0 comments Download
M test/Notification.cpp View 1 3 chunks +20 lines, -10 lines 0 comments Download
M test/Prefs.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M test/UpdateCheck.cpp View 1 1 chunk +2 lines, -1 line 0 comments Download
M test/WebRequest.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 3
Eric
Together will all the prior work on this issue and the blocking issues, this change ...
Jan. 12, 2017, 3:03 p.m. (2017-01-12 15:03:15 UTC) #1
Eric
Patch set two was the result of a better audit of the unit test suites. ...
Jan. 16, 2017, 3:59 p.m. (2017-01-16 15:59:57 UTC) #2
Eric
Jan. 17, 2017, 4:35 p.m. (2017-01-17 16:35:42 UTC) #3
I investigated `DefaultWebRequestTest` to see if it's actually leaking. It
doesn't seem to be. Instead, much of the memory consumption looks to be an
inefficiency in memory usage. I've filed issue #4812 for it.

https://issues.adblockplus.org/ticket/4812

So patch set 2 seems to stand as fixing all the major memory leaks that we have
in the unit tests, or at least, all that can be addressed at this point.

Powered by Google App Engine
This is Rietveld