Mark that channel as anonymous in order to prevent any cookies
from being set here and potentially tie these proxied requests
to list updates which will not go through the proxy.
Also fix a return code in the case that httpChannel fails to QI.
MozReview-Commit-ID: BaRyYRlUbsB
--HG--
extra : rebase_source : 9ef4575553a7f4981c394b86e2923b5a5bf646c4
Same approach as the other bug, mostly replacing automatically by removing
'using mozilla::Forward;' and then:
s/mozilla::Forward/std::forward/
s/Forward</std::forward</
The only file that required manual fixup was TestTreeTraversal.cpp, which had
a class called TestNodeForward with template parameters :)
MozReview-Commit-ID: A88qFG5AccP
This was done automatically replacing:
s/mozilla::Move/std::move/
s/ Move(/ std::move(/
s/(Move(/(std::move(/
Removing the 'using mozilla::Move;' lines.
And then with a few manual fixups, see the bug for the split series..
MozReview-Commit-ID: Jxze3adipUh
Also fixes existing code which fails the rule.
MozReview-Commit-ID: CkLFgsspGMU
--HG--
extra : rebase_source : 86a43837659aa2ad83a87eab53b7aa8d39ccf55b
This should help narrow down which of the code paths is responsible
for the intermittent failures we are seeing.
MozReview-Commit-ID: JHVZzixpOg6
--HG--
extra : rebase_source : c2eefb0bf0f281adf393d2a531db3e5d3ce023d6
This also removes any redundant Ci.nsISupports elements in the interface
lists.
This was done using the following script:
acecb401b7/processors/chromeutils-generateQI.jsm
MozReview-Commit-ID: AIx10P8GpZY
--HG--
extra : rebase_source : a29c07530586dc18ba040f19215475ac20fcfb3b
Repurpose the previously unused Begin() function to initialize
ProtocolParser objects and also assert that we are not reusing
objects across update since that's not supported.
MozReview-Commit-ID: HIGGgOr388h
--HG--
extra : rebase_source : 53398213bf38e582248f1954bbdb46fd53348e40
This check was added in bug 1296820 to disable V4 updates prior
to their being implemented. It should have been removed once we
landed working support for V4 updates.
MozReview-Commit-ID: 828DIS72LNi
--HG--
extra : rebase_source : df3bf169fb077891d5096d7cbeb68c2bb657f834
This is a generalization of the reset code that's used in pver2
to reset all tables when a `pleasereset` command is received.
MozReview-Commit-ID: LF4RegQHqoT
--HG--
extra : rebase_source : 5c100f179a23c805fe245a361f4e89c8d5f5ce0a
Repurpose the previously unused Begin() function to initialize
ProtocolParser objects and also assert that we are not reusing
objects across update since that's not supported.
MozReview-Commit-ID: HIGGgOr388h
--HG--
extra : rebase_source : f9f83b1c7bd79faa40fc1d7cb594dcb14a66fe09
This check was added in bug 1296820 to disable V4 updates prior
to their being implemented. It should have been removed once we
landed working support for V4 updates.
MozReview-Commit-ID: 828DIS72LNi
--HG--
extra : rebase_source : df3bf169fb077891d5096d7cbeb68c2bb657f834
This is a generalization of the reset code that's used in pver2
to reset all tables when a `pleasereset` command is received.
MozReview-Commit-ID: LF4RegQHqoT
--HG--
extra : rebase_source : 5c100f179a23c805fe245a361f4e89c8d5f5ce0a
Given we're no longer using dependent strings in
LookupCacheV4::PrefixString(), we will end up make a copy of the
prefixes at some point. Let's do it early and remove a bunch of
complicated code.
Make the string copies fallible so that we return an error and
fail the update instead of crashing.
MozReview-Commit-ID: 5cZHSDIJSlD
--HG--
extra : rebase_source : 0ad130c2be9caf528bb764296836e91fa8a30916
Also document the meaning of mPrimed in LookupCache.h.
MozReview-Commit-ID: 63GAHwU3Rx3
--HG--
extra : rebase_source : 11307604f957efbd6879db83f916a9cb369f93ff
Dependent strings are recommended only when dealing with a character
buffer (i.e. char*). Using it here makes it more likely that we'll
hang on to a string buffer that will be deallocated.
nsCString will by default share the underlying string buffers when
it can (i.e. when copying entire strings on the heap) so it should
be able to avoid unnecessary copies.
MozReview-Commit-ID: 3rTUYmouzcT
--HG--
extra : rebase_source : 8563bc242bf41cf8e12aa0b4ccba32c6a38d952a
Some of the tests don't handle update errors very well and rely on timeouts to
fire after several minutes. Since these tests are not actually testing update
failure modes, it's safe to fail quicly and terminate the test with an
exception.
MozReview-Commit-ID: EJgaWke6kl2
--HG--
extra : rebase_source : 486797e1a3c23c5a65ae7c5134fd4db7e663a3aa
With a common prefix, all of the URL Classifier gtests can be run
like this:
./mach gtest UrlClassifier*
MozReview-Commit-ID: IqQznsldFOD
--HG--
extra : rebase_source : 5da7496e9607083b452c915608a0ab9adae818ff
RegenActiveTables() relies on mPrimed being set correctly and so
the V4 lookup cache should behave the same way as the V2 one.
The V2 lookup cache on the other hand was unnecessarily setting
mPrimed to true twice.
MozReview-Commit-ID: LwNdI9DTqZ7
--HG--
extra : rebase_source : ff7d7a051f28867be5c35c1079407bb2bfd3a490
This also changes a few MOZ_LOG() messages to use the error name
instead of the raw numerical nsresult value.
MozReview-Commit-ID: Jcngd0S9j2z
--HG--
extra : rebase_source : f6e974569d8845211e0b25dabef2c41dda2ca1b6
* Code in XMLHttpRequestMainThread is converted to set the username and password individually. This is because when the parameters are empty, it ended up calling SetUserPass(":") which always returns an error.
MozReview-Commit-ID: 3cK5HeyzjFE
--HG--
extra : rebase_source : f34400c11245d88648b0ae9c196637628afa9517
In addition to including the name of the prefix set in all of the
LOG messages, the VariablePrefixSet class now initializes its
dependent fixed-size prefix set correctly.
MozReview-Commit-ID: C7c78HLcXY3
--HG--
extra : rebase_source : 286ff92e42b960479522746fab62eae76fe3afb3
Adding a checksum to an array in the URL classifier to test our
theory that the crashes are due to memory corruption.
This patch also restores the Compact() calls that were #ifdef'd
out in bug 1362761 to test a different theory.
MozReview-Commit-ID: IkLduLO3IXb
--HG--
extra : rebase_source : 3e628618aacddfc19c154e6e5c7bf78d8b4b5aa3
"Include what you use."
--HG--
extra : rebase_source : 2239a380029e0efbc9dd3042459222a67c38d70f
extra : amend_source : 4453c32cc469caa592049167205666997f1a1e7b
extra : histedit_source : a533edd4a4d3d0642b08989e93674661d27baa6a%2C37d27eeef9580381ccc0de8507f60166dabf1730
Passing a value of -1 to nsCString::Truncate() converts that
value to a large integer and leads to an unnecessary 4GB
memory allocation.
MozReview-Commit-ID: Icm5iUsEgA6
--HG--
extra : rebase_source : 7c7a52762ba86b1daadf60b0f362c5740d335781
Disk corruption can lead to the stored length of a value to be
unreasonably large and trigger an OOM.
Since values are all currently <= 32 bytes, we can safely enforce
a 256-byte upper bound.
MozReview-Commit-ID: XygReOpEK3
--HG--
extra : rebase_source : cd2bc880d43612b04d43fb4132bba32bdc3d0f3e
Telemetry's AutoTimer Microsecond resolution was not used. I removed it with the TimerResolution enum, which allowed me to remove a couple of templates as well.
MozReview-Commit-ID: 76qHgmYEsE3
--HG--
extra : rebase_source : 1f5826f1be990d4814de15875cd0a726213712d4
This test is supposed to verify that Safe Browsing providers can
be initialized correctly even when a table is not configured
properly.
By removing a table from both google and google4, we ensure that
the test will be meaningful regardless of the stack in use.
Also filter out the console noise triggered by looking for the
update and gethash URLs of the "test" dummy provider.
MozReview-Commit-ID: KjWqSqA4FxJ
--HG--
extra : rebase_source : c68ab76201f200de5b5f4ab329bfe00a50603db2
The list of sites to suppress flash infobars on should not be
downloaded from shavar unless the infobar feature is enabled.
MozReview-Commit-ID: BjkS5vWiilg
--HG--
extra : rebase_source : ba7c104b758fc04994b8438222dda0c7feadc787
This patch was autogenerated by my decomponents.py
It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.
It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.
It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)
MozReview-Commit-ID: DeSHcClQ7cG
--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
The list of sites to suppress flash infobars on should not be
downloaded from shavar unless the infobar feature is enabled.
MozReview-Commit-ID: BjkS5vWiilg
--HG--
extra : rebase_source : 3696960f06bf5c256dec7988d410de8208620b1b
Download protection requires both the malware list as well as its
own special lists. The code therefore checks that both Safe
Browsing and download protection are enabled before checking
downloaded files.
The list manager should check the same prefs before downloading
any of the download protection lists in order to avoid connecting
to the Safe Browsing server when Safe Browsing is fully disabled.
MozReview-Commit-ID: 66vMA56T4pJ
--HG--
extra : rebase_source : cef14cf5a03290bd10d8d02367709e1ffd5e9030
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm
MozReview-Commit-ID: 1Nc3XDu0wGl
--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
This marks **/docs/** as exclusively docs, and code that is autodoc'd as
inclusively docs.
That means that a change that purely modifies documentation files will *only*
run `docs` tasks, while a change that modifies autodoc'd source code will
*additionaly* run `docs` tasks. The tasks do not run by default.
MozReview-Commit-ID: G9tOK0AwtrI
--HG--
extra : rebase_source : 8dd971e5c9b0eb5f47895664a4ea49442f303ecb
extra : source : 0881de9b2b5e36ec37cc866f1d4af109da57a919
This marks **/docs/** as exclusively docs, and code that is autodoc'd as
inclusively docs.
That means that a change that purely modifies documentation files will *only*
run `docs` tasks, while a change that modifies autodoc'd source code will
*additionaly* run `docs` tasks. The tasks do not run by default.
MozReview-Commit-ID: G9tOK0AwtrI
--HG--
extra : rebase_source : 8dd971e5c9b0eb5f47895664a4ea49442f303ecb
extra : source : 0881de9b2b5e36ec37cc866f1d4af109da57a919
This marks **/docs/** as exclusively docs, and code that is autodoc'd as
inclusively docs.
That means that a change that purely modifies documentation files will *only*
run `docs` tasks, while a change that modifies autodoc'd source code will
*additionaly* run `docs` tasks. The tasks do not run by default.
MozReview-Commit-ID: G9tOK0AwtrI
--HG--
extra : rebase_source : 8dd971e5c9b0eb5f47895664a4ea49442f303ecb
extra : source : 0881de9b2b5e36ec37cc866f1d4af109da57a919
After this patch landed, we will have 3 cases:
1. For providers are not "test", for example, google, google4, mozilla ... etc
backoff CANNOT be disabled.
2. For "test" provider, if preference "browser.safebrowsing.provider.test.disableBackoff" is ON
backoff is disabled.
3. For "test" provider, if preference "browser.safebrowsing.provider.test.disableBackoff" is Off
backoff is NOT disabled.
So if your testcase will use listmanager or hashcompleter, you should try to use "test" provider
if possible, otherwise testcase may encounter intermittent failure due to backoff.
MozReview-Commit-ID: 3BDxs0ARyQM
--HG--
extra : rebase_source : 1736abe307849089d68f0f2b1a0127b9b465abed
After this patch landed, we will have 3 cases:
1. For providers are not "test", for example, google, google4, mozilla ... etc
backoff CANNOT be disabled.
2. For "test" provider, if preference "browser.safebrowsing.provider.test.disableBackoff" is ON
backoff is disabled.
3. For "test" provider, if preference "browser.safebrowsing.provider.test.disableBackoff" is Off
backoff is NOT disabled.
So if your testcase will use listmanager or hashcompleter, you should try to use "test" provider
if possible, otherwise testcase may encounter intermittent failure due to backoff.
MozReview-Commit-ID: 3BDxs0ARyQM
--HG--
extra : rebase_source : 84250bc7aab28a896afb2d47f98435139139c1f3
The ThreatHit requests were never being sent because SetMatchedInfo() was
called on the channel _after_ calling SendThreatHitReport().
Additionally, the telemetry was sent in OnStartRequest() and so errors
returned in OnStopRequest() would not be caught.
This patch also includes some improvements to the logging of these
requests which can be toggled using:
MOZ_LOG="UrlClassifierDbService:5,nsChannelClassifier:5"
MozReview-Commit-ID: 9dtRgEPVS3g
--HG--
extra : rebase_source : 6d0e4b745e203a54489ddd479935d008ab9a82d7
This patch adds a |ForceUpdates| API in listmanager so when we change Safe Browsing tables,
we can use this API to force an update to ensure new tables are downloaded immediately.
If the update fails for any reason (Server is down for example), then the new tables will have
to wait until next update time.
MozReview-Commit-ID: 3Zh1pU8XaYo
--HG--
extra : rebase_source : 215cd2f4484b07663566024bfa5e182ee3807d4e
This patch adds a |ForceUpdates| API in listmanager so when we change Safe Browsing tables,
we can use this API to force an update to ensure new tables are downloaded immediately.
If the update fails for any reason (Server is down for example), then the new tables will have
to wait until next update time.
MozReview-Commit-ID: 3Zh1pU8XaYo
--HG--
extra : rebase_source : 65ff9de561e21cfb0b80be0f62335351e612cc01
Safebrowsing testcase will close and then re-open database to simulate firefox restart.
This bug happened when DB service already has a previously cached completion result and then
re-open database. In this scenario, if testcase triggers another the same completion request,
we won't cache it because we thought we have it already (See nsUrlClassifierDBServiceWorker::CacheCompletion).
This causes a testcase assertion when testcase expects the completion
result should be stored in LookupCache.
MozReview-Commit-ID: 8o57jHv92OH
--HG--
extra : rebase_source : 90861060437d6cef860b85dd669d76e74ceec660
This makes the code nicer. In particular, it removes many getter_Copies()
calls. The patch also converts a lot of nsCStrings to nsAutoCString, which will
avoid heap allocation in the common case.
The patch also renames PREF_CopyCharPref() as PREF_GetCStringPref(), because
it's actually getting a string, not a char, and that matches the existing
GetCString() and GetDefaultCString() methods. Correspondingly, it also renames
PREF_SetCharPref() as PREF_SetCStringPref().
The |aPrefName| arguments in nsIPrefBranch.idl remain as |string| because they
almost always involve passing in C string literals, and passing "foo" is much
nicer than passing NS_LITERAL_CSTRING("foo").
It's worth noting that early versions of this patch used |AUTF8String| instead
of |ACString|. But it turns out that libpref stores prefs internally as Latin1.
And |ACString| is compatible with Latin1 but |AUTF8String| isn't, because
non-ASCII Latin1 strings are not valid UTF-8!
MozReview-Commit-ID: D3f7a1Vl1oE
--HG--
extra : rebase_source : e6e4b15d6d210cfd93686f96400281f02bd1d06b
We suspect nsTArray Compact may cause a crash issue during SafeBrowsing
update. Temporarily remove it from NIGHTLY build, if crash still shows
at NIGHTLY build, we will restore it back.
MozReview-Commit-ID: 2wjbMykEbJ8
--HG--
extra : rebase_source : 1be0d12e9d1de7f249c509cfa016bb26242cbdc7
When about:url-classifier ask cache information by using |GetCacheInfo| API, this API
will send a SYNC request to off-main thread. If NSS module is not initialized then off-main thread
will send init request to main thread, and this causes a deadlock.
This patch change |GetCacheInfo| API to asynchronous so main thread will not be
blocked.
MozReview-Commit-ID: 3y2hOjCoRUj
--HG--
extra : rebase_source : 4d1ec1b7fd960cdf90bca577879b41fbbc2a4e17