Commit Graph

210 Commits

Author SHA1 Message Date
dimi
b19db734bc Bug 1311933 - P1. Use integer as the key of safebrowsing cache. r=francois
In Bug 1323953, we always send 4-bytes prefix for completion and the prefix is also
used as the key to store cache result from gethash request.
Since it is always 4-bytes, we could convert it to integer for simplicity.

MozReview-Commit-ID: Lkvrg0wvX5Z
2017-04-11 16:07:26 +08:00
dimi
5b1a0ff5b5 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
2017-04-11 11:50:48 +08:00
Iris Hsiao
cd018fd494 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
5856f89d1f 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
2017-04-10 16:20:09 +08:00
Sebastian Hengst
ac6f4701fe Backed out changeset fc8099c8f98a (bug 1311935) 2017-04-07 19:05:42 +02:00
dimi
b3df2a0280 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: 8pUJITn8c1n
2017-04-07 16:56:08 +08:00
Henry Chang
7141f6bb42 Bug 1343425 - Supports nsIURIClassifier.asyncClassifyLocalWithTables. r=baku
We add a new "on-off" protocol PURLClassifierLocal which calls
nsIURIClassifier.asyncClassifyLocalWithTables on construction and
calls back on destruction. Pretty much the same design as PURLClassifier.

In order to avoid code duplication, the actor implementation is templatized
and |MaybeInfo| in PURLClassifier.ipdl is moved around.

Test case is included and the custom event target is not in place for labelling.
The custom event target will be done in Bug 1353701.

MozReview-Commit-ID: IdHYgdnBV7S
2017-04-07 14:15:16 +08:00
Henry Chang
4543c61a48 Bug 1339050 - Asynchronously apply safebrowsing DB update. r=francois,gcp
A new function Classifier::AsyncApplyUpdates() is implemented for async update.
Besides, all public Classifier interfaces become "worker thread only" and
we remove DBServiceWorker::ApplyUpdatesBackground/Foreground.

In DBServiceWorker::FinishUpdate, instead of calling Classifier::ApplyUpdates,
we call Classifier::AsyncApplyUpdates and install a callback for notifying
the update observer when update is finished. The callback will occur on the
caller thread (i.e. worker thread.)

As for the shutdown issue, when the main thread is notified to shut down,
we at first *synchronously* dispatch an event to the worker thread to
shut down the update thread. After getting synchronized with all other
threads, we send last two events "CancelUpdate" and "CloseDb" to notify
dangling update (i.e. BeginUpdate is called but FinishUpdate isn't)
and do cleanup work.

MozReview-Commit-ID: DXZvA2eFKlc
2017-04-06 07:07:56 +08:00
dimi
fa1cdd079d Bug 1350798 - Ignore v4 completion too early will cause telemetry::URLCLASSIFIER_MATCH_RESULT gets wrong results. r=francois
Enable safebrowsing v4 completion but ignore the result by checking preference in
nsUrlClassifierLookupCallback::Completion may cause telemetry measure incorrect match
result since v4 completions will always be ignored.

So in this patch we move the preference check after telemetry is measured and then we
ignore the result.

MozReview-Commit-ID: J29JitvW3Lc
2017-03-28 09:09:57 +08:00
Thomas Nguyen
72ec8b5761 Bug 1339006 - Specify event target if we run nsIURIClassifier.clasify() from content process.r=ehsan, r=gcp
MozReview-Commit-ID: BztjVMlQngi
2017-03-08 11:06:36 +08:00
Henry Chang
75d7890222 Bug 1339760 - Split update process to background/foreground and run background on update thread **synchronously**. r=francois,gcp
MozReview-Commit-ID: J0phPC1nWsf
2017-02-22 17:25:26 +08:00
David Major
b1e362f6f7 Bug 1344615: Remove nsXPCOMStrings.{h,cpp} r=bsmedberg
These are now dead code.

MozReview-Commit-ID: AClU0Qx3kmN
2017-03-06 17:52:54 +13:00
Henry Chang
7330f247a6 Bug 1341506 - Part 2: Add telemetry for AsyncClassifyLocalWithTables. r=francois
MozReview-Commit-ID: 14QG0AdxbE5
2017-02-24 00:14:11 +08:00
Henry Chang
40c00b3543 Bug 1341506 - Part 1: Implement and use nsIURIClassifier.asyncClassifyLocalWithTables. r=Ehsan,francois
MozReview-Commit-ID: 8dvYM4o2Xxw
2017-03-01 11:27:51 +08:00
Dimi Lee
7545e85763 Bug 1335974 - Add more error codes to URLCLASSIFIER_UPDATE_ERROR. r=francois
MozReview-Commit-ID: AAd6Yu0AuUO
2017-02-22 16:25:04 +08:00
Dimi Lee
5375a9f0e5 Bug 1311931 - Add telemetry to measure full match rate for v2 and v4. r=francois
MozReview-Commit-ID: H9jAR82rgDh
2017-02-23 23:07:13 +08:00
Thomas Nguyen
6ca9c778d6 Bug 1288633 - Add more information when an URL matches Safe Browsing list. r=dragana,francois
MozReview-Commit-ID: 6u0dUOB838F
2017-02-21 09:46:36 +08:00
Tom Tromey
a4b717ab39 Bug 1060419 - make log_print use Printf.h, r=froydnj
MozReview-Commit-ID: BIZ1GQEZ1vs
2016-12-15 20:16:31 -07:00
Tom Tromey
48da5b7de4 Bug 1060419 - remove unneeded includes of prprf.h, r=froydnj
MozReview-Commit-ID: JifhpA3oOeH
2016-12-09 10:00:01 -10:00
Francois Marier
93a6db0a84 Bug 1334616 - Add telemetry probe to monitor ClassifyLocalWithTables() perf. r=gcp
MozReview-Commit-ID: LfKovwAX9Ov
2017-02-03 20:56:05 +08:00
Phil Ringnalda
99db7d0422 Backed out changeset 2e9eab35d1ea (bug 1334616) for bustage
CLOSED TREE
2017-02-06 22:04:16 -08:00
Francois Marier
173cf1fe01 Bug 1334616 - Add telemetry probe to monitor ClassifyLocalWithTables() perf. r=gcp
MozReview-Commit-ID: LfKovwAX9Ov
2017-02-03 20:56:05 +08:00
Francois Marier
8ab3e4bd30 Bug 1336376 - Expand the range of values for URLCLASSIFIER_LOOKUP_TIME. r=bsmedberg
MozReview-Commit-ID: 9zh8mldBS7k
2017-02-03 20:30:08 +08:00
Henry Chang
7bb28e53f9 Bug 1323953 - Send 4-byte prefix for both v2/v4 tables. r=francois
MozReview-Commit-ID: 1jlBdSQARNg
2017-02-07 10:56:12 +08:00
Wes Kocher
785ad4f15f Backed out changeset 3a6b42b3d233 (bug 1336376) for build failures a=backout CLOSED TREE
MozReview-Commit-ID: L3oVRVqNDKj
2017-02-06 18:36:24 -08:00
Thomas Nguyen
8306f6ac3b Bug 1336005 - Add null check when releasing and shutting down background thread r=francois
MozReview-Commit-ID: HKlQLqQH2c9
2017-02-07 10:06:21 +08:00
Francois Marier
3714472b99 Bug 1336376 - Expand the range of values for URLCLASSIFIER_LOOKUP_TIME. r=bsmedberg
MozReview-Commit-ID: 9zh8mldBS7k
2017-02-03 20:30:08 +08:00
Dimi Lee
1859178ca5 Bug 1332770 - Fix the google4 provider is showing up as other in some telemetry pings. r=francois
MozReview-Commit-ID: KbpYAnf6qxd
2017-01-27 18:02:36 +08:00
Dimi Lee
45dd73df16 Bug 1333257 - Only cache V2 misses when doing Safe Browsing lookups. r=francois
MozReview-Commit-ID: 6kvM6z5OnPw
2017-01-26 11:36:52 +08:00
dimi
9cac186808 Bug 1328821 - hash completion request for v4 should not depend on table freshness. r=francois,henry
MozReview-Commit-ID: EIjDrnj1I4S
2017-01-17 08:33:08 +08:00
Henry Chang
29a04b7790 Bug 1331534 - Temporarily ignore v4 hash completion result. r=francois
MozReview-Commit-ID: 9P68EP5CWG4
2017-01-18 16:49:57 +08:00
Thomas Nguyen
433f1d4821 Bug 1324820 - Make sure we resume the channel if there's no classifier callback r=gcp
MozReview-Commit-ID: 35jBJb1Q8Rz
2017-01-12 18:07:22 +08:00
DimiL
3cb66c6aee Bug 1311910 - Add telemetry to measure update error and update timeout rate for V2 and V4. r=francois,henry
MozReview-Commit-ID: JL4aZrUOGH7
2016-12-19 09:43:02 +08:00
Henry Chang
b9d5f5080f Bug 1312339 - LookupResult to support variable length partial hash. r=francois
MozReview-Commit-ID: DKwNCNKJAW
2016-12-16 14:34:32 +08:00
Henry Chang
eff83f87c8 Bug 1276826 - Part 2. Send gethash request and handle gethash response for v4. r=francois
MozReview-Commit-ID: 6fIbN6a6gHI
2016-11-28 14:55:36 +08:00
Kershaw Chang
faad0ac53b Bug 1141814 - Part 1: Enable to update TP list if TP is disabled. r=francois 2016-11-30 23:12:00 -05:00
Kirk Steuber
3f451e0c48 Bug 1321377 - When called from the content process, ClassifyLocalWithTables should return failure instead of causing an IPC error r=Ehsan,francois
MozReview-Commit-ID: B1RemxGRSKB
2016-11-30 10:57:48 -08:00
Kirk Steuber
845ef3d6da Bug 1319571 - Change the output format of nsUrlClassifierDBService::ClassifyLocalWithTables from comma separated string to an array of strings r=francois
MozReview-Commit-ID: TXln2EQnZS
2016-11-29 13:04:43 -08:00
Thomas Nguyen
7064eed520 Bug 1315386 - Make Safe Browsing code more shutdown-aware. r=francois,gcp.
MozReview-Commit-ID: ATCVfh5YLZl
2016-11-25 16:02:37 +08:00
Ehsan Akhgari
45bfeafc80 Bug 1318768 - Part 3: Make nsIURIClassifier::ClassifyLocalWithTables() usable in the content process; r=gcp,baku 2016-11-22 08:17:34 -05:00
Ehsan Akhgari
4dfc942bf0 Bug 1318768 - Part 2: Make nsIURIClassifier::Classify() available in the content process; r=gcp,baku 2016-11-22 08:17:26 -05:00
Ehsan Akhgari
481cbab9fe Bug 1318768 - Part 1: Make the URL classifier service initialize in the content process; r=gcp 2016-11-22 08:17:20 -05:00
Henry Chang
7f94b8915f Bug 1315097 - Build the provider dictionary on the main thread to be used everywhere. r=francois,gcp
MozReview-Commit-ID: Ft1deSNKuVB
2016-11-04 17:54:05 +08:00
Henry Chang
891cee9c33 Bug 1310142 - Preserve backup databases and raw table updates for diagnostic. r=francois
MozReview-Commit-ID: GeJoBrhuTgA
2016-10-14 17:58:18 +08:00
DimiL
8496cac4e0 Bug 1315140 - Add telemetry for the Safe Browsing shutdown code. r=francois
MozReview-Commit-ID: F9Hv37Mn73P
2016-11-08 15:11:36 +08:00
DimiL
e841cd1751 Bug 1305780 - P1. Implement the update fail scheme for v4. r=gcp
MozReview-Commit-ID: LeVpVIUdmjc
2016-10-19 12:52:05 +08:00
Henry
1a09e5cf41 Bug 1307541 - ProtocolParserProtobuf to init and return update time properly. r=francois.
MozReview-Commit-ID: CmVWVKUeunJ
2016-10-18 14:45:21 +08:00
Ehsan Akhgari
cef52e4bd4 Bug 1309924 - Remove the needless arguments to nsUrlClassifierClassifyCallback's constructor; r=francois 2016-10-13 18:42:06 -04:00
Michael Layzell
419868d357 Bug 1018486 - Part 9: Changes to account for modifications to clang plugin, r=ehsan
MozReview-Commit-ID: EPQMbfHYxUK
2016-09-07 10:50:47 -04:00
Thomas Nguyen
b0c8c47bd2 Bug 999484 - Test FindInReadable calls in safebrowsing code. r=gcp
MozReview-Commit-ID: C27J4dh9s6T
2016-09-01 10:48:17 +08:00