Commit graph

69 commits

Author SHA1 Message Date
Andrea Marchesini
c607e645dc Bug 1528596 - Devirtualize accesses to nsUrlClassifierUtils, r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D20086

--HG--
extra : moz-landing-system : lando
2019-02-19 14:35:57 +00:00
Ehsan Akhgari
9efcce8bbb Bug 1509112 - Consider the content frame sitting directly beneath a moz-extension frame that has a host permission granting access to that frame as a top-level frame; r=kmag,baku
Differential Revision: https://phabricator.services.mozilla.com/D14832

--HG--
extra : moz-landing-system : lando
2019-01-23 14:55:49 +00:00
Andrea Marchesini
69926deea6 Bug 1511436 - Cleanup URL-Classifier code - part 1 - nsIUrlClassifierFeature, r=dimi
--HG--
rename : netwerk/base/nsChannelClassifier.cpp => netwerk/url-classifier/nsChannelClassifier.cpp
rename : netwerk/base/nsChannelClassifier.h => netwerk/url-classifier/nsChannelClassifier.h
rename : netwerk/base/nsIURIClassifier.idl => netwerk/url-classifier/nsIURIClassifier.idl
2018-12-14 12:40:16 +01:00
Sylvestre Ledru
265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Francois Marier
0d94ae0826 Bug 1441345 - Force the use of the Linux phishing list on Android. r=dimi
Reviewers: dimi

Reviewed By: dimi

Subscribers: dveditz, francois, dimi

Bug #: 1441345

Differential Revision: https://phabricator.services.mozilla.com/D5479

--HG--
extra : rebase_source : 946456a9a26ebfe9da5cff684ee980608e523fa2
extra : amend_source : fc77978685ef2ecd57d35b17db05e185839a3f22
2018-09-12 18:07:26 +03:00
Henri Sivonen
e262584728 Bug 1485342 - Avoid isdigit() and isxdigit() in URL classifier. r=francois
MozReview-Commit-ID: IvadP10PFEZ

Differential Revision: https://phabricator.services.mozilla.com/D4312

--HG--
extra : moz-landing-system : lando
2018-08-27 15:55:13 +00: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
DimiL
316d8a2562 Bug 1407879 - Add testcase for login reputation service. r=francois
MozReview-Commit-ID: HhvPqTTz7pg

--HG--
extra : rebase_source : 67b87e0e6265cce47902ea586e40b32780b2319f
2018-01-04 09:14:15 +08:00
Jonathan Kingston
d592ba8cc6 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
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
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
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
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
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
Wes Kocher
207dd28c61 Backed out 4 changesets (bug 1385484) for build failures a=backout
Backed out changeset 401c2744f16b (bug 1385484)
Backed out changeset 2ff443a0c744 (bug 1385484)
Backed out changeset 1a1c476a9aaa (bug 1385484)
Backed out changeset 87ec064a3681 (bug 1385484)

MozReview-Commit-ID: D9WGXiXaNoZ

--HG--
extra : rebase_source : ebab6135905e972abf7eeab9af8db41454687373
2017-08-22 17:22:41 -07:00
Francois Marier
542d943dc4 Bug 1385484 - Add the login reputation whitelist behind a pref. r=hchang
MozReview-Commit-ID: Dbtl3WL5tMJ

--HG--
extra : rebase_source : 8f163e6871559a36e02b2c576970b4f1624da3b4
2017-08-08 16:23:10 -07:00
Francois Marier
7a9673e542 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
Nicholas Nethercote
8a72cf2251 Bug 1390428 (part 2, attempt 2) - Remove more nsXPIDLCString local variables. r=erahm.
--HG--
extra : rebase_source : 69d58b0cfb56efc6b03d8e2d7be2ce3c3e6cd843
2017-08-21 20:01:27 +10:00
Henry Chang
4950f839d2 Bug 1388582 - Skip unsupported threat types on current platform while making v4 request. r=francois
MozReview-Commit-ID: FTmOMQ339ZL

--HG--
extra : rebase_source : ea41ae42dc2faa9bab040018b4ee3a1ade49ed69
2017-08-16 15:30:20 +08:00
Nicholas Nethercote
025461bde7 Bug 1390428 (part 1) - Remove many nsXPIDLCString local variables. r=erahm.
These are all easy cases where an nsXPIDLCString local variable is set via
getter_Copies() and then is only used in ways that nsCStrings can also be used
(i.e. no null checks or implicit conversions to |char*|).

