Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Issue 11959029: Make the v8 Isolate used in the proxy resolver explicit. (Closed)

Created:
7 years, 11 months ago by Sven Panne
Modified:
7 years, 10 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Make the v8 Isolate used in the proxy resolver explicit. For conceptual and performance reasons, the v8 API will require explicit passing of Isolates in the future instead of relying on the retrieval of one out of thin air (= either TLS or an evil global variable in v8). This CL makes the Isolate explicit in ProxyResolverV8::Context. The default Isolate is retrieved and remembered in the main browser thread and then passed down to the Context where it is needed in different threads. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=180134

Patch Set 1 #

Patch Set 2 : Get the Isolate via Arguments in callbacks. #

Patch Set 3 : Plumbing fun #

Patch Set 4 : Plumbing fun, part 2 #

Patch Set 5 : Plumbing fun, part 3 #

Patch Set 6 : Rebased #

Patch Set 7 : Put default isolate into globals #

Patch Set 8 : Improved DCHECKs #

Patch Set 9 : Fixed component build #

Total comments: 10

Patch Set 10 : Addressed nits. Rebased. #

Patch Set 11 : Use simpler approach with less plumbing #

Patch Set 12 : Initialize default Isolate in net_unittests. #

Patch Set 13 : Relaxed DCHECK for the sake of ProfileManagerTest #

Patch Set 14 : Moved default Isolate plumbing around #

Patch Set 15 : Fixed layering #

Patch Set 16 : Rebased. #

Patch Set 17 : Rebased once again #

