Commit Graph

1160 Commits

Author SHA1 Message Date
Dustin J. Mitchell
451e3b63c2 Bug 1403519 - only build docs when necessary r=gps
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
2017-10-02 18:22:56 +00:00
Margareta Eliza Balazs
a773d5e139 Backed out changeset 6d539e4a02bd (bug 1403519) for lint failures on a CLOSED TREE 2018-01-11 22:32:27 +02:00
Dustin J. Mitchell
cb2823906c Bug 1403519 - only build docs when necessary r=gps
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
2017-10-02 18:22:56 +00:00
DimiL
1d55a14848 Bug 1407879 - Add testcase for login reputation service. r=francois
MozReview-Commit-ID: HhvPqTTz7pg
2018-01-04 09:14:15 +08:00
Florian Quèze
1838aa9e08 Bug 1421992 - script-generated patch to replace do_execute_soon, do_print and do_register_cleanup with executeSoon, info and registerCleanupFunction, rs=Gijs. 2017-12-21 11:10:23 +01:00
Florian Quèze
082ca8b2a3 Bug 1421992 - script-generated patch to replace do_check_* functions with their Assert.* equivalents, rs=Gijs. 2017-12-21 11:08:17 +01:00
Jonathan Kingston
6a9e88511d Bug 1419007 - ensure errors FireOnLocationChange after documentURI has changed in docshell. r=sawang r=francois
MozReview-Commit-ID: AaZEIOI4sW1
2017-11-21 11:40:01 +00:00
DimiL
47c5b9727a Bug 1421500 - Disable back-off for SafeBrowsing testcases not testing back-off. r=francois
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
2017-12-08 12:18:34 +08:00
Csoregi Natalia
7828fc1a71 Backed out changeset 2467ce87767e (bug 1421500) for ESLint failure /toolkit/components/url-classifier/nsUrlClassifierLib.js:108. r=backout on a CLOSED TREE 2017-12-14 04:38:07 +02:00
DimiL
8971ba69f6 Bug 1421500 - Disable back-off for SafeBrowsing testcases not testing back-off. r=francois
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
2017-12-08 12:18:34 +08:00
Sylvestre Ledru
f4df36cf34 Bug 1424867 - Fix some ignored-qualifiers warnings in url-classifier & reputationservice r=francois
MozReview-Commit-ID: 9lLifMbNlnO
2017-12-12 08:10:59 -06:00
Sylvestre Ledru
37064ac043 Bug 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium
MozReview-Commit-ID: 7duJk2gSd4m
2017-12-07 22:09:15 +01:00
Francois Marier
7cde82f87c Bug 1421803 - Send ThreatHit requests and telemetry at the right time. r=dimi
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
2017-11-28 12:10:37 -08:00
DimiL
8d18edd670 Bug 1416987 - Force an update when safebrowsing tables are changed in preference. r=francois,johannh
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
2017-11-29 10:33:26 +08:00
arthur.iakab
be731b745d Backed out changeset e0aaadf66179 (bug 1416987) Backing out eslint failures from file toolkit/components/url-classifier/nsUrlClassifierListManager.js:366:2 r=backout on a CLOSED TREE 2017-11-29 11:53:36 +02:00
DimiL
6644724ae8 Bug 1416987 - Force an update when safebrowsing tables are changed in preference. r=francois,johannh
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
2017-11-29 10:33:26 +08:00
Mark Banner
c6cb2b825a Bug 1412893 - Change instances of using getService to Services.jsm where possible in toolkit/components/url-classifier r=francois
MozReview-Commit-ID: 7ejzcckcwQ1
2017-10-31 20:22:58 +00:00
DimiL
bc172e210f Bug 1325888 - Clear cached completion result when close safebrowsing database. r=francois
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
2017-11-01 08:40:00 +08:00
Nicholas Nethercote
b627e2c831 Bug 1410794 (attempt 2) - Change some |string| occurrences in nsIPrefBranch.idl to |ACString|. r=erahm.
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
2017-10-27 10:30:33 +11:00
Mark Banner
e47ccbfec3 Bug 1411368 - Automatically fix no-multi-spaces issues raised when using ESLint 4. r=mossop
MozReview-Commit-ID: H5YVp3rnzGo
2017-10-26 11:47:01 +01:00
Andrea Marchesini
c9ad4ef15f Bug 1409329 - NS_NewBufferedOutputStream should take the ownership of the outputStream, r=smaug 2017-10-24 14:38:23 +02:00
DimiL
811c853e4f Bug 1362761 : Remove Compact from NIGHTLY build for debug purpose. r=francois
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
2017-10-11 16:56:06 +08:00
Francois Marier
af9d19f286 Bug 1385461 - Upgrade to the latest version of the protobuf library. r=dimi,fitzgen,glandium,mattwoodrow,mossop
The tarball that was imported is the 3.4.1 release:

  https://github.com/google/protobuf/releases/tag/v3.4.1
  https://github.com/google/protobuf/releases/download/v3.4.1/protobuf-cpp-3.4.1.tar.gz