In every case the patch trivially replaces the nsXPIDLCString with an
nsCString. (Also, there are a couple of unused nsXPIDLCString variables that
the patch simply removes.)
2017-08-16 13:58:35 +10:00
Henry Chang
af3b11c151 Bug 1375277 - New safebrowsing threat type "POTENTIALLY_HARMFUL_APPLICATION" introduced by v4. r=francois
As our threattype-listname conversion design, "goog-harmful-proto" is allocated
for this new threat type. This threat type is mainly for mobile.

MozReview-Commit-ID: G9GbgmHHHfp

--HG--
extra : rebase_source : 0681fcd9322b94451a86eafe57bf1ccc4b89db30
extra : intermediate-source : 28b0502d9add81beeae58a2c33f9fd5839d4d544
extra : source : 646f02f15131aa98ad37015b0a641304a3271796
2017-07-27 15:37:57 +08:00
Masatoshi Kimura
f143125cc2 Bug 1326520 - Rename nsIURI.path to pathQueryRef. r=valentin.gosu
MozReview-Commit-ID: DqJdTGopR9G

--HG--
extra : rebase_source : e8c9eb03468c075b79013b6e0bd8b367229c24cd
2017-07-29 20:50:21 +09:00
Sylvestre Ledru
7c0ae251cd Bug 1381253 - Remove redundant control flow declarations rs=ehsan
MozReview-Commit-ID: FFxP4aMCbOL

--HG--
extra : amend_source : 3aec108430b11048f47ffe19d5da7ac5034770a9
2017-07-15 19:03:04 +02:00
Nathan Froyd
a7e99ae521 Bug 1378387 - use dependent strings in the url-classifier where possible; r=gcp
Doing this makes various operations more efficient, as we don't have to
allocate, copy strings, and deallocate needlessly.  The remaining
instances of nsCString temporaries are in logging code, which didn't
seem worthwhile to deal with here.
2017-07-06 15:26:12 -04:00
Francois Marier
9f3d9fa798 Bug 1376024 - Whitelist more known Safe Browsing providers for telemetry purposes. r=dimi
MozReview-Commit-ID: 6Dd1eDSJlzT

--HG--
extra : rebase_source : 3ffc44da6676e5cac993d7bdab12c821e995f1ca
2017-06-23 17:00:45 -07:00
Francois Marier
6d8aa577bc Bug 1362501 - Use LINUX_PLATFORM for Safe Browsing on non-Windows and non-OSX platforms. r=gcp
MozReview-Commit-ID: 58059M8IhL

--HG--
extra : rebase_source : 605969481758e175c078dbd48083467649bdf1a2
2017-05-05 11:38:38 -07:00
DimiL
c18e9c758a Bug 1357207 - Caching duration recorded to telemetry should be milli-second . r=francois
In Bug 1311935, We change positive/negative cache duration from milli-second to second.
But the value doesn't covert back to milli-second when store to telemetry(telemetry use
milli-second).

MozReview-Commit-ID: KR6xn9pwhUd

--HG--
extra : rebase_source : 378149dc29d61cbca31b8aa913df946ceff556f3
2017-04-18 12:01:09 +08:00
dimi
127351f6ef Bug 1311935 - P2. Process fullHashes.find response. r=francois
This patch includes following changes:

1. nsUrlClassifierHashCompleter.js
   nsUrlClassifierHashCompleter.idl
   - Add completionV4 interface for hashCompleter to pass response data to
     DB service.
   - Process response data includes negative cache duration, matched full
     hashes and cache duration for each match. Full matches are passed through
     nsIFullHashMatch interface.
   - Change _requests.responses from array contains matched fullhashes to
     dictionary so that it can store additional information likes negative cache
     duration.
2. nsUrlClassifierDBService.cpp
   - Implement CompletionV4 interface, store response data to CacheResultV4
     object. Expired duration to expired time is handled here.
   - Add CacheResultToTableUpdate function to convert V2 & V4 cache result
     to TableUpdate object.
