Commit Graph

1144 Commits

Author SHA1 Message Date
Mark Banner
aef9c37979 Bug 1412893 - Change instances of using getService to Services.jsm where possible in toolkit/components/url-classifier r=francois
MozReview-Commit-ID: 7ejzcckcwQ1

--HG--
extra : rebase_source : 72eca0da3d8a0c125958c6272fb15edfbb122549
2017-10-31 20:22:58 +00:00
DimiL
fb631be6ce 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

--HG--
extra : rebase_source : 90861060437d6cef860b85dd669d76e74ceec660
2017-11-01 08:40:00 +08:00
Nicholas Nethercote
9252435548 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

--HG--
extra : rebase_source : e6e4b15d6d210cfd93686f96400281f02bd1d06b
2017-10-27 10:30:33 +11:00
Mark Banner
4de6bf22b1 Bug 1411368 - Automatically fix no-multi-spaces issues raised when using ESLint 4. r=mossop
MozReview-Commit-ID: H5YVp3rnzGo

--HG--
extra : rebase_source : 5b45b6c0df834131812d094e975047eaad374e06
2017-10-26 11:47:01 +01:00
Andrea Marchesini
ec610d5b7e Bug 1409329 - NS_NewBufferedOutputStream should take the ownership of the outputStream, r=smaug 2017-10-24 14:38:23 +02:00
DimiL
0327430fc7 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

--HG--
extra : rebase_source : 1be0d12e9d1de7f249c509cfa016bb26242cbdc7
2017-10-11 16:56:06 +08:00
Francois Marier
7f48d0bdd3 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

--HG--
extra : rebase_source : b907a28a8063ecd82bb38530d309faafc7b83175
2017-10-18 15:02:05 -07:00
Francois Marier
a6fa4cc3ef Bug 1385461 - Move URL Classifier protobuf files to match other components. r=dimi
MozReview-Commit-ID: 5N1iOpocVd8

--HG--
rename : toolkit/components/url-classifier/protobuf/safebrowsing.pb.cc => toolkit/components/url-classifier/chromium/safebrowsing.pb.cc
rename : toolkit/components/url-classifier/protobuf/safebrowsing.pb.h => toolkit/components/url-classifier/chromium/safebrowsing.pb.h
extra : rebase_source : c000be268c5747ae38c0db8704cf3009bd4756d8
2017-10-12 17:27:36 -07:00
Masatoshi Kimura
dbd92543c6 Bug 1313150 - Remove |weak| parameter from nsIMutableArray methods. r=froydnj
MozReview-Commit-ID: 7JoD4VYzZp3

--HG--
extra : rebase_source : 5db437f1c34608aa223916874d62b48c59baeae8
2017-10-21 23:53:02 +09:00
dimi
48a63f5601 Bug 1408631 - Release SafeBrowsing lookupcache in worker thread while shutdown. r=francois
MozReview-Commit-ID: HuPUyIDFLPX

--HG--
extra : rebase_source : d6e4f5bbcf96c97541792e23447f0810150c5ac9
2017-10-20 10:18:59 +08:00
Andrea Marchesini
6626e900f9 Bug 1409327 - NS_NewBufferedInputStream should take the ownership of the inputStream, r=smaug 2017-10-19 11:39:30 +02:00
Sebastian Hengst
ffcd2ce160 merge mozilla-central to autoland. r=merge a=merge on a CLOSED TREE
--HG--
extra : amend_source : ef359be373a97cad5a91f0150a46add4c3d8ab7c
2017-10-18 15:54:23 +02:00
Sebastian Hengst
b1cdb2af00 Backed out changeset 03e4f9175b16 (bug 1409329) 2017-10-17 22:03:39 +02:00
Sebastian Hengst
66e04dcde6 Backed out changeset 4666cde20909 (bug 1409327) 2017-10-17 22:03:33 +02:00
Boris Zbarsky
fb684cc726 Bug 1409152. Add an nsTArray::ContainsSorted method. r=froydnj 2017-10-17 15:39:59 -04:00
Andrea Marchesini
d526801916 Bug 1409327 - NS_NewBufferedInputStream should take the ownership of the inputStream, r=smaug 2017-10-17 20:38:05 +02:00
Andrea Marchesini
fe04c2050c Bug 1409329 - NS_NewBufferedOutputStream should take the ownership of the outputStream, r=smaug 2017-10-17 20:38:05 +02:00
DimiL
e18e651af1 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

