Re: Searchfox now provides code coverage information directly in the code listing!

2020-10-06 Thread Johann Hofmann
This is really really cool. Guess I'll stay loyal to the premier source
code indexing tool for Mozilla Firefox. Thank you to everyone involved!

On Tue, Oct 6, 2020 at 4:12 AM Andrew Sutherland <
asutherl...@asutherland.org> wrote:

> Have you ever been consulting the most excellent code coverage
> information for mozilla-central available at https://coverage.moz.tools/
> provided by Marco Castelluccio and team but said to yourself: "Hey, this
> isn't Searchfox!  But this is very useful information! My brand loyalty
> to Searchfox, the premier source code indexing tool for Mozilla Firefox,
> is very high, just like the quality of Searchfox, the premier source
> code indexing tool for Mozilla Firefox.  What if this information was
> available on Searchfox? And in a style synonymous with Searchfox's
> speed-centered brand, like a racing stripe down the side of the page?"
>
> Well, talk to yourself no more, because
> https://bugzilla.mozilla.org/show_bug.cgi?id=1566874 has landed and now
> Searchfox has a really cool racing stripe down the left side of the page
> just to the left of the annotate/blame bar!  Also, the racing stripe
> shows code coverage information!
>
> "Sure!", you say to yourself, "That's great, but I'm not sold yet.
> Anyone can just slap a racing stripe on a webpage thanks to the awesome
> power of WebExtensions.  What makes this racing stripe so great?"
> Thankfully, Searchfox, the premier source code indexing tool for Mozilla
> Firefox, sells itself and you immediately realize the following bullet
> points despite the current lack of in-product documentation for any of
> the following:
>
> - Code coverage uses a ColorBrewer 2.0 theme, diverging Red-Blue
> https://colorbrewer2.org/#type=diverging&scheme=RdBu&n=11 which is color
> blind friendly.  Red corresponds to coverage misses and blue corresponds
> to coverage hits.
> - When not hovered, the code coverage stripe shows an interpolated view
> of coverage so that lines that can't have code coverage data don't
> generate visual noise.  (While lines that are entirely white-space or
> code comments more intuitively can't have coverage data, multi-line
> statements and expressions also usually only provide coverage data for
> their first line.)
> - When hovered, the code coverage stripe shows more detail. Uncovered
> lines become distinguishable by their lack of a color. Lines with
> coverage hits switch from a single shade of blue to a logarithmic scale
> where darker blues convey greater numbers of hits.
> - Hovering on the coverage stripe provides details about the exact
> number of hits.  And the hover popup is powered by Searchfox's
> market-segment defining popup technology that you know and love and
> occasionally consider sending fan-mail about.
> - The accessibility tree for the stripe cells provides concise,
> insightful aria-labels such as "uncovered", "miss", and "hit 100".  And
> because Searchfox knows your time is important, coverage hits in excess
> of 999 get premium-distilled down to "hit 1k", "hit 100k", etc.  But
> Searchfox's market-segment leading popup technology can still provide
> you with the exact number of hits by activating the role="button"
> contents of the cell and following the aria-owns relationship into the
> popup.
> - The accessibility tree for annotate/blame cells has become even more
> market-defining!  Annotate cells that have the same revision as the
> preceding line will have a label with a prefix of "same". Annotate cells
> that have a different revision as the preceding line will have a label
> with a prefix of "new".  These will be followed by the word "hash" and a
> uniquely assigned ordinal mapping that is assigned based on sequential
> traversal of the source lines.  So while traversing the annotate stripe
> cells you might hear "new hash 5", "same hash 5", "new hash 73", "new
> hash 5".  Again, the life-changing experience that is Searchfox's popup
> technology can provide additional details.
>
> Brand disclaimers:
> - While Searchfox is the premier source code indexing tool for Mozilla
> Firefox, Searchfox cannot take credit for the immense undertaking that
> is providing the underlying coverage data. Please check out
> #codecoverage on https://chat.mozilla.org/ to properly thank Marco
> Castelluccio and team.
> - When luxuriating in Searchfox's accessibility tree experience, it's
> best to use Firefox nightly or another Firefox build with
> https://bugzilla.mozilla.org/show_bug.cgi?id=1668707 fixed.
>
> Synergy opportunities:
> - Whether you're an experienced Searchfoxer who remembers to use
> "symbol:" to prefix nonsensical symbol names made up by byzantine
> compiler processes for searching, a Searchfox developer who keeps typing
> "sym:" because it seems like that would be the logical choice, or a
> still-sane person who just types the human-readable identifiers which
> are stable in the face of signature changes when searching, you can
> contribute to Searchfox!
> - Bugs and enhancement

Re: Searchfox now provides code coverage information directly in the code listing!

2020-10-06 Thread Kartikaya Gupta
Thank you for implementing this Andrew! It's not always easy carving
out the time from your "day job" to work on searchfox stuff so kudos
for helping keep it the premier source code indexing tool for Mozilla
Firefox :)

Also thank you to Marco and team for exposing the code coverage info -
and while I'm here, a reminder that Marco also wrote a webextension
that brings integration of the premier source code indexing tool right
into Phabricator (aka your premier source code reviewing tool):
https://addons.mozilla.org/en-US/firefox/addon/searchfox-phabricator/
- while reviewing code in Phabricator you can click on stuff and
quickly jump into searchfox to get more context of the surrounding
code!

