• oddcoder
    I watched a video about webidl just to make sure I got things right their final goal is to map the C++ implementation to JS interface ?
  • smaug
    oddcoder: I'd say the goal with webidl is the describe APIs, and then webidl is also used to generate bindings which map implementation (can be currently C++ or privileged JS) to the JS interface
  • smaug
    s/describe/define/
  • oddcoder
    mmm ok please bear with me ... asssuming I am in here gecko-dev/dom/webidl surfing thorugh interface Document : Node
  • oddcoder
    where can I find the implementation for that
  • oddcoder
    and how are they linked together
  • jdm
    oddcoder: the implementation will be somewhere under dom/
  • jdm
    in this case, dom/base/nsDocument.cpp
  • oddcoder
    yeah that linking should be specified somewhere right, either the file or function names ?
  • jdm
    oddcoder: I guess you could try searching for DocumentBinding::Wrap in the code...
  • oddcoder
    okay let me see, thanks
  • oddcoder
    there is nothing named like this
  • oddcoder
    there is ImageDocumentBinding::Wrap, HTMLDocumentBinding::Wrap
  • oddcoder
    and they are only available in cpp files
  • jdm
    right
  • jdm
    the webidl implementation is almost always in c++
  • jdm
    the point is that for a given webidl interface, a [interface]Binding::Wrap function will be generated, and there will be c++ code that calls that function
  • jdm
    and that caller is usually the interesting, related code for that interface
  • jdm
    s/code/file/
  • asuth
    searchfox.org/mozilla-central/source/dom/bindings/Bindings.conf maps interface names to native implementations
  • asuth
  • jdm
    ohhhh, right
  • jdm
    I forgot that gecko leans heavily on that
  • asuth
    but you can searchfox on nsINode searchfox.org/mozilla-central/search?q=nsINode
  • jdm
    we removed as much as possible from servo's
  • oddcoder
    thanks
  • oddcoder
    I will dig into that
  • jdm
  • asuth
    jdm: how is that even possible?! madness!!
  • jdm
    asuth: we replaced explicit with implicit, easily-remembers rules :)
  • jdm
    *easily-remembered
  • asuth
    jdm: not sure if there's sarcasm in there; could the Bindings.conf file describe the rules or link to them for Gecko people's benefit who are trained to consult Bindings.conf?
  • jdm
    asuth: yeah, I was just thinking that we should do that
  • jdm
    huh, firefox started pinwheeling and is completely unresponsive now
  • jdm
    instruments.app just shows it executing JS
  • oddcoder
    what is the difference between js and privileged js ?
  • jdm
    oddcoder: privileged js can do things that normal websites cannot
  • oddcoder
    like ?
  • jdm
    oddcoder: extensions can access the cookie database for any domain, for example
  • jdm
    oddcoder: or take screenshots, or make unrestricted network requests, etc.
  • oddcoder
    I see
  • oddcoder
    for a moment I thought it can manipulate pointers one way or another thats why I asked
  • bkelly
    jdm: do you mind if I throw the necko-like patches in bug 1391693 for review?
  • firebot
    bugzil.la/1391693 — ASSIGNED, bkelly⊙mozilla.com — consider unifying service worker interception in a SyntheticHttpChannel class
  • jdm
    bkelly: sure
  • bkelly
    jdm: i think I solved my e10s integration woes... so hopeful I can have cleaned up patches in next couple days
  • jdm
    woo
  • bkelly
    I was trying to avoid the nsHttpChannel->InterceptedHttpChannel internal redirect in e10s... but that was a nightmare
  • bkelly
    instead I allow that internal redirect to happen, but I avoid triggering the HttpChannelChild/Parent redirect machinery... I "hide" this interception internal redirect... seems to keep the current set of invariants in place and working
  • bkelly
    writing it out sounds scary
  • » jdm knows that feeling
  • bkelly
    but "hiding" the extra internal redirect seems to just let everything work... even diversion "just works"
  • bkelly
    jdm: I guess I will flag a necko peer for the changes to HttpBaseChannel
  • bkelly
    since they are not directly interception related
  • » bkelly lunches
  • bkelly
    a wild memory leak appears
  • qDot
    mystor: How are you not a DOM peer yet?
  • mystor
    qDot: I've only been here a year and a half
  • mystor
    qDot: *shrug*
  • qDot
    oddcoder: Are you the oddcoder from radare? :D
  • oddcoder
    yup
  • qDot
    mystor: Oh, wow, thought you'd been here way longer than that.
  • mystor
    qDot: I was an intern a year before that so __kinda__?
  • mystor
    Intern 2015 summer, full time May 2016
  • oddcoder
    xD
  • qDot
    oddcoder: Oh, nice! Thanks for the PIC18 implementation, I'm currently cribbing off of that for a PIC24 core. :)
  • oddcoder
    :) have fun
  • » qDot needs to catch up on r2con talks too.
  • oddcoder
    yeah why not xD
  • mystor
    smaug: Who would know about nsIContentIterator and the motivations of the various optimizations the different nsContentIterators make/
  • oddcoder
    qDot: is that gsoc/rsoc ?
  • oddcoder
    I mean your work related to any of them ?
  • smaug
    mystor: last time I looked at that, it is mostly _very_ old code
  • smaug
    mystor: is this about the child array stuff?
  • mystor
    smaug: Yeah, nsICOntentIterator uses offsets :-/
  • smaug
    mystor: isn't masayuki reviewing catalinb's patches for that
  • mystor
    smaug: I suppose - he'd be the best person then?
  • smaug
    well, I think anyone who is writing code there or reviewing code there needs to read all the relevant code :(
  • smaug
    it is old
  • smaug
    mystor: I hope we aren't changing any of that before FF57 branching
  • mystor
    smaug: Fair - this is gonna be a fun
  • mystor
    smaug: No no no - I'm explicitly holding off until after 57
  • florian
    Hi. Who would be willing to do a simple review that requires a DOM peer (touching dom/ipc/ContentPrefs.cpp) in bug 1398198? (I just read in another bug comment that bill is on PTO)
  • firebot
    bugzil.la/1398198 — ASSIGNED, florian⊙queze.net — browser_startup.js should show the stack when a JS file was loaded earlier than expected
  • qDot
    oddcoder: Nah, I just do firmware reversing for fun.
  • qDot
    florian: I can get it.
  • qDot
    florian: Done
  • florian
    qDot: thanks! :-)
  • catalinb
    mystor: is the problem that nsContentIterator::Init still works with offsets?
  • oddcoder
    there is a way to run firefox in gdb right from mach right ?
  • mystor
    catalinb: Basically - the IME stuff ends up invoking that constructor
  • oddcoder
    I can't find it from help
  • mystor
    catalinb: I'm just adding another ::Init which works on RangeBoundaries
  • qDot
    oddcoder: ./mach run --debugger
  • oddcoder
    thanks
  • oddcoder
    usage: mach [global arguments] run [command arguments]
  • oddcoder
    mach: error: argument --debugger: expected one argument
  • oddcoder
    I did something wrong ?
  • mystor
    catalinb: Do you have a different idea?
  • catalinb
    mystor: no, I wanted to change the previous constructor which worked on nsRanges, but then masayuki changed it to something that explicitly uses (parent, index) so I thought maybe we don't care about perf there.
  • oddcoder
    nvm it was --debug instead of --debugger
  • mystor
    catalinb: maybe? It's used by IMEContentObserver at the very least
  • mystor
    catalinb: So it is code which can be run on dom mutations
  • mystor
    catalinb: Which feels perf sensitive to me?
  • qDot
    oddcoder: Whoops, sorry, ./mach run --debugger=gdb
  • qDot
    Oh yeah I use debugger 'cause sometimes I flip between lldb and gdb.
  • catalinb
    mystor: yeah, a new constructor should be fine I think
  • mystor
    smaug: Should we be passing down the `aDisconnected` parameter here: searchfox.org/mozilla-central/rev/e…8/dom/base/nsContentUtils.cpp#2900?
  • mystor
    smaug: Or is ignoring it intentional?
  • bkelly
    I like how AWFY speedometer has two Sep 12 days
  • oddcoder
    in firefox / gecko what exactly is chrome
  • oddcoder
    I see many function that mention chrome
  • oddcoder
    I think they doesn't mean the browser do they ?
  • oddcoder
    1 more thing what is the difference between nsDocument and nsIDocument ?
  • jdm
    oddcoder: chrome is the name for the browser's user interface, to differentiate it from arbitrary web content
  • jdm
    nsIDocument is an interface, basically
  • jdm
    nsDocument is a concrete implementation of it
  • oddcoder
    isn't both in C++ what is the need to have 2 classes that basically represent the same thing ?
  • oddcoder
    If didn't get it wrong there is C++ implementation and C++ interface and on top of the C++ interface there is the webidl bindings that is used to build the JS interface ?
  • jdm
    oddcoder: I think there are other classes that inherit from it as well
  • oddcoder
    which one of the 3 ?
  • oddcoder
    well nvm I get it
  • jdm
    ok, so there are no other c++ classes besides nsDocument that inherit directly from nsIDocument
  • jdm
    it might be used for JS integration, though
  • jdm
    I'm not sure
  • oddcoder
    gdb debugee process exist when I try to debug firefox
  • oddcoder
    I tried set follow-exec-mode new and set follow-fork-mode child but no luck
  • oddcoder
    also there is this
  • oddcoder
    ➤ b nsDocument.cpp:3519
  • oddcoder
    No source file named nsDocument.cpp.
  • oddcoder
    I thought it is not loaded yet but it never breaks when I call the function in there via its js interface
  • bkelly
    asuth: do you understand the async ipdl returns() stuff?
  • asuth
    bkelly: where it returns promises and is the best? Yes, I think so
  • bkelly
    asuth: is there any way for me to have the Recv*() method reject the promise?
  • asuth
    bkelly: you're not supposed to reject that promise. that's only for IPC to do.
  • bkelly
    :-\
  • asuth
    bkelly: you need to have semantic rejection happen in-band in your result type
  • bkelly
    ok, thanks
  • asuth
  • bkelly
    asuth: of course ErrorResult can't be used here... grrr
  • asuth
    bkelly: the quote from kanru's 4/19/2017 post was: "
  • asuth
    It is discouraged for the receiving handler to reject the promise. It
  • asuth
    should be reserved for the IPC system to signal errors. If you must
  • asuth
    reject the promise, only PromiseRejectReason::HandlerRejected is valid
  • asuth
    value."
  • bkelly
    asuth: what happens if I call the resolver function after the actor is ActorDestroy()'d?
  • bkelly
    any idea?
  • asuth
    bkelly: I'd assume the actor cleans out its holders, but it's just an assumption...
  • bkelly
  • asuth
    ah, okay, and it subclasses public SupportsWeakPtr<PProfilerChild>
  • sheppy
    So here's a generic question out of nowhere -- the spec lets you omit the closing tags on many of the elements that comprise a table. What would you consider best practice on that?
  • sfink
    personally, I form a firm opinion one way or the other, then every year or two, I flip to the other one and hold it even more firmly
  • sfink
    if only I could remember which one I last ended up on...
  • sfink
    it's the right one, though, I'm sure of it
  • sheppy
    sfink: LOL
  • sheppy
    Me, I don't like leaving out the closing pretty much ever unless it's outright not allowed.
  • sheppy
    Makes it easier to remember when to use it and forces me to structure my source cleanly to follow it.
  • sfink
    that's normally where I'd be too, but I seem to recall manually editing nested tables and realizing that I was doing a ton of busiwork whenever I wanted to adjust the nesting
  • sfink
    or maybe it was the excessive indenting necessitated by the <tr>\n(indent)<td>\n(indent)(indent)...
  • sfink
    if I don't have closing tags, I don't feel compelled to show the structure via newlines and indents
  • sheppy
    Stuff like this is why I like WYSIWYG tools :D