--HG--
extra : rebase_source : 4d1ec1b7fd960cdf90bca577879b41fbbc2a4e17
2017-10-18 09:11:26 +08:00
Kris Maglione
6eccf17f33 Bug 1404198: Part 2f - Switch to NS_NewTimer* in toolkit. r=njn
MozReview-Commit-ID: 185rZ99R6zV

--HG--
extra : rebase_source : 5af93b6f4b115be6b970563aedc94ec8a65f527d
2017-10-15 23:14:00 -07:00
Dan Banner
7caa92d5d8 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
e246eef04f 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

--HG--
extra : rebase_source : 87e7ce94fd5cde9697946a00de90a821e5561168
2017-10-05 08:37:29 +08:00
Thomas Nguyen
d721de8d81 Bug 1389315 - Isolate Safe Browsing completions cached by each provider. r=francois
MozReview-Commit-ID: INiuM5ydv2f

--HG--
extra : rebase_source : 376fa8f04d850d23e8de908e8a3484350269a671
2017-09-14 17:05:52 +08:00
Thomas Nguyen
f00e12c4b7 Bug 1403473 - Init loggingEnable for hashcompleter r=dimi
MozReview-Commit-ID: 1BpErwmbgCM

--HG--
extra : rebase_source : 784991ded277860318c3d91e34e4aca0b7eaf105
2017-09-27 16:49:02 +08:00
Thomas Nguyen
1b74e11955 Bug 1351147 - Support ThreatHit requests in SafeBrowsing V4 r=francois
MozReview-Commit-ID: 3ifQtdOTulE

--HG--
extra : rebase_source : d9854fba4e2dcbb7310ca73fec3305ba32bbb7ae
2017-08-24 11:13:12 +08:00
Thomas Nguyen
651c28ca53 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

--HG--
extra : rebase_source : da3b16b00729d0aa6ff1765a135b751fcf44c012
2017-08-04 18:20:13 +08:00
Thomas Nguyen
1079b29408 Bug 1351147 - Update protobuf to support threatHit api r=francois
MozReview-Commit-ID: IzjnWnNupvH

--HG--
extra : rebase_source : 0fc5168e614112e562564336502afe25db7b0a03
2017-08-04 15:50:18 +08:00
Thomas Nguyen
1b29ddae7a 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
47e9fa9ec2 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

--HG--
extra : rebase_source : 3e50b1b3f23248d668d15310554559c39ff792f7
extra : source : 74f5e05877d50a79ec1e5330c227d2ce576a2d90
2017-09-06 01:35:56 -07:00
Chris Peterson
a0c8081df4 Bug 870698 - Part 4: Replace Equals("") with EqualsLiteral(""). r=erahm
MozReview-Commit-ID: G1GhyvD29WK

--HG--
extra : rebase_source : 115842c37a40041bdca7b4e1ff0a5680b02ced15
extra : source : 90bfff9c01d80086cdc17637f310e898fea295ea
2017-09-06 01:13:45 -07:00
Chris Peterson
45aa2a8e8e Bug 870698 - Part 2: Replace Append("") with AppendLiteral(""). r=erahm
MozReview-Commit-ID: CrkIP4iHP1U

