mozilla :: #content

19 Apr 2017
07:39annevkbkelly: ah, I just realized my comment about networking was based on https://github.com/whatwg/html/issues/1004#issuecomment-227687375
07:39annevkbkelly: wherein baku explains how networking keeps the worker alive
07:40annevkbkelly: baku didn't mention Indexed DB keeping the worker alive though
07:41bakuannevk: yeah, I didn't listed all the APIs that keep workers alive.
07:41bakuannevk: would be nice to make such list actually.
07:43annevkbaku: yeah, I'm somewhat motivated to do it, but bkelly noted how service workers apparently violate all the make GC not observable efforts
07:44annevkbaku: I wonder if it could be as simple as an IDL extended attribute (this object prolongs the lifetime of the global)
07:45annevkbaku: or maybe it doesn't have to be that complicated
07:45annevkbaku: we already state when XHR and WebSocket can be collected, and if they cannot be collected, than certainly the global they are in cannot be collected either
09:28smaugjessica: nice
09:30jessicasmaug: just making up for the extra memory I am going to use ;)
09:31smaugjessica: one thing we may want to add is some static assert in HTMLInputElement that its size doesn't increase above 512
09:31smaug(given the current mozjemalloc bucket sizes)
09:32jessicasmaug: or maybe some kind of warning...?
09:32smaugstatic assert would be nice, would prevent running the code at all
09:32smaugbut yeah, something
09:35jessicasmaug: assert sounds strong.. is that what we want?
09:35smaugyes
09:35smaugwe don't want accidental performance regressions caused by allocating too much
09:36jessicasmaug: yeah, ok, will add that to the patch.
09:38smaugjessica: if you move FileData patch to some other bug, baku could review it
09:38smaug(I feel like it is perhaps too much my idea for me to review)
09:43jessicasmaug: sure, I will CC you as well.
10:44catalinbhopang: ping
12:17hopangcatalinb: pong
12:19catalinbhopang: Hi. Are the timestamps from here exposed in devtools? http://searchfox.org/mozilla-central/source/netwerk/protocol/http/InterceptedChannel.h#54
12:50hopangcatalinb: Yes, they are meant to be, but i haven't got the time to rework the devtool part (1353798)
12:51hopangso there is nothing actually displayed on devtools at this moment, but you can still get them by listening to the topic
12:52catalinbI see. I thought there's something broken on my end.
12:52catalinbThanks
12:53hopangNP
13:10bkellyannevk: as far as I know those mechanisms for keeping the worker alive only last until the operation is complete... but I think you can still make a worker that repeatedly does requests and it can GC'd in between them... I guess you could overlap to maybe prevent GC
13:11annevkbkelly: but then your task queue wouldn't be empty most likely, although I guess it would be if you just did it through some timer
13:12bkellyannevk: we keep the worker alive during operations, but generally once the operation is complete we stop forcing it to stay alive
13:12annevkI'm not sure what an operation is
13:13bkellyannevk: fetch, a cache.put, webcrypto... really anything that needs to do work on a different thread
13:13annevkbkelly: okay, but we'd run the next task presumably once those are done?
13:13annevkbkelly: we wouldn't just close a worker with a non-empty event loop
13:14bkellyannevk: we go through a stateful shutdown... shutdown can begin while the event loop is non-empty
13:14annevkSo whenever a task finishes we start a shutdown process?
13:14annevkThat sounds... wasteful
13:15bkellyno, only if a shutdown is pending
13:15annevkAh okay, sure, the spec says that too
15:24bkellyfroydnj: what is best practice for passing already_AddRefed<> as an argument? by value, ref, or rvalue?
15:25froydnjbkelly: I think we decided that value was the way to go
15:25bkellycool... that makes my templates work
15:25bkellyalthough I see all 3 forms in dxr
15:25froydnjyou see already_AddRefed<>& ?
15:26bkellyfroydnj: https://dxr.mozilla.org/mozilla-central/source/dom/base/nsDOMDataChannel.h#32
15:26froydnjI can understand rvalue and value, but ref seems just weird, like somebody doesn&#39;t understand the idea
15:27froydnjbkelly: so it is
15:27bkellyfroydnj: hmm... does by-value work? it seems there is no copy constructor
15:28froydnjhah, khuey wrote that
15:29bkellyfroydnj: I might need to use by-ref.... I am trying to pass this already_AddRefed<> through a variadic template... and it wants to make a copy if I pass to a by-value arg
15:29froydnjbkelly: by-value requires an explicit Move() at the caller, or refptr.forget() or similar
15:29bkellynot sure how to do the Move() if the value is embedded in the variadic template arg
15:29froydnjbkelly: I think you want perfect forwarding in that case
15:29bkellyfroydnj: what is perfect forwarding?
15:30froydnjbkelly: http://thbecker.net/articles/rvalue_references/section_07.html
15:30froydnjah, really http://thbecker.net/articles/rvalue_references/section_08.html
15:30froydnjsection 7 just talks about the problem
15:31bkellyfroydnj: so I need to use std::forward?
15:31froydnjbkelly: or mozilla::Forward, either one
15:33bkellyfroydnj: Forward() does not seem to work with variadic template types?
15:34froydnjbkelly: what do you mean?
15:34bkellyfroydnj: https://pastebin.mozilla.org/9019433
15:35froydnjbkelly: Forward<Args>(aArgs)... is what you want
15:36froydnjArgs is whatever your variadic argument type is
15:36bkellyfroydnj: it doesn&#39;t like that
15:37bkellyif I do Forward<Args> I get: error: parameter packs not expanded with ...
15:37bkellyif I do Forward<Args...> I get error:
15:38bkellyoh wait, that works
15:38bkellybut it wants to pass the already_AddRefed<> by ref
15:38froydnjcan you pastebin your template code and the callsite it&#39;s complaining about?
15:41bkellyfroydnj: https://pastebin.mozilla.org/9019437
15:41bkellyit wants that last already_AddRefed<> to be by reference for some reason
15:42bkellyoh, it wants the by-ref to Forward(): /srv/mozilla-central/dom/clients/manager/ClientManagerOpParent.cpp:21:68: error: no matching function for call to Forward(const mozilla::dom::ClientOpenWindowArgs&, already_AddRefed<mozilla::dom::ContentParent>&)
15:42froydnjbkelly: uh. what&#39;s the complete error for using Forward<Args>(aArgs)...
15:43froydnjbkelly: your pastebinned version is trying to call a variadic Forward template, which doesn&#39;t work
15:43bkellyfroydnj: just Forward<Args> and not Forward<Args...>?
15:43froydnjbkelly: yes
15:43froydnjbkelly: don&#39;t forget the trailing ellipsis
15:44bkellyohh
15:45bkellyfroydnj: https://pastebin.mozilla.org/9019443
15:46froydnjbkelly: |Forward<Args>(aArgs)...|, not |Forward<Args>(aArgs...)...|
15:46froydnjbkelly: the error message is also saying that Method is some MozPromise thing, which seems wrong
15:48bkellyfroydnj: its working!
15:48froydnjbkelly: \o/
15:48bkellywell, its compiling
15:48froydnjworking is left as an exercise for the reader
15:49bkellyI wonder if I should add a comment about why I have the weird template syntax in there
15:49bkellybecause I certainly wouldn&#39;t recognize what is going on if I came across this...
15:55froydnjit&#39;s pretty standard syntax...
15:56bkellymaybe among those rare folks who can read templates
15:56froydnjit is a little weird, but it does follow from how variadic templates work
15:56bkellyI&#39;ve at least gone this long without ever really seeing it or understanding it
16:17smaugfarre: it is unclear to me why you want the wrapper on top of idleDispatch
16:43bzDoes anyone recall whether the conclusion of the whole &quot;taking bonsai offline&quot; business was that redirects were supposed to be set up?
17:17mccr8I think this was the relevant bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1200362 FWIW
17:17firebotBug 1200362 ASSIGNED, gps@mozilla.com Stand up a ViewVC server to replace Bonsai
17:18bzsorta
17:18* bz was specifically wondering about the redirect situation
17:18mccr8They set up redirects for MXR but I&#39;m not aware of any others.
17:18* bz sighs
17:19bzalright, thanks
17:19* bz just tells the people asking for his feedback to go away, because all of their links are broken
17:39froydnj&quot;if no working links, f-&quot;
18:13mystorehsan: ping
18:13bkellyehsan: safari is going to throttle timers in foreground cross-origin iframes: https://trac.webkit.org/changeset/215116/webkit
18:13mystorehsan: (unping - that was a test)
18:13ehsanmystor, thanks
18:14ehsanbkelly, interesting
18:14ehsanfarre, ^
18:14ehsanI&#39;ll file a bug on us for now
18:14bkellyehsan: and requestAnimationFrame: https://trac.webkit.org/changeset/215070/webkit
18:14bkellyhttps://trac.webkit.org/changeset/215153/webkit
18:14bkellyehsan: they are also aligning them all to minimize wake-ups
18:15ehsanyeah
18:15ehsanwe have a long way to go
18:15ehsanfor one thing, we should stop dispatching rAF in background tabs
18:18ehsanlet me file the rAF thing as well
18:18ehsanthis one will go in layout
18:19bkellyehsan: to clarify, its in their technology preview, but not shipped yet
18:19ehsanyes
18:20ehsanbkelly, you&#39;re cc&#39;ed on both bugs
18:20bkellythanks
18:20ehsannp
18:20ehsanthank *you* for raising these!
18:20ehsanbkelly, do you watch the safari trac ooc?
18:20bkellyehsan: no, I saw it in their TP release notes: https://webkit.org/blog/7516/release-notes-for-safari-technology-preview-28/
18:21ehsancool
18:21ehsanjust the day I switched away from osx ;)
18:27bkellyinteresting post on edge re-writing their DOM tree structure: https://blogs.windows.com/msedgedev/2017/04/19/modernizing-dom-tree-microsoft-edge/#1TfKpitXDDvLbHQB.97
18:40bkellyweird lambda errors with the android compiler
20:05mystorehsan___: I see your new laptop is bringing you back to the land____ of underscores_.
20:07mystorehsan___: Any chance you&#39;d look at https://bugzilla.mozilla.org/page.cgi?id=splinter.html&bug=1356277&attachment=8859226 soon? You watched me write it so I think it just needs a rubber stamp.
20:22ehsan___mystor, looking now
20:22ehsanhmm
20:22ehsanNickServ thinks my nick is owned by someone else
20:22ehsan___oh well
20:50bzfroydnj: ping
20:50froydnjbz: pong
20:50bzfroydnj: So I just tried to apply the patches from bug 1325254
20:50firebothttps://bugzil.la/1325254 ASSIGNED, bkelly@mozilla.com optimize TimerThread data structures
20:51bzfroydnj: The first 5. They apply pretty cleanly...
20:51* bz had to merge a few minor things in patch 5
20:51bkellybz: P6 doesn&#39;t work
20:51bzRight, that&#39;s why I didn&#39;t try applying it. ;)
20:51bkellyand you don&#39;t technically need it
20:51bkellyok
20:51bzfroydnj: Anyway, sounds like I just need to address your review comments on p5 there, right?
20:51bkellyP6 was kind of a mess, so didn&#39;t want you to waste any more time on it
20:52* froydnj looks at what he said
20:53froydnjbz: just the p5 comments, yes, unless you have a better idea
20:53bznope
20:53* bz is working on that
20:54bkellysorry for not seeing that stuff through :-\
20:54bzIt&#39;s fine
20:54* bz waves to the very long list of things he hasn&#39;t seen through
21:02bzfroydnj: So was your objection to the virtual call, or to this struct living in the timerimpl header or both?
21:02froydnjbz: my objection was the virtual call for a single (and probably only) implementation
21:02* bz can nix the virtual call pretty cleanly while still having this thing live in the timerimpl header, so all the interaction is nicely encapsulated...
21:02bzok
21:03bzwell, let&#39;s see what you think
20 Apr 2017
No messages
   
Last message: 125 days and 7 hours ago