This drops all of the customizations that are no longer needed,
which includes a few issues that were fixed upstream:

- r512.patch from bug 892856:

    https://searchfox.org/mozilla-central/rev/bab9dbe9c4ef71f71fb07e53b701fb2dfde277d9/toolkit/components/protobuf/r512.patch
    b04e5cba35/src/google/protobuf/io/zero_copy_stream_impl.cc (L43)

- vs2013.patch, also from bug 892856:

    https://searchfox.org/mozilla-central/rev/bab9dbe9c4ef71f71fb07e53b701fb2dfde277d9/toolkit/components/protobuf/vs2013.patch
    b04e5cba35/src/google/protobuf/wire_format_lite_inl.h (L39)

- sparc64 fixes in m-c-changes.patch from bug 1275204:

    https://hg.mozilla.org/integration/mozilla-inbound/rev/21d692e82582
    b04e5cba35/src/google/protobuf/stubs/platform_macros.h (L68)

The LOGLEVEL_ERROR hack in m-c-changes.patch from bug 1024774 and
bug 1320179 was replaced by a NOGDI define in moz.build as suggested
by upstream:

    https://github.com/google/protobuf/pull/3745/files#r144915445

The other customizations that were dropped came from bug 1024774.

The patch for OpenBSD/32-bit will likely be fixed upstream in a
future release:

    https://github.com/google/protobuf/pull/3747#issuecomment-336581244

Upgrading the protobuf library also required re-generating all
of the existing .pb.h and pb.cc files (they are neither forward
nor backward-compatible) and making adjustments to the build
config to make it compile (and silence warnings).

text_format.cc can now be compiled as part of UNIFIED_SOURCES.

MozReview-Commit-ID: 7F2IqFmwQnN
2017-10-18 15:02:05 -07:00
Francois Marier
d682ea8c54 Bug 1385461 - Move URL Classifier protobuf files to match other components. r=dimi
MozReview-Commit-ID: 5N1iOpocVd8
2017-10-12 17:27:36 -07:00
Masatoshi Kimura
e29c3d5a3e Bug 1313150 - Remove |weak| parameter from nsIMutableArray methods. r=froydnj
MozReview-Commit-ID: 7JoD4VYzZp3
2017-10-21 23:53:02 +09:00
dimi
603431b0dd Bug 1408631 - Release SafeBrowsing lookupcache in worker thread while shutdown. r=francois
MozReview-Commit-ID: HuPUyIDFLPX
2017-10-20 10:18:59 +08:00
Andrea Marchesini
304820957d Bug 1409327 - NS_NewBufferedInputStream should take the ownership of the inputStream, r=smaug 2017-10-19 11:39:30 +02:00
Sebastian Hengst
9687c5d0ea merge mozilla-central to autoland. r=merge a=merge on a CLOSED TREE 2017-10-18 15:54:23 +02:00
Sebastian Hengst
1817891a1a Backed out changeset 03e4f9175b16 (bug 1409329) 2017-10-17 22:03:39 +02:00
Sebastian Hengst
e60b9b46c6 Backed out changeset 4666cde20909 (bug 1409327) 2017-10-17 22:03:33 +02:00
Boris Zbarsky
909ee9255d Bug 1409152. Add an nsTArray::ContainsSorted method. r=froydnj 2017-10-17 15:39:59 -04:00
Andrea Marchesini
715c7ec659 Bug 1409327 - NS_NewBufferedInputStream should take the ownership of the inputStream, r=smaug 2017-10-17 20:38:05 +02:00
Andrea Marchesini
47c73656be Bug 1409329 - NS_NewBufferedOutputStream should take the ownership of the outputStream, r=smaug 2017-10-17 20:38:05 +02:00
DimiL
ea91ca0372 Bug 1408396 - Fix a deadlock issue when about:url-classifier accesses GetCacheInfo API. r=francois
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
2017-10-18 09:11:26 +08:00
Kris Maglione
60872d7b31 Bug 1404198: Part 2f - Switch to NS_NewTimer* in toolkit. r=njn
MozReview-Commit-ID: 185rZ99R6zV
2017-10-15 23:14:00 -07:00
Dan Banner
5af4450327 Bug 1408777 - Automatically fix instances of missing semicolons in the tree. r=Standard8
MozReview-Commit-ID: Jm8BRgt6mIv
2017-10-15 20:50:39 +01:00
DimiL
86a5503774 Bug 1384405 - Dump request payload for V2 400 responses. r=francois
Refactor SafeBrowsing code so we can get the payload of gethash/update request when
updates fail.