--HG--
extra : rebase_source : 5dc4e91a3f1860773c199f1abf3f66479218834a
extra : intermediate-source : ba51cc79847f2b43ba616f4a5d2bbc6958ca9f6d
extra : source : 1fda2fa990cc918c748ffa14fcc5dbe13fe3bdc3
2017-09-03 22:14:11 -07:00
Prathiksha
86d7bac5f6 Bug 1363051 - Update about:blocked page visuals and copy. r=francois,johannh
MozReview-Commit-ID: CK2cO5Ikivt

--HG--
extra : rebase_source : 01da86303c4aa20961be609c7f45db39bf7e9f7b
2017-09-04 19:25:05 +05:30
Thomas Nguyen
e70d76485c 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
bfd580fb71 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

--HG--
extra : rebase_source : 6b5fa6f5509397504cb461a761f6cc2399f18c40
2017-06-23 13:51:14 -07:00
Thomas Nguyen
a8c2c418b0 Bug 1397231 - Skip new URLClassifierLocalChild when ContentChild is shutting down r=Ehsan
MozReview-Commit-ID: HRv5DpiPwmB

--HG--
extra : rebase_source : d5ffe6d1f9520a9031e9c5112e1bc424cf366407
2017-09-07 16:16:43 +08:00
Thomas Nguyen
dd42019824 Bug 1385609 - Fix backoff issue that makes SB lists no longer update r=francois
The issue occurs when nsITimer is fired earlier than the backoff time. In that
case, the update doesn't proceed and we never make another attempt because the
backoff update timer was oneshot.

We fix the issue in two ways:

- Add a tolerance of 1 second in case the timer fires too early.
- Set another oneshot timer whenever we are prevented from updating due to
backoff.

MozReview-Commit-ID: E2ogNRsHJVK

--HG--
extra : rebase_source : c81fa77934f6c39e1c5d07b19785a01546e02542
2017-08-30 18:04:10 +08:00
Sebastian Hengst
34e6bbd998 Backed out changeset 14b4af261515 (bug 1385609) for eslint failures in nsUrlClassifierLib.js. r=backout 2017-09-05 19:04:43 +02:00
Thomas Nguyen
9088e7a39b Bug 1395411 - Unregister tables when they're removed from urlclassifier.*Table. r=francois
MozReview-Commit-ID: Ex1ZxMcJLep

--HG--
extra : rebase_source : a200c02b536874a5a4255087b42d7074f5de3b43
2017-08-31 18:46:23 +08:00
Thomas Nguyen
a26ed706a3 Bug 1385609 - Fix backoff issue that makes SB lists no longer update r=francois
The issue occurs when nsITimer is fired earlier than the backoff time. In that
case, the update doesn't proceed and we never make another attempt because the
backoff update timer was oneshot.

We fix the issue in two ways:

- Add a tolerance of 1 second in case the timer fires too early.
- Set another oneshot timer whenever we are prevented from updating due to
backoff.

MozReview-Commit-ID: E2ogNRsHJVK

--HG--
extra : rebase_source : 17aa70d8583cc84e28e57410de66eaac63bd18bb
2017-08-30 18:04:10 +08:00
Sebastian Hengst
2283a8f642 Backed out changeset 7bb00f5e0120 (bug 1395411) for eslint failures in test_classifier_changetablepref_bug1395411.html: 'classifierHelper' is not defined. r=backout 2017-09-04 16:45:35 +02:00
Thomas Nguyen
d46c8b2c9d Bug 1395411 - Unregister tables when they're removed from urlclassifier.*Table. r=francois
MozReview-Commit-ID: Ex1ZxMcJLep

--HG--
extra : rebase_source : ceb099b7132ef0167c75b111bf3105714ae8ee92
2017-08-31 18:46:23 +08:00
Thomas Nguyen
1f57fdb85d Bug 1345058 - Asynchronously decide if a flash document should be blocked. r=baku
MozReview-Commit-ID: K91cSvIdOrb

