This gives us the additional benefit that it will provide a clean inlined path
for the common case of testing for permissions from the anti-tracking backend.
Depends on D20237
Differential Revision: https://phabricator.services.mozilla.com/D20238
--HG--
extra : moz-landing-system : lando
This will mean that in places like the tight loop in GetTypeIndex()
we would no longer require calling strlen() on the input type argument
once per loop iteration.
Depends on D20236
Differential Revision: https://phabricator.services.mozilla.com/D20237
--HG--
extra : moz-landing-system : lando
This patch in the series ensures that the order of operations in
recursive invocations of CommonTestPermission() remains consistent
compared to before the patch series, even though it is not strictly
needed for the performance improvements that the series focuses on.
The core idea behind CommonPrepareToTestPermission() now is to do the checks
that do not depend on the host name being tested, and for
CommonTestPermissionInternal() itself to focus on the rest of the checks,
that is looking up our hashtable entry based on the host name being tested,
and everything else that's needed from that point on.
Depends on D20235
Differential Revision: https://phabricator.services.mozilla.com/D20236
--HG--
extra : moz-landing-system : lando
This patch alone decreases the runtime of the loop on my machine from about
1700 to 200-400ms ranges. It turns out that computing the type index is
the most expensive part. So perhaps we should look into improving that as
well.
The first thing that comes to mind is whether we can inline the loop in
GetTypeIndex(). The next part takes care of that, and it does help a bit.
But we need to do more still.
The next obvious thing is to optimize the memory access patterns. Right
now we iterate over an array of dynamically allocated strings to compare
them, which amounts to pointer chasing to read a bit of memory, kind of
the worst possible way to access memory. Then we look at replacing that
with fully sequential memory reads in the common cases.
Depends on D20231
Differential Revision: https://phabricator.services.mozilla.com/D20232
--HG--
extra : moz-landing-system : lando
We choose 100,000 iterations so that on a fast processor the test takes
times in the order of seconds.
Differential Revision: https://phabricator.services.mozilla.com/D20229
--HG--
rename : extensions/cookie/test/moz.build => extensions/cookie/test/gtest/moz.build
extra : moz-landing-system : lando
Replacing js and text occurences of asyncOpen2
Replacing open2 with open
Differential Revision: https://phabricator.services.mozilla.com/D16885
--HG--
rename : layout/style/test/test_asyncopen2.html => layout/style/test/test_asyncopen.html
extra : moz-landing-system : lando
No one uses CheckCurrentWordNoSuggest. So I would like to get a rid of this
method. And this method is only user of mozSpellChecker::CheckWord. So
mozSpellChecker::CheckWord shouldn't allow that aSuggestions is nullptr on
content process since we already have async API as mozSpellChecker::CheckWords.
Differential Revision: https://phabricator.services.mozilla.com/D19303
--HG--
extra : moz-landing-system : lando
For cases where the class has direct calls (that is, we cast `this` to the
subclass before making the call) no longer declare Recv/Answer methods on the
base class at all. This should ensure that slots for them are not generated in
vtables, and also allow the derived class to choose the method signature (e.g.
whether it wants to take something by reference or by value).
Differential Revision: https://phabricator.services.mozilla.com/D18132
--HG--
extra : moz-landing-system : lando
***
Bug 1514594: Part 3a - Change ChromeUtils.import to return an exports object; not pollute global. r=mccr8
This changes the behavior of ChromeUtils.import() to return an exports object,
rather than a module global, in all cases except when `null` is passed as a
second argument, and changes the default behavior not to pollute the global
scope with the module's exports. Thus, the following code written for the old
model:
ChromeUtils.import("resource://gre/modules/Services.jsm");
is approximately the same as the following, in the new model:
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
Since the two behaviors are mutually incompatible, this patch will land with a
scripted rewrite to update all existing callers to use the new model rather
than the old.
***
Bug 1514594: Part 3b - Mass rewrite all JS code to use the new ChromeUtils.import API. rs=Gijs
This was done using the followng script:
https://bitbucket.org/kmaglione/m-c-rewrites/src/tip/processors/cu-import-exports.jsm
***
Bug 1514594: Part 3c - Update ESLint plugin for ChromeUtils.import API changes. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D16747
***
Bug 1514594: Part 3d - Remove/fix hundreds of duplicate imports from sync tests. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D16748
***
Bug 1514594: Part 3e - Remove no-op ChromeUtils.import() calls. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D16749
***
Bug 1514594: Part 3f.1 - Cleanup various test corner cases after mass rewrite. r=Gijs
***
Bug 1514594: Part 3f.2 - Cleanup various non-test corner cases after mass rewrite. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D16750
--HG--
extra : rebase_source : 359574ee3064c90f33bf36c2ebe3159a24cc8895
extra : histedit_source : b93c8f42808b1599f9122d7842d2c0b3e656a594%2C64a3a4e3359dc889e2ab2b49461bab9e27fc10a7
Add Telemetry to know the number of times user adds site to allow list, remove site from allow list, add site to block list and remove site from block list.
Differential Revision: https://phabricator.services.mozilla.com/D16642
--HG--
extra : moz-landing-system : lando
Previous implementation is
- Use idle runnable for spellchecker
- If spellchecker runnable spends 1ms (with 5 words), spellchecker is suspended,
then resume it after 1s.
- If misspell is 3/4 of extensions.spellchecker.inline.max-misspellings per
DoSpellCheck, spellchecker is stopped.
After this change, IPC is async, so we cannot count misspell words without
waiting the result of async call. So I would like to change to
- Use idle runnable for spellchecker
- If spellchecker runnable spends 1ms (with 5 words), spellchecker is suspended,
then resume it after 1s.
- If misspell reaches extensions.spellchecker.inline.max-misspellings, stop
spellcheck.
- spellchecker IPC is called per maximum 25
(INLINESPELL_MAXIMUM_CHUNKED_WORDS_PER_TASK) words.
As long as my MacBook (Core m3), spellchecker can check 100-150 words per 1ms
after this fix.
Also, INLINESPELL_MAXIMUM_CHUNKED_WORDS_PER_TASK define is less than 5, a lot of
a11y tests will be failed. Because it uses selection listener to count all misspell words without waiting completion.
Differential Revision: https://phabricator.services.mozilla.com/D14837
--HG--
extra : rebase_source : 59185554236409d3320cc77714a776f2228214af
For mozInlineSpellChecker, I would like to add promse-based method to check
word. But this method is
- On content process, it works by async.
- On chrome process, it works by sync.
Some reftests with non-e10s don't wait that spellchecker is finished correctly
due to race condition of spellchecker dictionary update. So it uses sync'd
promise on chrome.
Differential Revision: https://phabricator.services.mozilla.com/D14836
--HG--
extra : rebase_source : 63d8fb1b3a6f8754f5b7604ea920c1a26bcd4f5b
Actually we have no async IPC for spellchecker, so I would like to add async
IPC to check word.
When using full check, spellchecker requests a lot of words to check word. New
async IPC should allow multiple words per IPC to reduce IPC call.
Differential Revision: https://phabricator.services.mozilla.com/D14835
--HG--
extra : rebase_source : e54177c1779dc7e2e48c189a65cbc212b4aa519a
For consumers which have an origin string, currently they need to parse it into
a URI before they can call testPermission(). Internally, in the common case this
nsIURI* argument will be immediately converted back into the same origin string
in PermissionKey::CreateFromURI(). This means that the cost of parsing the
original origin string will effectively end up being wasted in the common case.
This patch adds an API that allows the consumer to test a permission using the
origin string directly, and only parse it into an nsIURI when necessary, thereby
avoiding this overhead.
Differential Revision: https://phabricator.services.mozilla.com/D15543
--HG--
extra : moz-landing-system : lando
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.
Overall it's not a very interesting patch I think.
nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.
I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.
While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.