Patch Set 18 : Rebased. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -13 lines) Patch
M chrome/browser/io_thread.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +7 lines, -0 lines 2 comments Download
M net/base/run_all_unittests.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +9 lines, -0 lines 0 comments Download
M net/proxy/proxy_resolver_perftest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +3 lines, -1 line 0 comments Download
M net/proxy/proxy_resolver_v8.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +11 lines, -0 lines 0 comments Download
M net/proxy/proxy_resolver_v8.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 7 chunks +33 lines, -12 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
Sven Panne
Here is my first attempt to thread down v8's default isolate to the proxy resolver ...
7 years, 11 months ago (2013-01-18 13:13:18 UTC) #1
jochen (gone - plz use gerrit)
can you add a BUG= line (and probably also file a bug on crbug.com)? https://chromiumcodereview.appspot.com/11959029/diff/13014/chrome/browser/io_thread.h ...
7 years, 11 months ago (2013-01-18 13:29:07 UTC) #2
Sven Panne
Good idea: We already have a v8 bug to track this (making Isolate explicit in ...
7 years, 11 months ago (2013-01-18 14:27:33 UTC) #3
jochen (gone - plz use gerrit)
Ok, I'll wait for Eric's review, he has better insight into the proxy stuff
7 years, 11 months ago (2013-01-18 15:22:45 UTC) #4
eroman
High level comments: * Rather than plumb a new v8::Isolate* dependency all the way from ...
7 years, 11 months ago (2013-01-18 19:21:14 UTC) #5
Sven Panne
On 2013/01/18 19:21:14, eroman wrote: > High level comments: > > * Rather than plumb ...
7 years, 11 months ago (2013-01-21 08:49:34 UTC) #6
Sven Panne
https://codereview.chromium.org/11959029/diff/13014/net/net.gyp File net/net.gyp (right): https://codereview.chromium.org/11959029/diff/13014/net/net.gyp#newcode1677 net/net.gyp:1677: '../v8/tools/gyp/v8.gyp:v8', On 2013/01/18 19:21:14, eroman wrote: > why is ...
7 years, 11 months ago (2013-01-21 08:50:06 UTC) #7
eroman
What is special about the "main thread", why does the default isolate need to come ...
7 years, 11 months ago (2013-01-22 09:16:45 UTC) #8
Sven Panne
On 2013/01/22 09:16:45, eroman wrote: > What is special about the "main thread", why does ...
7 years, 11 months ago (2013-01-22 09:51:37 UTC) #9
eroman
What about retrieving the default isolate with Isolate::GetDefaultIsolateForLocking() and passing that to the locker. Would ...
7 years, 11 months ago (2013-01-22 18:37:02 UTC) #10
Sven Panne
On 2013/01/22 18:37:02, eroman wrote: > What about retrieving the default isolate with > Isolate::GetDefaultIsolateForLocking() ...
7 years, 11 months ago (2013-01-23 09:10:09 UTC) #11
eroman
Thanks for the explanations Sven! I am definitely in favor of the deprecation work for ...
7 years, 11 months ago (2013-01-24 01:24:08 UTC) #12
Sven Panne
OK, your proposal makes sense is much less intrusive than mine. The only question I ...
7 years, 11 months ago (2013-01-24 13:11:08 UTC) #13
eroman
I believe it would be: #if !defined(OS_IOS) Since on that platform it doesn't compile chrome ...
7 years, 11 months ago (2013-01-24 17:41:58 UTC) #14
Sven Panne
Here is my latest version, basically Eric's proposal with a slight simplification. PTAL...
7 years, 10 months ago (2013-01-31 11:10:58 UTC) #15
eroman
LGTM, thanks!
7 years, 10 months ago (2013-01-31 20:11:59 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/svenpanne@chromium.org/11959029/38006
7 years, 10 months ago (2013-01-31 20:50:56 UTC) #17
commit-bot: I haz the power
Failed to apply patch for net/proxy/proxy_resolver_v8.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 10 months ago (2013-01-31 20:50:59 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/svenpanne@chromium.org/11959029/36002
7 years, 10 months ago (2013-02-01 08:18:48 UTC) #19
commit-bot: I haz the power
Presubmit check for 11959029-36002 failed and returned exit status 1. Running presubmit commit checks ...
7 years, 10 months ago (2013-02-01 08:18:51 UTC) #20
jochen (gone - plz use gerrit)
chrome/ lgtm
7 years, 10 months ago (2013-02-01 08:21:08 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/svenpanne@chromium.org/11959029/36002
7 years, 10 months ago (2013-02-01 08:21:39 UTC) #22
jochen (gone - plz use gerrit)
Committed manually as r180134 (presubmit successful).
7 years, 10 months ago (2013-02-01 12:28:54 UTC) #23
John Knottenbelt
https://codereview.chromium.org/11959029/diff/36002/chrome/browser/io_thread.cc File chrome/browser/io_thread.cc (right): https://codereview.chromium.org/11959029/diff/36002/chrome/browser/io_thread.cc#newcode377 chrome/browser/io_thread.cc:377: net::ProxyResolverV8::RememberDefaultIsolate(); On downstream Chrome on Android, this function asserted ...
7 years, 10 months ago (2013-02-01 15:39:33 UTC) #24
Sven Panne
https://codereview.chromium.org/11959029/diff/36002/chrome/browser/io_thread.cc File chrome/browser/io_thread.cc (right): https://codereview.chromium.org/11959029/diff/36002/chrome/browser/io_thread.cc#newcode377 chrome/browser/io_thread.cc:377: net::ProxyResolverV8::RememberDefaultIsolate(); RememberDefaultIsolate() has to be called exactly once from ...
7 years, 10 months ago (2013-02-01 15:52:28 UTC) #25
digit1
After analysis, we have a better understanding of the issue: V8 initialization uses a static ...
7 years, 10 months ago (2013-02-01 16:47:09 UTC) #26
Sven Panne
7 years, 10 months ago (2013-02-01 18:14:09 UTC) #27
Message was sent while issue was closed.
As Eric already pointed out in another issue, there is no security issue,
because the isolate created via the initializer code is only used for the single
purpose of resolving proxies. Furthermore, there is currently no easy way to
avoid creating this initial isolate, nor is there (or even should be!) a way to
retrieve it. The goal of all this (and probably quite a few upcoming CLs) is to
remove all this implicit stuff and make everything explicit. The really tricky
part, as we currently all see ;-), is how to get there without breaking things
in the meantime or allocating unused isolates.

Is there an Android-specific way of calling RememberDefaultIsolate from that
temporary thread *after* all initializer code is guaranteed to have finished?
Doing it there and disabling the call in the IOThread constructor on Android
seems to be the right way for now. All this craziness will hopefully vanish when
everything is explicit... :-/ And last but not least: Our current DOM
performance will be much better without all the TLS accesses, too.

Powered by Google App Engine
This is Rietveld 408576698