3. LookupCache.h
   - Extend CacheResult to CacheResultV2 and CacheResultV4 so we can store
     response data in CompletionV2 and CompletionV4.
4. HashStore.h
   - Add API and member variable in TableUpdateV4 to store response data.
     TableUpdate object is used by DB service to pass update data or gethash
     response to Classifier, so we need to extend TableUpdateV4 to be able
     to store fullHashes.find response.
6. Entry.h
   - Define the structure about how we cache fullHashes.find response.

MozReview-Commit-ID: FV4yAl2SAc6

--HG--
extra : rebase_source : 02676ded9bc0580c24b4c906199a4abaf004e296
2017-04-11 11:50:48 +08:00
Iris Hsiao
3d85c0330d Backed out 4 changesets (bug 1311935) for causing assertion crash by developer's request
Backed out changeset 27e624cd9479 (bug 1311935)
Backed out changeset 4c0381ab0990 (bug 1311935)
Backed out changeset 73587838ef16 (bug 1311935)
Backed out changeset a5a6c0f79733 (bug 1311935)
2017-04-11 11:04:54 +08:00
dimi
5112db082c Bug 1311935 - P2. Process fullHashes.find response. r=francois
This patch includes following changes:

1. nsUrlClassifierHashCompleter.js
   nsUrlClassifierHashCompleter.idl
   - Add completionV4 interface for hashCompleter to pass response data to
     DB service.
   - Process response data includes negative cache duration, matched full
     hashes and cache duration for each match. Full matches are passed through
     nsIFullHashMatch interface.
   - Change _requests.responses from array contains matched fullhashes to
     dictionary so that it can store additional information likes negative cache
     duration.
2. nsUrlClassifierDBService.cpp
   - Implement CompletionV4 interface, store response data to CacheResultV4
     object. Expired duration to expired time is handled here.
   - Add CacheResultToTableUpdate function to convert V2 & V4 cache result
     to TableUpdate object.
3. LookupCache.h
   - Extend CacheResult to CacheResultV2 and CacheResultV4 so we can store
     response data in CompletionV2 and CompletionV4.
4. HashStore.h
   - Add API and member variable in TableUpdateV4 to store response data.
     TableUpdate object is used by DB service to pass update data or gethash
     response to Classifier, so we need to extend TableUpdateV4 to be able
     to store fullHashes.find response.
6. Entry.h
   - Define the structure about how we cache fullHashes.find response.

MozReview-Commit-ID: KgR1NASl7GC

--HG--
extra : rebase_source : 424db14e4af2ffd691c384414d50f64083d5d20b
2017-04-10 16:20:09 +08:00
Thomas Nguyen
41511788f2 Bug 1331139 - Enable download protection for V4 lists. r=francois
MozReview-Commit-ID: 8IHKGvXQjPt

--HG--
extra : rebase_source : da86fa38df68be976f482e2a4033b2e668e97850
2017-02-27 12:18:33 +08:00
dimi
154a17d29f Bug 1338082 - Add telemetry probes to track the positive and negative cache durations in V4. r=francois
MozReview-Commit-ID: 43Nf5bS2Uo

--HG--
extra : rebase_source : 909db55a9421c2fe55d29c10070bd4e104fd0692
2017-02-20 10:25:18 +08:00
Nathan Froyd
27c2477d25 Bug 1339556 - remove nsUrlClassifierUtils::Charmap; r=gcp
The current code doesn't use Charmap.
2017-02-15 09:29:42 -05:00
Thomas Nguyen
fdfc58a406 Bug 1329558 - Implement Minimum wait duration for V4 gethash r=francois
MozReview-Commit-ID: 7i9Wz7pq0yJ

--HG--
extra : rebase_source : a02c2e3cbd5f535192f5dbaadabce16abd6bb35f
2017-02-09 16:56:44 +08:00
DimiL
46e51631a9 Bug 1331881 - Minimum wait duration and negative cache duration should be passed even if there is no match. r=francois,henry
MozReview-Commit-ID: K5RcpmiXFYR

--HG--
extra : rebase_source : 7d9c48c658fc04b0430965e93476063d3cff4a7f
2017-01-18 17:34:03 +08:00
Dimi Lee
9907b239c2 Bug 1332770 - Fix the google4 provider is showing up as other in some telemetry pings. r=francois
MozReview-Commit-ID: KbpYAnf6qxd

