Commit graph

1223 commits

Author SHA1 Message Date
Francois Marier
7f90c6a9cc Bug 1414051 - Move ThreatHit protobuf details to the body. r=gcp
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
2018-02-19 16:18:37 -08:00
Miko Mynttinen
4c85ef17cc Bug 1465060 - Part 1: Fix warnings for std::move() use r=froydnj
MozReview-Commit-ID: HpdFXqQdIOO

--HG--
extra : rebase_source : 1e7eea4f2d4ec16ec0c559a8afb26976ddbf4d07
2018-06-01 17:59:07 +02:00
arthur.iakab
7e765f798b Backed out 2 changesets (bug 1465060) for build bustages on security/sandbox/linux/reporter/SandboxReporter.cpp
Backed out changeset 7c8905b6b226 (bug 1465060)
Backed out changeset 10446073eca8 (bug 1465060)
2018-06-03 19:25:41 +03:00
Miko Mynttinen
8d9dc85cd4 Bug 1465060 - Part 1: Fix warnings for std::move() use r=froydnj
MozReview-Commit-ID: HpdFXqQdIOO

--HG--
extra : rebase_source : 619d0e0ff63a2453c80f0c4d9beb906d43fa9b01
2018-06-01 17:59:07 +02:00
Emilio Cobos Álvarez
1e9c395548 Bug 1466168: Remove mozilla::Forward in favor of std::forward. r=froydnj
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
2018-06-02 09:33:26 +02:00
Emilio Cobos Álvarez
fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
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
2018-06-01 10:45:27 +02:00
Kris Maglione
6b12d08f7d Bug 1462937: Update callers to use nsIFile::GetDirectoryEntries as a nsIDirectoryEnumerator. r=froydnj
MozReview-Commit-ID: Iv4T1MVAF5

--HG--
extra : rebase_source : 1c518883d082884db7f9323a5acc20361228c26b
extra : histedit_source : 70a73c23d1199d3bfbb5379c78930401166c094b
2018-05-19 20:17:45 -07:00
Kris Maglione
01c298aca6 Bug 1460092: Add ESLint rule to enforce use of ChromeUtils.generateQI. r=Gijs
Also fixes existing code which fails the rule.

MozReview-Commit-ID: CkLFgsspGMU

--HG--
extra : rebase_source : 86a43837659aa2ad83a87eab53b7aa8d39ccf55b
2018-05-08 18:36:22 -07:00
Francois Marier
2e902f94dd Bug 1452445 - Promote MOZ_LOG calls to NS_WARNING in LookupCacheV4. r=gcp
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
2018-04-30 16:44:35 -07:00
Kris Maglione
a259026c9d Bug 1456035: Part 4 - Convert callers of XPCOMUtils.generateQI to ChromeUtils.generateQI. r=mccr8
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
2018-04-22 20:55:06 -07:00
Francois Marier
777fb5e47f Bug 1434662 - Move initialization code to ProtocolParser::Begin(). r=gcp
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
2018-04-24 10:08:56 +02:00
Francois Marier
10fe9ddbf2 Bug 1434662 - Remove dead code. r=gcp
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
2018-04-19 16:06:40 -07:00
Francois Marier
f197f28620 Bug 1434662 - Reset Safe Browsing V4 tables that fail to update. r=gcp
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
2018-04-12 10:11:30 -07:00
Andreea Pavel
3cfb05a97a Backed out 3 changesets (bug 1434662) for android and OS X mass failures at /builds/worker/workspace/build/src/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp:512 on a CLOSED TREE
Backed out changeset 983099e546d8 (bug 1434662)
Backed out changeset 39b9f46104ad (bug 1434662)
Backed out changeset 6f652d798a0c (bug 1434662)
2018-04-23 23:09:32 +03:00
Francois Marier
65577c0773 Bug 1434662 - Move initialization code to ProtocolParser::Begin(). r=gcp
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
2018-04-19 17:10:45 -07:00
Francois Marier
dcbfde282e Bug 1434662 - Remove dead code. r=gcp
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
2018-04-19 16:06:40 -07:00
Francois Marier
84d43505cb Bug 1434662 - Reset Safe Browsing V4 tables that fail to update. r=gcp
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
2018-04-12 10:11:30 -07:00
Sebastian Hengst
0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon
a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Francois Marier
6ceeccf211 Bug 1438671 - Remove the std::string wrapper in TableUpdateV4. r=gcp
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
2018-04-03 17:11:30 -07:00
Francois Marier
9ed88c3e97 Bug 1438671 - Add assertions to enforce the size of prefix strings. r=gcp
Also document the meaning of mPrimed in LookupCache.h.

MozReview-Commit-ID: 63GAHwU3Rx3

--HG--
extra : rebase_source : 11307604f957efbd6879db83f916a9cb369f93ff
2018-03-29 15:40:13 -07:00
Francois Marier
bac71f643b Bug 1438671 - Remove some inappropriate uses of dependent strings. r=gcp
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
2018-03-29 16:31:39 -07:00
Francois Marier
9b74d3b226 Bug 1438671 - Terminate tests early when updates fail. r=gcp
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
2018-03-27 16:29:02 -07:00
Francois Marier
e9564048ae Bug 1441211 - Use common prefix for all URL Classifier gtests. r=gcp
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
2018-04-05 15:09:03 -07:00
Boris Zbarsky
1151dd21cc Bug 1448398. Stop returning unwrapped Components.interfaces from SpecialPowers.Ci. r=kmag 2018-03-26 13:35:04 -04:00
Boris Zbarsky
dc4481c38d Bug 1448235. List the right support-files for the url-classifier chrome tests. r=francois 2018-03-25 22:17:21 -04:00
Tooru Fujisawa
1adba8c1fc Bug 1442465 - Part 4.2: Stop unnecessarily awaiting on BrowserTestUtils.removeTab (simple part). r=dao 2018-03-19 11:16:45 +09:00
Francois Marier
7d4feeefa4 Bug 1442486 - Mark LookupCacheV4 as primed after creating it. r=gcp
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
2018-03-01 18:09:58 -08:00
Francois Marier
b401105973 Bug 1439455 - Display error names instead of codes in about:url-classifier. r=gcp
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
2018-02-22 17:37:53 -08:00
Francois Marier
ef563d5e49 Bug 1439455 - Round timestamps up to nearest minute in log messages. r=gcp
MozReview-Commit-ID: DDv8smOelPQ