On Tue, Oct 6, 2020 at 3:21 AM Johann Hofmann  wrote:
>
> This is really really cool. Guess I'll stay loyal to the premier source code 
> indexing tool for Mozilla Firefox. Thank you to everyone involved!
>
> On Tue, Oct 6, 2020 at 4:12 AM Andrew Sutherland 
>  wrote:
>>
>> Have you ever been consulting the most excellent code coverage
>> information for mozilla-central available at https://coverage.moz.tools/
>> provided by Marco Castelluccio and team but said to yourself: "Hey, this
>> isn't Searchfox!  But this is very useful information! My brand loyalty
>> to Searchfox, the premier source code indexing tool for Mozilla Firefox,
>> is very high, just like the quality of Searchfox, the premier source
>> code indexing tool for Mozilla Firefox.  What if this information was
>> available on Searchfox? And in a style synonymous with Searchfox's
>> speed-centered brand, like a racing stripe down the side of the page?"
>>
>> Well, talk to yourself no more, because
>> https://bugzilla.mozilla.org/show_bug.cgi?id=1566874 has landed and now
>> Searchfox has a really cool racing stripe down the left side of the page
>> just to the left of the annotate/blame bar!  Also, the racing stripe
>> shows code coverage information!
>>
>> "Sure!", you say to yourself, "That's great, but I'm not sold yet.
>> Anyone can just slap a racing stripe on a webpage thanks to the awesome
>> power of WebExtensions.  What makes this racing stripe so great?"
>> Thankfully, Searchfox, the premier source code indexing tool for Mozilla
>> Firefox, sells itself and you immediately realize the following bullet
>> points despite the current lack of in-product documentation for any of
>> the following:
>>
>> - Code coverage uses a ColorBrewer 2.0 theme, diverging Red-Blue
>> https://colorbrewer2.org/#type=diverging&scheme=RdBu&n=11 which is color
>> blind friendly.  Red corresponds to coverage misses and blue corresponds
>> to coverage hits.
>> - When not hovered, the code coverage stripe shows an interpolated view
>> of coverage so that lines that can't have code coverage data don't
>> generate visual noise.  (While lines that are entirely white-space or
>> code comments more intuitively can't have coverage data, multi-line
>> statements and expressions also usually only provide coverage data for
>> their first line.)
>> - When hovered, the code coverage stripe shows more detail. Uncovered
>> lines become distinguishable by their lack of a color. Lines with
>> coverage hits switch from a single shade of blue to a logarithmic scale
>> where darker blues convey greater numbers of hits.
>> - Hovering on the coverage stripe provides details about the exact
>> number of hits.  And the hover popup is powered by Searchfox's
>> market-segment defining popup technology that you know and love and
>> occasionally consider sending fan-mail about.
>> - The accessibility tree for the stripe cells provides concise,
>> insightful aria-labels such as "uncovered", "miss", and "hit 100".  And
>> because Searchfox knows your time is important, coverage hits in excess
>> of 999 get premium-distilled down to "hit 1k", "hit 100k", etc.  But
>> Searchfox's market-segment leading popup technology can still provide
>> you with the exact number of hits by activating the role="button"
>> contents of the cell and following the aria-owns relationship into the
>> popup.
>> - The accessibility tree for annotate/blame cells has become even more
>> market-defining!  Annotate cells that have the same revision as the
>> preceding line will have a label with a prefix of "same". Annotate cells
>> that have a different revision as the preceding line will have a label
>> with a prefix of "new".  These will be followed by the word "hash" and a
>> uniquely assigned ordinal mapping that is assigned based on sequential
>> traversal of the source lines.  So while traversing the annotate stripe
>> cells you might hear "new hash 5", "same hash 5", "new hash 73", "new
>> hash 5".  Again, the life-changing experience that is Searchfox's popup
>> technology can provide additional details.
>>
>> Brand disclaimers:
>> - While Searchfox is the premier source code indexing tool for Mozilla
>> Firefox, Searchfox cannot take credit for the immense undertaking that
>> is providing the underlying coverage data

Changing browser remoteness

2020-10-06 Thread Geoff Lankow
Context: I'm trying to make Thunderbird E10s-compatible. We have 
s that can display web content or email messages. For now, 
email messages are going to have to be in the parent process. So, I need 
to be able to switch the remoteness of a  in both directions.


I may be barking up the wrong tree completely here. Don't laugh at me. :-)

I've borrowed this code from Firefox 
 
and that works perfectly (well, after I fix a few other things that 
aren't relevant here). I can put that in a wrapper function to decide 
which remote type to use, do the switch if necessary, and load the page. 
If I switch to a non-remote browser then load a message, that works too.


However. The code for displaying messages is C++ all the way down. I 
want to be able to switch to the parent process and continue as before. 
Here's what I've managed to figure out:


  nsCOMPtr win = nsPIDOMWindowOuter::From(mWindow);
  nsIDocShell* rootShell = win->GetDocShell();
  RefPtr el =
  rootShell->GetDocument()->GetElementById(u"messagepane"_ns);
  RefPtr frame =
  mozilla::dom::XULFrameElement::FromNodeOrNull(el);

  uint64_t browserId = frame->BrowserId();
  RefPtr browsingContext =
  CanonicalBrowsingContext::Cast(
  BrowsingContext::GetCurrentTopByBrowserId(browserId));

  browsingContext->ChangeRemoteness(NOT_REMOTE_TYPE, 1, false, 0)
  ->Then(
  GetMainThreadSerialEventTarget(), __func__,
  [&](BrowserParent* aBrowserParent) {
fprintf(stderr, "success\n");

/* Can I get a docShell here?!! */

return NS_OK;
  },
  [&](nsresult aStatusCode) {
fprintf(stderr, "failure\n");
  });

This works, the browser changes remoteness. Now I need a docShell for 
the next piece of the process, and this is where I'm stuck.


I'm not sure I've got the arguments to ChangeRemoteness right. I made up 
the second as a non-zero value is required, I think I understand the 
third but browsingContext is discarded regardless, and I don't know 
anything about the fourth.


What do I do here?

GL

___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform