Commit graph

102 commits

Author SHA1 Message Date
DimiL
516a287f2b Bug 1311935 - P1. Make ActiveTables() work for safebrowsing v4. r=francois
This patch fixes that Classifier::ActiveTables doesn't return v4 tables.

Classifier::mActiveTablesCache is generated by scanning safebrowsing directory.
We use Classifier::ScanStoreDir to do the work, but it will ignore subdirectory.
Since v4 tables are stored in subdirectory 'google4', mActiveTablesCache doesn't
include v4 tables.

Fix this issue by checking subdirectory recursively in ScanStoreDir.

MozReview-Commit-ID: I6pa6e4bFND

--HG--
extra : rebase_source : 49d19101bec780e21db668b2daff3c46bbdb3fd2
2017-04-07 14:30:11 +08:00
Henry Chang
f3be63826d 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

--HG--
extra : rebase_source : cd2e27a6b679d2c96e769854d1582ed2dcda12bb
2017-04-06 07:07:56 +08:00
dimi
b512891a41 Bug 1338033 - Remove URLCLASSIFIER_PREFIX_MATCH. r=francois
URLCLASSIFIER_PREFIX_MATCH is replaced by URLCLASSIFIER_FULL_MATCH(Bug 1311931)
so it should be removed.

MozReview-Commit-ID: 4F1B07bGwRP

--HG--
extra : rebase_source : 2d3e5cda14df4e874bf31145ccb5330acec369f7
2017-03-22 17:27:11 +08:00
Thomas Nguyen
e98654c1e4 Bug 1343416 - Use LCG when generating noise entries for Safe Browsing completions r=gcp
MozReview-Commit-ID: FxQH2haAcrf

--HG--
extra : rebase_source : 4fbd5bd18c4278682a52783b41bf0cc09aa91a2f
2017-03-09 10:59:52 +08:00
Henry Chang
0b68cc7689 Bug 1339760 - Split update process to background/foreground and run background on update thread **synchronously**. r=francois,gcp
MozReview-Commit-ID: J0phPC1nWsf

--HG--
extra : rebase_source : c212bd9fba1ef5951d238967a9b32e4fde0d718b
extra : source : 3daedf653e989c2d91deea785ed9598f2254e609
2017-02-22 17:25:26 +08:00
Henry Chang
6b96dcfdab Bug 1342397 - Properly reset stuff when failing to create LookupCache for update. r=gcp
MozReview-Commit-ID: 1ecI2lFIj2U

--HG--
extra : rebase_source : 49c5e460a1178253ce2afc1cdfd71dd66e370284
2017-02-25 00:22:39 +08:00
Dimi Lee
244358a9ac Bug 1335974 - Add more error codes to URLCLASSIFIER_UPDATE_ERROR. r=francois
MozReview-Commit-ID: AAd6Yu0AuUO

--HG--
extra : rebase_source : 63fdc2309348355d74b9bb738d75953d0b435b0f
2017-02-22 16:25:04 +08:00
Thomas Nguyen
3f7a3e400f Bug 1297962 - Add noise data when sending v4 gethash request r=francois
MozReview-Commit-ID: GbyvX7wcg8c
* * *
[mq]: 1297962_review

MozReview-Commit-ID: 1U2T0wq778R

--HG--
extra : rebase_source : 55f852204aa29b135360e461b8c152e45fecc7b6
2017-02-24 10:22:12 +08:00
Dimi Lee
b740658c54 Bug 1311931 - Add telemetry to measure full match rate for v2 and v4. r=francois
MozReview-Commit-ID: H9jAR82rgDh

--HG--
extra : rebase_source : 45b40d6d097882134eff38fe9a434e78cd4a56b1
2017-02-23 23:07:13 +08:00
Henry Chang
2b62e1dabf Bug 1338970 - Introduce 2-step DB update scheme. (background update then swap in) r=francois,gcp
MozReview-Commit-ID: 4C9N0tuSso0

--HG--
extra : rebase_source : 80561fb0beec7fc9f6e852d81984b239ae62700e
2017-02-21 14:18:29 +08:00
Tom Tromey
5f8f360823 Bug 1060419 - make log_print use Printf.h, r=froydnj
MozReview-Commit-ID: BIZ1GQEZ1vs

--HG--
extra : rebase_source : 2f1f0aa12493c44f352d9a7e8683e7bb72d2d75b
2016-12-15 20:16:31 -07:00
dimi
1f53a466a3 Bug 1336909 - Restrict URLCLASSIFIER_PREFIX_MATCH to profiles that have working V4. r=francois
MozReview-Commit-ID: L3lKgiohalH

--HG--
extra : rebase_source : 1ac11242c4db4b129fdb316deee92dd514b65f49
2017-02-08 15:18:35 +08:00
Dimi Lee
c6aec3beb1 Bug 1333257 - Only cache V2 misses when doing Safe Browsing lookups. r=francois
MozReview-Commit-ID: 6kvM6z5OnPw

--HG--
extra : rebase_source : c180ac1b6c840a6112f72abe3b7984503fad7082
2017-01-26 11:36:52 +08:00
dimi
4f2ec370e6 Bug 1328821 - hash completion request for v4 should not depend on table freshness. r=francois,henry
MozReview-Commit-ID: EIjDrnj1I4S

--HG--
extra : rebase_source : 83be77637f14753a8baf008af65c44e83b93508c
2017-01-17 08:33:08 +08:00
Henry Chang
5401fe7ad1 Bug 1312339 - LookupResult to support variable length partial hash. r=francois
MozReview-Commit-ID: DKwNCNKJAW

--HG--
extra : rebase_source : 082c8a1d88a00f0d568c56c7ed7214c0b0ed20ef
2016-12-16 14:34:32 +08:00
Thomas Nguyen
493ff90f5c Bug 1315386 - Make Safe Browsing code more shutdown-aware. r=francois,gcp.
MozReview-Commit-ID: ATCVfh5YLZl

--HG--
extra : rebase_source : d87cfae3838f1a26dc67d2546264e47768011a63
2016-11-25 16:02:37 +08:00
Carsten "Tomcat" Book
4945f89da4 Merge mozilla-central to autoland
--HG--
rename : browser/base/content/test/general/browser_bug1064280_changeUrlInPinnedTab.js => browser/base/content/test/tabs/browser_navigatePinnedTab.js
rename : js/src/jit-test/tests/wasm/spec.js => js/src/jit-test/tests/wasm/wast.js
extra : rebase_source : 30ebe4e98435a1fd70b26908584d608587d969d9
2016-11-24 16:47:36 +01: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
a5327a4bbb Bug 1319286 - Cache nsIUrlClassifierDBService.getTables result until next update. r=francois.
MozReview-Commit-ID: ItjTQNzCVED
2016-11-22 10:39:58 +08:00
Iris Hsiao
f2a7e74795 Backed out changeset b3574d03261b (bug 1319286) for GTest Assertion failures 2016-11-24 13:26:39 +08:00
Henry Chang
4c00c22835 Bug 1319286 - Cache nsIUrlClassifierDBService.getTables result until next update. r=francois.
MozReview-Commit-ID: ItjTQNzCVED

--HG--
extra : rebase_source : b652adb6fe696d6c25c423c8c7456247983d8050
extra : source : 3cb85811b61f8d16e2d5604af838d9cd982a5a4c
2016-11-22 10:39:58 +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
6cde2e6e52 Bug 1310142 - Preserve backup databases and raw table updates for diagnostic. r=francois
MozReview-Commit-ID: GeJoBrhuTgA

--HG--
extra : rebase_source : 02585bca9853a00bc041874a999b39e6fd7246ea
2016-10-14 17:58:18 +08:00
Thomas Nguyen
107627047f Bug 1298257 - Implement url matching for variable-length prefix set. r=dimi,gcp
MozReview-Commit-ID: 8Goh7yyAotN

--HG--
extra : rebase_source : 349cad2d7b4b285e7c5f75c88d649c358956ce63
2016-11-04 12:00:33 +08:00
dimi
84c9845881 Bug 1305581 - Verify that V4 updates were applied correctly by computing a checksum on the final result. r=francois
MozReview-Commit-ID: LNtFOVMVw2U

--HG--
extra : rebase_source : 8d60d4e49389c4a27e8ea431a9e3a4bce66ff969
2016-10-27 08:36:26 +08:00
DimiL
48ddedb04e Bug 1305780 - P1. Implement the update fail scheme for v4. r=gcp
MozReview-Commit-ID: LeVpVIUdmjc

--HG--
extra : rebase_source : bfc189b5a3f1cfc17bd269bcb7e7edad826769a3
2016-10-19 12:52:05 +08:00
Henry Chang
dc3bbda5bd Bug 1305484 - Save/load state and checksum to/from disk rather than prefs. r=dimi,francois
MozReview-Commit-ID: 4gmmrI9wY4c

--HG--
extra : rebase_source : f7f4462b7325bce9a92f747c54b448e2693e40ac
2016-10-13 15:22:08 +08:00
Dimi Lee
9e95041e88 Bug 1305801 - Part 5: Support SafeBrowsing v4 partial update. r=gcp
MozReview-Commit-ID: 7OEWLaZbotS

--HG--
extra : rebase_source : ab7a5eda234aaff3166e7082f9dc1f8b450d715b
2016-10-04 09:14:39 +08:00
Dimi Lee
3ef7d52f53 Bug 1305801 - Part 4: Store variable-length prefix to disk. r=francois, r=gcp
MozReview-Commit-ID: BMTGtgMuQdg

--HG--
extra : rebase_source : dc4975d9ac8d14ecfabf6fc1229fdb8e863cde46
2016-09-19 11:51:01 +08:00
Phil Ringnalda
35869db574 Backed out 5 changesets (bug 1305801) for ASan gtest bustage
Backed out changeset 0c95d5dec6d9 (bug 1305801)
Backed out changeset bca0e706dbc5 (bug 1305801)
Backed out changeset def8da367beb (bug 1305801)
Backed out changeset 56ceae52d847 (bug 1305801)
Backed out changeset 14457cc4c325 (bug 1305801)
2016-10-03 22:14:49 -07:00
Dimi Lee
b4c5400f77 Bug 1305801 - Part 5: Support SafeBrowsing v4 partial update. r=gcp
MozReview-Commit-ID: 7OEWLaZbotS

--HG--
extra : rebase_source : dea720f726306238f7fe3687d7c2579410923752
2016-10-04 09:14:39 +08:00
Dimi Lee
f0aab4a2ce Bug 1305801 - Part 4: Store variable-length prefix to disk. r=francois, r=gcp
MozReview-Commit-ID: BMTGtgMuQdg

--HG--
extra : rebase_source : 6f613883071de209f53596060b637e928f458978
2016-09-19 11:51:01 +08:00
Henry Chang
6e64c9ee89 Bug 1254763 - Part 1: Use per-provider directory for V4 databases. r=dimi,gcp
MozReview-Commit-ID: KZGWIcKAQyW

--HG--
extra : rebase_source : f153e87ce132f0066d6c8e21398e7abaaaff6375
2016-09-02 12:00:00 +08:00
Henry Chang
ed41f6b285 Bug 1296820 - Skip applying TableUpdateV4 to avoid premature update codes being run. r=dimi,francois
MozReview-Commit-ID: IqjpAVgISLJ

--HG--
extra : rebase_source : 77af1af8876d2eb783e98f5938181835ca01b33a
2016-08-26 14:35:53 +08:00
dimi
2fa583dc0b Bug 1037560 - P1. Safebrowsing pleasereset resets all tables. r=gcp
MozReview-Commit-ID: C5GkBBDAhn3

--HG--
extra : rebase_source : d51e94749549db975651e4bc2e4bde2f38b1a9d0
2016-08-23 08:24:07 +08:00
Henry Chang
4c1f039d17 Bug 1284204 - Parse SafeBrowsing V4 updates to TableUpdateV4. r=francois.
MozReview-Commit-ID: 88AEIbosxKl

--HG--
extra : rebase_source : 0cf1c60713a938a72c87d140869a63b2afa12e3f
extra : source : 13292c9abdce368d506d5c4ff79b4b14781e64ad
2016-08-12 11:55:48 +08:00
dimi
365c242c26 Bug 1254766 - Stop caching Safe Browsing completions to disk. r=gcp
MozReview-Commit-ID: 8Qnc8yymgDL
2016-08-11 08:17:39 +08:00
dimi
0faebe8b52 Bug 1287024 - Remove unused mHashStores variable in Classifier.cpp. r=francois
MozReview-Commit-ID: 2EIDaRHKW8Q

--HG--
extra : rebase_source : e1a4a8c578ec8e5c2f5869cbd775bfbba0c977bf
2016-07-15 12:16:26 +08:00
Ralph Giles
2d78dbf106 Bug 1275744 - Reference MOZ_LOG in toolkit comments. r=erahm
NSPR_LOG_MODULES is deprecated.

MozReview-Commit-ID: 2iZFe60Uxvi

--HG--
extra : rebase_source : 040671ce46a6d8b7d8503f4a05ff5ef04968a8aa
2016-05-26 11:14:47 -07:00
sajitk
2ed26c8df4 Bug 1219482: Replace PRLogModuleInfo with LazyLogModule in toolkit subdirectory.r=erahm 2016-01-28 10:37:00 -08:00
Bogdan Postelnicu
817d22018d Bug 1250439 - preven memory leak in Classifier::GetLookupCache. r=gcp
MozReview-Commit-ID: BlROMq9gFzj

--HG--
extra : rebase_source : eae5d0fd7a6188b787063a255b878488472fdefd
2016-02-24 13:34:10 +02:00
Wes Kocher
e060c6dced Backed out changeset 24af6caa9bba (bug 1219482) to hopefully fix the intermittent hazard failures CLOSED TREE
--HG--
extra : commitid : ETz5wi5nzdH
2016-01-29 10:15:30 -08:00
sajitk
aff6f586b9 Bug 1219482 - Replace PRLogModuleInfo with LazyLogModule in toolkit subdirectory. r=erahm
--HG--
extra : rebase_source : 71c02b7294a95ecba7876b0372a0dee0ea05b4ed
2016-01-28 10:37:00 -05:00
Gian-Carlo Pascutto
760f31a46e Bug 1100338 - Do not consider noise for Completion matches. Remove dead code. r=francois 2015-07-06 04:24:00 +02:00
Gian-Carlo Pascutto
31cf95e1cd Bug 1175562 - Persist last update time for SafeBrowsing. r=francois 2015-10-06 13:53:07 +02:00
Francois Marier
aeb9dbcf18 Bug 1203347 - Increase Safe Browsing debug logging around gethash (C++). r=gcp 2015-09-14 18:03:56 -07:00
Emanuel Hoogeveen
7d1e52f2ff Bug 905127 - Part 1 - Make some functions from nsNetUtil not inline. r=jduell 2015-07-07 04:17:00 +02:00
Eric Rahm
75c4bebb79 Bug 1165515 - Part 13-2: Replace usage of PRLogModuleLevel and PR_LOG_*. rs=froydnj
This is straightforward mapping of PR_LOG levels to their LogLevel
counterparts:
  PR_LOG_ERROR   -> LogLevel::Error
  PR_LOG_WARNING -> LogLevel::Warning
  PR_LOG_WARN    -> LogLevel::Warning
  PR_LOG_INFO    -> LogLevel::Info
  PR_LOG_DEBUG   -> LogLevel::Debug
  PR_LOG_NOTICE  -> LogLevel::Debug
  PR_LOG_VERBOSE -> LogLevel::Verbose

Instances of PRLogModuleLevel were mapped to a fully qualified
mozilla::LogLevel, instances of PR_LOG levels in #defines were mapped to a
fully qualified mozilla::LogLevel::* level, and all other instances were
mapped to us a shorter format of LogLevel::*.

Bustage for usage of the non-fully qualified LogLevel were fixed by adding
|using mozilla::LogLevel;| where appropriate.
2015-06-03 15:25:57 -07:00
Eric Rahm
f50b813989 Bug 1165515 - Part 3: Convert PR_LOG_TEST to MOZ_LOG_TEST. r=froydnj 2015-06-03 15:22:28 -07:00
Carsten "Tomcat" Book
5471309381 Backed out 14 changesets (bug 1165515) for linux x64 e10s m2 test failures
Backed out changeset d68dcf2ef372 (bug 1165515)
Backed out changeset 7c3b45a47811 (bug 1165515)
Backed out changeset b668b617bef2 (bug 1165515)
Backed out changeset d0916e1283a2 (bug 1165515)
Backed out changeset ac4dc7489942 (bug 1165515)
Backed out changeset e9632ce8bc65 (bug 1165515)
Backed out changeset c16d215cc7e4 (bug 1165515)
Backed out changeset e4d474f3c51a (bug 1165515)
Backed out changeset d87680bf9f7c (bug 1165515)
Backed out changeset b3c0a45ba99e (bug 1165515)
Backed out changeset 9370fa197674 (bug 1165515)
Backed out changeset 50970d668ca1 (bug 1165515)
Backed out changeset ffa4eb6d24b9 (bug 1165515)
Backed out changeset 5fcf1203cc1d (bug 1165515)

--HG--
extra : rebase_source : 6fb850d063cbabe738f97f0380302153e3eae97a
2015-06-02 13:05:56 +02:00