--HG--
extra : rebase_source : 883f230b90c27eb4dcfd1149ac7e4c1295b47d26
2018-02-22 14:21:41 -08:00
Florian Quèze
c714053d73 Bug 1433175 - scripted patch to replace Components.classes[, Components.interfaces.nsI, Components.utils. and Components.results. with Cc, Ci, Cu and Cr, r=Mossop. 2018-02-28 18:51:33 +01:00
Valentin Gosu
84b854ce2c Bug 1433958 - Change code that sets nsIURI.userPass to use nsIURIMutator r=mayhemer
* 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
2018-02-26 20:43:46 +01:00
Francois Marier
12e894132e Bug 1362761 - Improve logging in PrefixSet. r=gcp
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
2018-02-21 17:55:12 -08:00
Francois Marier
42aba66c3c Bug 1362761 - Add checksum to nsUrlClassifierPrefixSet::mIndexDeltas array. r=gcp
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
2018-02-15 16:59:14 -08:00
Florian Quèze
682b1ec3b2 Bug 1440284 - change this.EXPORTED_SYMBOLS back to var EXPORTED_SYMBOLS in JS modules, r=mccr8. 2018-02-23 20:50:01 +01:00
Dorel Luca
6ad641c5c4 Merge mozilla-inboud to mozilla-central. a=merge 2018-02-22 11:59:54 +02:00
Jason Orendorff
a48654929c Bug 1439665 - Part 1: #include some headers directly in files that use them. r=sfink.
"Include what you use."

--HG--
extra : rebase_source : 2239a380029e0efbc9dd3042459222a67c38d70f
extra : amend_source : 4453c32cc469caa592049167205666997f1a1e7b
extra : histedit_source : a533edd4a4d3d0642b08989e93674661d27baa6a%2C37d27eeef9580381ccc0de8507f60166dabf1730
2018-02-20 11:28:12 -06:00
Masatoshi Kimura
92e41502a6 Bug 1428258 - Stop using GetNativePath in url-classifier. r=mossop
MozReview-Commit-ID: 1pDfFN3NxrF

--HG--
extra : rebase_source : 35ebc6338c0a0501158a15f5db44f50472788890
extra : intermediate-source : 083e8b69855d9e4376fe10ee456eb38b7bdf5911
extra : source : 48214d0419573b861d72db1aebebebe18d860bd3
2017-12-16 22:48:29 +09:00
Francois Marier
79391b9eea Bug 1439468 - Improve error reporting in Safe Browsing protocol parser. r=gcp
MozReview-Commit-ID: JeyCZSbdZBd

--HG--
extra : rebase_source : 84007af04f9dea05503eb44203e40079e6c7252d
2018-02-20 13:54:30 -08:00
DimiL
6b0977cc01 Bug 1254323 - Reduce identical gethash requests done by the URL Classifier. r=gcp
MozReview-Commit-ID: KNNL1dBqXx0

--HG--
extra : rebase_source : fd18c3dac2a9fc331f78d492154283472ec2957d
2018-02-14 16:12:29 -08:00
Francois Marier
6d970e2d08 Bug 1435859 - Fix OOM crash on filenames without extensions. r=gcp
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
2018-02-15 12:30:40 -08:00
Francois Marier
8462db41d1 Bug 1433636 - Put a limit on the length of Safe Browsing metadata values. r=gcp
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
2018-01-30 14:21:33 -08:00
Jeremy Lempereur
97a98031cd Bug 1432791 - Remove the Microsecond AutoTimer resolution. r=Dexter
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
2018-02-07 21:11:22 +01:00
Francois Marier
8c3d3e2350 Bug 1436213 - Make test_bug1274685_unowned_list.js work on pver2 and pver4. r=gcp
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
2018-02-06 15:36:48 -08:00
Francois Marier
09c6a2d004 Bug 1435098 - Gate flashinfobar list on the plugins.show_infobar. r=bytesized,gcp
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
2018-02-02 13:30:28 -08:00
Andrew McCreight
5dec0e0beb Bug 1432992, part 1 - Remove definitions of Ci, Cr, Cc, and Cu. r=florian
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
2018-02-06 09:36:57 -08:00
Narcis Beleuzu
b78f4e424e Backed out changeset 3884f0f9f316 (bug 1435098) for xpcshell failures on /test_bug1274685_unowned_list.js. CLOSED TREE 2018-02-06 19:52:30 +02:00
Francois Marier
0e1e355ce9 Bug 1435098 - Gate flashinfobar list on the plugins.show_infobar. r=bytesized,gcp
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
2018-02-02 13:30:28 -08:00
Florian Quèze
2b1c8dccb6 Bug 1339461 - script-generated patch to convert foo.indexOf(...) == -1 to foo.includes(), r=Mossop. 2018-02-01 20:45:22 +01:00
Francois Marier
e6be1157ca Bug 1431192 - Only fetch download protection lists when Safe Browsing is enabled. r=gcp
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
2018-01-29 15:16:54 -08:00