RESOLVED FIXED103219
Initialize new web processes with list of auto-start origins for plug-ins
https://bugs.webkit.org/show_bug.cgi?id=103219
Summary Initialize new web processes with list of auto-start origins for plug-ins
Jon Lee
Reported 2012-11-26 00:05:20 PST
Initialize new web processes with list of auto-start origins.
Attachments
WIP (6.42 KB, patch)
2012-11-27 16:40 PST, Jon Lee
no flags
Patch (6.23 KB, patch)
2012-12-10 17:39 PST, Jon Lee
andersca: review+
Jon Lee
Comment 1 2012-11-26 00:05:35 PST
Brady Eidson
Comment 2 2012-11-26 08:40:34 PST
How large will this list be?
Jon Lee
Comment 3 2012-11-27 16:40:52 PST
Jon Lee
Comment 4 2012-11-27 16:41:31 PST
(In reply to comment #2) > How large will this list be? Unknown, to be honest. But it should basically monotonically increase over time.
Brady Eidson
Comment 5 2012-11-27 16:48:06 PST
(In reply to comment #4) > (In reply to comment #2) > > How large will this list be? > > Unknown, to be honest. But it should basically monotonically increase over time. With an approach that keeps a copy of the list in each WebProcess, this is a red flag for me.
Maciej Stachowiak
Comment 6 2012-11-28 02:52:41 PST
(In reply to comment #5) > (In reply to comment #4) > > (In reply to comment #2) > > > How large will this list be? > > > > Unknown, to be honest. But it should basically monotonically increase over time. > > With an approach that keeps a copy of the list in each WebProcess, this is a red flag for me. Perhaps the eventual direction should probably be to keep the master copy in the UIProcess and query/update asynchronously. But we can do an estimate of memory cost. Let's say a user intentionally enables some plugin content on 200 sites (probably a pretty high number!). Let's say 20 unicode characters for a domain name, 2 domains per entry. Then you are talking about a ~16kb cost per WebProcess, which is trivial. So I don't think memory use is a strong reason to hold off for the initial version.
Brady Eidson
Comment 7 2012-11-28 04:32:06 PST
Okay sounds reasonable
Alexey Proskuryakov
Comment 8 2012-11-30 10:48:43 PST
Duplicating the data still seems undesirable even if the direct cost is not so big. Why can't WebProcess just send a message to ask UI process when needed?
Maciej Stachowiak
Comment 9 2012-11-30 22:00:13 PST
(In reply to comment #8) > Duplicating the data still seems undesirable even if the direct cost is not so big. Why can't WebProcess just send a message to ask UI process when needed? I'm guessing this way was initially simpler to code. I share your instincts about the right eventual approach though.
Sam Weinig
Comment 10 2012-12-01 18:55:46 PST
(In reply to comment #8) > Duplicating the data still seems undesirable even if the direct cost is not so big. Why can't WebProcess just send a message to ask UI process when needed? We don't want to increase the number the of sync calls. If we want to make this more efficient, I think putting the table of strings into shared memory would be the best option.
Maciej Stachowiak
Comment 11 2012-12-02 11:14:34 PST
(In reply to comment #10) > (In reply to comment #8) > > Duplicating the data still seems undesirable even if the direct cost is not so big. Why can't WebProcess just send a message to ask UI process when needed? > > We don't want to increase the number the of sync calls. If we want to make this more efficient, I think putting the table of strings into shared memory would be the best option. I think it's very likely this can be an asynchronous call without really affecting performance, it would just make the code a little bit more complicated.
Jon Lee
Comment 12 2012-12-02 14:49:50 PST
(In reply to comment #11) > (In reply to comment #10) > > (In reply to comment #8) > > > Duplicating the data still seems undesirable even if the direct cost is not so big. Why can't WebProcess just send a message to ask UI process when needed? > > > > We don't want to increase the number the of sync calls. If we want to make this more efficient, I think putting the table of strings into shared memory would be the best option. > > I think it's very likely this can be an asynchronous call without really affecting performance, it would just make the code a little bit more complicated. I believe we can safely have this be async for the one kind of plug-in that can be async'd initialized at this point, but we can't do it for other plug-in types until we know they can be async'd init'd also. So in those cases we need to keep a web process side cache of the table anyway. For this reason I am going to keep the current approach. But I will go through a client instead of platform strategies, and switch to an unsigned 32-bit hash that includes the mime type.
Jon Lee
Comment 13 2012-12-10 17:39:27 PST
Anders Carlsson
Comment 14 2012-12-11 10:21:17 PST
Comment on attachment 178677 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=178677&action=review > Source/WebKit2/UIProcess/Plugins/PlugInAutoStartProvider.cpp:58 > +void PlugInAutoStartProvider::populateCopyOfTable(Vector<unsigned>& copyVector) > +{ > + copyToVector(m_autoStartHashes, copyVector); > +} I think you should make this return a Vector<unsigned> instead and give it a more appropriate name.
Jon Lee
Comment 15 2012-12-11 12:50:52 PST
Note You need to log in before you can comment on or make changes to this bug.