--HG--
extra : rebase_source : fe524ca5afbd1b8b08b80198eeb43db5f84f677e
2017-01-27 18:02:36 +08:00
Henry Chang
758d80f10b Bug 1276826 - Part 2. Send gethash request and handle gethash response for v4. r=francois
MozReview-Commit-ID: 6fIbN6a6gHI

--HG--
extra : rebase_source : d64a2b4f85b24aac0a847a46748b3b3fdf0db749
extra : intermediate-source : c486204319c1afc158b871bad7edd2f7a565022a
extra : source : adf76dccec9d51df0d3a659ffa3dd201d8115bc4
2016-11-28 14:55:36 +08:00
Henry Chang
156d495c02 Bug 1276826 - Part 1. Implement function to build FindFullHash request for v4. r=francois
MozReview-Commit-ID: 6hi97T9Jk7s

--HG--
extra : rebase_source : 88230951465e3efc94c2d2efa6d28540e7937c09
2016-11-28 14:54:49 +08:00
Thomas Nguyen
bb51dce698 Bug 1315893 - Add telemetry to measure update time for V2 and V4. r=francois
MozReview-Commit-ID: KtrVJXHXMo

--HG--
extra : rebase_source : 6aa4d0fd01afd24e9e45f55a5d45da255962ca92
2016-11-24 11:13:54 +08:00
Henry Chang
1a53231595 Bug 1315097 - Build the provider dictionary on the main thread to be used everywhere. r=francois,gcp
MozReview-Commit-ID: Ft1deSNKuVB

--HG--
extra : rebase_source : 0cf746b1d2def35606f012c994ddbda0857ccf2d
2016-11-04 17:54:05 +08:00
Henry Chang
b468335de9 Bug 1285848 - Part 2: Request and parse RICE encoded prefix by default. r=francois
MozReview-Commit-ID: Cd0lT5VTM7t

--HG--
extra : rebase_source : 08724d3c8039039b8c73f58230b1cdad94ccd786
extra : source : 3abd3bc8a0119433ef66864c8c7fd1394fb0cc14
2016-10-05 14:59:53 +08:00
Henry
783b510c3c Bug 1305567 - Use base64url encoding and avoid cutting the state. r=francois
--HG--
extra : rebase_source : 0811176b1337ffcb3d144776f9892857868f87dd
2016-09-30 10:36:40 -07:00
Sebastian Hengst
80e1cc8c7a Backed out changeset d46155cc719e (bug 1305567) for various failures in browser-chrome, devtools, and xpcshell (e.g. test_streamupdater.js) tests. r=backout on a CLOSED TREE 2016-09-29 20:54:50 +02:00
Henry
be4eff5cee Bug 1305567 - Use base64url encoding, avoid cutting the state and dump download error message. r=francois.
MozReview-Commit-ID: 1umDhxY5eKl

--HG--
extra : rebase_source : 89dfc9852dc9010afb99d6365b95780c4cce767b
2016-09-27 11:48:11 -07:00
Henry Chang
8cc38b3dfc Bug 1302044 - Init tableArray with only enabled tables. r=francois.
MozReview-Commit-ID: KMp8oLkBXwb

--HG--
extra : rebase_source : eb29994750e8707c18867a6f9fa6ac9e00dd49ff
2016-09-12 17:30:06 +08:00
Henry Chang
b3b4096aa2 Bug 1301008 - Pass safebrowsing v4 list state in base64 format to avoid truncation. r=francois
MozReview-Commit-ID: 6oVdQvEoMm2

--HG--
extra : rebase_source : c239f5682213ec6e4e197d8aa7d267342dcd08f8
2016-09-07 17:45:15 +08:00
Henry
db1a9a2ec6 Bug 1287059 - Part 1: Return all possible list names while converting from threat type. r=francois.
MozReview-Commit-ID: KgT4CrBzvu0

--HG--
extra : rebase_source : 6067f296fd820c6948bb418bf67371b56326338a
2016-08-16 17:30:11 +08:00
Igor
175543fda8 Bug 1293384 - Part 2: Rename Snprintf.h header to Sprintf.h. r=froydnj 2016-08-14 23:43:21 -07:00