--HG--
extra : rebase_source : 4d91ab3499c0124129e74a054c5cc78882ff351e
2017-08-14 14:05:23 +08:00
Steve Armand
c94baecadb Bug 1343843 - Remove unused chrome://global/content/url-classifier/unittests.xul. r=standard8
MozReview-Commit-ID: IMiDbyPu5n9

--HG--
extra : rebase_source : 69c6a17e95a9582d7541b1c25993ec418bdc9d63
2017-09-01 23:31:57 -04:00
Francois Marier
530db90579 Bug 1395733 - Ensure the default value of urlclassifier.malwareTable is always sorted. r=gcp
MozReview-Commit-ID: 10M2ZpDyAI9

--HG--
extra : rebase_source : 4523a0a1fd3adbdc8f0c13676548409ee9536f06
2017-08-31 14:54:11 -07:00
Francois Marier
99cb2b5a18 Bug 1394601 - Log an error when the Google API key is missing during Safe Browsing initialization. r=gcp
MozReview-Commit-ID: DNwa9lR0J6K

--HG--
extra : rebase_source : 0a547c0cf88e1ed09268cbb810abaaca09e98531
2017-08-28 17:06:00 -07:00
Eric Rahm
9398bd6f43 Bug 1393235 - Fix improper usages of string functions. r=njn
This fixes usages of `Find`, `RFind` and the equality operator that kind of
work right now but will break with the proper type checking of a templatized
version of the string classes.

For `Find` and `RFind` it appears that `nsCString::(R)Find("foo", 0)` calls
were being coerced to the `Find(char*, bool, int, int)` versions. The intent was
probably to just start searching from position zero.

For the equality operator, the type of nullptr is nullptr_t rather than
char(16_t)* so we'd need to add an operator overload that takes nullptr_t. In
this case just using `IsVoid` is probably more appropriate.

--HG--
extra : rebase_source : 50f78519084012ca669da0a211c489520c11d6b6
2017-08-22 19:30:46 -07:00
Francois Marier
a014fe4f74 Bug 1388574 - Use the correct pref to gate the Application Reputation lists. r=hchang
MozReview-Commit-ID: 1ZuxnbgsOMX

--HG--
extra : rebase_source : 4984101882f1cfc16d07df78752c1a5aa18fadb4
2017-08-23 13:40:50 -07:00
Thomas Nguyen
9d1887c28c Bug 1363038 - Remove synchronous dispatch when worker is racing against shutdown r=hchang
MozReview-Commit-ID: JOkOukz1fov

--HG--
extra : rebase_source : 9e4204cebcd4615078019a51818250ff8125efe1
2017-08-22 14:51:44 +08:00
Henry Chang
ed11934666 Bug 1392204 - Disable goog-badbinurl-proto and goog-downloadwhite-proto on Fennec. r=francois
Version 4 of the Google Safe Browsing server will return a 404 if any of the
application reputation lists are requested on Android. As a result, we should
avoid these threat types from being sent along with ANDROID_PLATFORM.

MozReview-Commit-ID: 6TUBVxe455y

--HG--
extra : rebase_source : dee095c008f4d328f359c66d20f0cc2dfcd109f3
extra : source : 5d6338807c6b21b7672236cac01b13bd75155225
2017-08-22 12:20:57 +08:00
Francois Marier
adc9339128 Bug 1385484 - Add the login reputation whitelist behind a pref. r=hchang
MozReview-Commit-ID: Dbtl3WL5tMJ

--HG--
extra : rebase_source : d56e3db985865d0b513184d8ad41e2b750e7733e
2017-08-08 16:23:10 -07:00
Francois Marier
6fcbb94e82 Bug 1385484 - Cleanup Safe Browsing prefs and sync the download protection setting. r=hchang
MozReview-Commit-ID: B42p2Gw8y9i

--HG--
extra : rebase_source : ecc00c8251814783bbe5e9ea911ad034a9a3a9b0
2017-08-08 15:52:29 -07:00