MozReview-Commit-ID: NB1oacd185
2017-10-05 08:37:29 +08:00
Thomas Nguyen
141b95e424 Bug 1389315 - Isolate Safe Browsing completions cached by each provider. r=francois
MozReview-Commit-ID: INiuM5ydv2f
2017-09-14 17:05:52 +08:00
Thomas Nguyen
f6a10d5488 Bug 1403473 - Init loggingEnable for hashcompleter r=dimi
MozReview-Commit-ID: 1BpErwmbgCM
2017-09-27 16:49:02 +08:00
Thomas Nguyen
da894bb42f Bug 1351147 - Support ThreatHit requests in SafeBrowsing V4 r=francois
MozReview-Commit-ID: 3ifQtdOTulE
2017-08-24 11:13:12 +08:00
Thomas Nguyen
4c384705a8 Bug 1351147 - Use fullhash instead of prefix in OnClassifyComplete r=francois
In order to optionally report the full hash back to Google, we need to keep it
around in the callback. While a prefix is not the same as a full hash (multiple
full hashes can map to the same prefix), in this case, the callback will only be
called when the full hash matches.

MozReview-Commit-ID: F4WSLZpYrXB
2017-08-04 18:20:13 +08:00
Thomas Nguyen
56106b45fc Bug 1351147 - Update protobuf to support threatHit api r=francois
MozReview-Commit-ID: IzjnWnNupvH
2017-08-04 15:50:18 +08:00
Thomas Nguyen
cf69fcf897 Bug 1401066 - Add poison canary to check for errors. r=francois
MozReview-Commit-ID: GpTDMR5Ni3e
2017-09-25 10:57:20 +08:00
Chris Peterson
11b00c1394 Bug 870698 - Part 5: Replace Assign(NS_LITERAL_CSTRING("")) with AssignLiteral(""). r=erahm
The NS_LITERAL_CSTRING macro creates a temporary nsLiteralCString to encapsulate the string literal and its length, but AssignLiteral() can determine the string literal's length at compile-time without nsLiteralCString.

MozReview-Commit-ID: KXJM13VRTB7
2017-09-06 01:35:56 -07:00
Chris Peterson
ce551e51b9 Bug 870698 - Part 4: Replace Equals("") with EqualsLiteral(""). r=erahm
MozReview-Commit-ID: G1GhyvD29WK
2017-09-06 01:13:45 -07:00
Chris Peterson
6137e4ff8b Bug 870698 - Part 2: Replace Append("") with AppendLiteral(""). r=erahm
MozReview-Commit-ID: CrkIP4iHP1U
2017-09-03 22:14:11 -07:00
Prathiksha
576a3dfdb1 Bug 1363051 - Update about:blocked page visuals and copy. r=francois,johannh
MozReview-Commit-ID: CK2cO5Ikivt
2017-09-04 19:25:05 +05:30
Thomas Nguyen
71a001d62e Bug 1394031 - Remove mCryptoHash members of nsUrlClassifierDBServiceWorker and ProtocolParser
The usage of cryptoHash consists of a complete set of Init, Update, and Finish, there's
no reason to keep it around

MozReview-Commit-ID: 7bT9IsWEM5m
2017-09-14 10:51:55 +08:00
Andrew McCreight
ed0e2f0913 Bug 1186409 - Use Cu.getGlobalForObject when importing properties off a JSM global. r=kmag
With JSM global sharing, the object returned by Cu.import() is a
NonSyntacticVariablesObject, rather than a global. Various code tries
to use properties from a JSM global via an import.

Cu.importGlobalProperties can also be used in some places.

MozReview-Commit-ID: HudCXO2GKN0
2017-06-23 13:51:14 -07:00
Thomas Nguyen
b2373700f4 Bug 1397231 - Skip new URLClassifierLocalChild when ContentChild is shutting down r=Ehsan
MozReview-Commit-ID: HRv5DpiPwmB
2017-09-07 16:16:43 +08:00