Commit Graph

115 Commits

Author SHA1 Message Date
Nicholas Nethercote
636397db95 Bug 1384835 (part 1, attempt 2) - Use nsA[C]String references instead of pointers for outparams of Get*String() pref functions. r=froydnj. 2017-07-31 10:52:51 +10:00
Kartikaya Gupta
14424677af Bug 1384233 - Remove SizePrintfMacros.h. r=froydnj
We have a minimum requirement of VS 2015 for Windows builds, which supports
the z length modifier for format specifiers. So we don't need SizePrintfMacros.h
any more, and can just use %zu and friends directly everywhere.

MozReview-Commit-ID: 6s78RvPFMzv
2017-07-26 16:03:57 -04:00
Francois Marier
4b9f4bdb04 Bug 1376036 - Run data and blob URIs through Application Reputation checks. r=gcp
blob URIs are sent through unfiltered and data URIs are hashed in
the same way as Chrome does.

Also, we used to bail on the first invalid URL we encountered. We now
keep going, checking the other URLs in the chain and eventually doing
the remote lookup.
2017-07-11 23:02:23 -04:00
DimiL
611d1430b5 Bug 1366965 - Remove telemetry that compare SafeBrowsing V2 & V4. r=francois
MozReview-Commit-ID: 7vudFBK3rdp
2017-06-12 11:27:19 +08:00
Thomas Nguyen
bbb4c84e53 Bug 1351146 - P2 - Update test case and usage of nsIRedirectHistoryEntry interface. r=dragana
MozReview-Commit-ID: s61VV5CLx8
2017-05-25 19:42:00 +02:00
Francois Marier
d32facf80e Bug 1364959 - Do remote application reputation lookups when downloading HTML files. r=dimi
MozReview-Commit-ID: HHm9zQLtj05
2017-05-15 09:40:36 -07:00
Iris Hsiao
ec262daf79 Backed out changeset 102ce41b51ca (bug 1364959) for xpcshell failures in test_ext_downloads_misc.js. a=backout
CLOSED TREE
2017-05-17 11:26:52 +08:00
Francois Marier
b5e6fa8860 Bug 1364959 - Do remote application reputation lookups when downloading HTML files. r=dimi
MozReview-Commit-ID: HHm9zQLtj05
2017-05-15 09:40:36 -07:00
Thomas Nguyen
15682486c6 Bug 1358333 - Fix APPLICATION_REPUTATION_ALLOWLIST_MATCH and APPLICATION_REPUTATION_BLOCKLIST_MATCH telemetry r=francois
MozReview-Commit-ID: DbI0uNdEwZ8
2017-04-21 11:18:34 +08:00
Francois Marier
d593f1e244 Bug 1354713 - Make use of the application reputation allow list on OSX and Linux. r=gcp
Since the allow list contains both hostnames and certificate hashes, it makes sense
to use it on all platforms.

MozReview-Commit-ID: 1icRFYhhnAY
2017-04-07 16:07:41 -07:00
Zibi Braniecki
8c433fc56a Bug 1346616 - Migrate callsites that are retrieving requested locale from pref, to use LocaleService::GetRequestedLocales. r=jfkthame,Pike
I'm adding a helper function mozILocaleService::GetRequestedLocale to simplify
most of the callsites that are looking for the first of the requested locales.

In most cases, I'm just matching the behavior of the code with reusing
LocaleService API instead of direct manipulation on the prefs.
That includes how I handle error case scenarios.

In case of sdk/l10n/locale.js I am reusing LocaleService heuristics over
the custom one from the file since the ones in LocaleService are just
more correct and unified accross the whole platform.

In case of FallbackEncoding I have to turn it into a nsIObserver to listen
to intl:requested-locales-changed.

MozReview-Commit-ID: 7rOr2CovLK
2017-03-11 18:43:11 -08:00
Sebastian Hengst
017c2ee2bf Backed out changeset 60d72c2dd49d (bug 1346616) for eslint failure in DirectoryLinksProvider.jsm. r=backout on a CLOSED TREE 2017-04-18 00:48:16 +02:00
Zibi Braniecki
64bae2dccf Bug 1346616 - Migrate callsites that are retrieving requested locale from pref, to use LocaleService::GetRequestedLocales. r=jfkthame,Pike
I'm adding a helper function mozILocaleService::GetRequestedLocale to simplify
most of the callsites that are looking for the first of the requested locales.

In most cases, I'm just matching the behavior of the code with reusing
LocaleService API instead of direct manipulation on the prefs.
That includes how I handle error case scenarios.

In case of sdk/l10n/locale.js I am reusing LocaleService heuristics over
the custom one from the file since the ones in LocaleService are just
more correct and unified accross the whole platform.

In case of FallbackEncoding I have to turn it into a nsIObserver to listen
to intl:requested-locales-changed.

MozReview-Commit-ID: 7rOr2CovLK
2017-03-11 18:43:11 -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
Thomas Nguyen
d107e3566b Bug 1331139 - Enable download protection for V4 lists. r=francois
MozReview-Commit-ID: 8IHKGvXQjPt
2017-02-27 12:18:33 +08:00
Thomas Nguyen
882486b2dc Bug 1336240 - Remove observer in PendingLookup and nsChannelClassifier r=dimi,francois
MozReview-Commit-ID: EBQpQzESVZP
2017-02-24 10:14:07 +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
David Major
b148a2518f Bug 1338947: Add const to kBinaryFileExtensions. r=gcp
MozReview-Commit-ID: 5le3q56JRms
2017-02-14 15:24:55 +13:00
Cykesiopka
e99d55a74b Bug 1331983 - Avoid non-smart string IDL types in nsIX509CertDB.idl. r=gcp,keeler,nwgh
Smart string classes like nsCString are safer to use than raw |char*| strings,
and are typically easier to deal with as well.

MozReview-Commit-ID: 2PdrCa6cbpe
2017-02-09 23:11:29 +08:00
Andrea Marchesini
46a9207d60 Bug 1328653 - Merging all the various *OriginAttributes to just one, r=huseby 2017-01-12 17:38:48 +01:00
dimi
d2fb140df2 Bug 1320402 - Move url-classifier off of using appIds. r=ehsan, gcp
MozReview-Commit-ID: IqnAVrv2c9W
2017-01-03 14:21:58 +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
Nathan Froyd
8a9bd5755c Bug 1316642 - convert giant logical OR expression in IsBinaryFile into a for loop; r=gcp
The giant logical OR expression was causing GCC on x86-64 to churn out a
200K function, which is completely unnecessary.  This revised
formulation is not maximally efficient, but it is a massive improvement
size-wise: IsBinaryFile + the table is about 2K on x86-64.
2016-11-11 01:00:11 -05:00
Francois Marier
0a7382402b Bug 1302211 - Sync file extension list with Chrome. r=gcp
Directly executable file types were added and types that Chrome
doesn't submit to the remote server were removed.

PDF is retained for now and many archive types are commented-out.

https://cs.chromium.org/chromium/src/chrome/browser/resources/safe_browsing/download_file_types.asciipb

MozReview-Commit-ID: 3lXUX9NV4Fw
2016-09-12 15:58:44 -07:00
Francois Marier
b6cfd4500e Bug 1302211 - Remove .osx extension from download protection. r=gcp
https://bugs.chromium.org/p/chromium/issues/detail?id=641614

MozReview-Commit-ID: 6m3bKNlnjIv
2016-09-12 13:23:25 -07: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
Yoshi Huang
a470396744 Bug 1244340 - Part 1: Use origin attributes as cstor arg for LoadContext r=sicking 2016-08-26 18:59:00 +08:00
Francois Marier
182aac11ab Bug 1296472 - Move upstream chromium code into chromium directory. r=gcp
MozReview-Commit-ID: 3bjPtqtQlGb
2016-08-18 15:50:09 -07:00
Nicholas Nethercote
8f3c6e7c32 Bug 1294645 - Don't use NS_CALLBACK for callbacks in nsI{Input,Output,UnicharInput},Stream.idl. r=froydnj.
Slightly less than half (93 / 210) of the NS_METHOD instances in the codebase
are because of the use of NS_CALLBACK in
nsI{Input,Output,UnicharInput},Stream.idl. The use of __stdcall on Win32 isn't
important for these callbacks because they are only used as arguments to
[noscript] methods.

This patch converts them to vanilla |nsresult| functions. It increases the size
of xul.dll by about ~600 bytes, which is about 0.001%.
2016-08-12 17:36:22 +10:00
Francois Marier
88ba1518b7 Bug 1291472 - Add more application reputation extensions. r=gcp
MozReview-Commit-ID: EKXupjU5JG4
2016-08-05 16:56:46 -07:00
Thomas Nguyen
c623867e82 Bug 1172689 - Add telemetry for application reputation remote lookup timeouts. r=francois
MozReview-Commit-ID: GrmNPGGcOE5
2016-07-21 10:05:02 +08:00
Ralph Giles
3d546266d0 Bug 1275744 - Reference MOZ_LOG in toolkit comments. r=erahm
NSPR_LOG_MODULES is deprecated.

MozReview-Commit-ID: 2iZFe60Uxvi
2016-05-26 11:14:47 -07:00
Dragana Damjanovic
1080454580 Bug 1125916 - Fix code that miss proper flags and originAttributes in LoadInfo. Also fix some tests. r=sicking, r=jduell 2016-04-13 15:34:36 +02:00
Paolo Amadini
7af901eb8d Bug 1254100 - Part 1 - Fix compilation error in debug builds. r=gcp,francois 2016-03-20 16:11:52 +00:00
Paolo Amadini
a022994a44 Bug 1254100 - Part 1 - The Application Reputation interface should provide information about the verdict. r=gcp,francois
MozReview-Commit-ID: 2qpg7297NUB
2016-03-20 13:54:11 +00:00
sajitk
39f5ab0cca Bug 1219482: Replace PRLogModuleInfo with LazyLogModule in toolkit subdirectory.r=erahm 2016-01-28 10:37:00 -08:00
Francois Marier
3d4c8314bb Bug 1237856 - Add prefs to honor/ignore Application Reputation verdicts. r=gcp 2016-02-02 15:07:06 -05:00
Wes Kocher
3c9e45e1fb Backed out changeset 24af6caa9bba (bug 1219482) to hopefully fix the intermittent hazard failures CLOSED TREE 2016-01-29 10:15:30 -08:00
sajitk
b916ed88a5 Bug 1219482 - Replace PRLogModuleInfo with LazyLogModule in toolkit subdirectory. r=erahm 2016-01-28 10:37:00 -05:00
Sylvestre Ledru
1f07806bda Bug 1218816 - Remove useless semicolons. Found by coccinelle. r=Ehsan 2016-01-22 16:58:49 +01:00
Francois Marier
61497c0c01 Bug 1239587 - Rename the browser.safebrowsing.appRepURL pref. r=gcp 2016-01-19 13:56:49 -08:00
Francois Marier
31a12fbe6a Bug 1237370 - Always log the reason for remote AppRep lookup failures. r=gcp 2016-01-18 13:39:00 -08:00
Yoshi Huang
47c69d1edb Bug 1209162 - Create OriginAttributes subtypes. IGNORE IDL r=sicking. 2015-11-03 09:50:54 +08:00
Chris Peterson
9d57db3beb Bug 1218258 - Fix -Wshadow warnings in toolkit/components/downloads. r=paolo
toolkit/components/downloads/ApplicationReputation.cpp:598:14 [-Wshadow] declaration shadows a local variable
toolkit/components/downloads/ApplicationReputation.cpp:721:15 [-Wshadow] declaration shadows a local variable
toolkit/components/downloads/ApplicationReputation.cpp:809:29 [-Wshadow] declaration shadows a local variable
toolkit/components/downloads/nsDownloadManager.cpp:1268:36 [-Wshadow] declaration shadows a local variable
toolkit/components/downloads/nsDownloadManager.cpp:1483:33 [-Wshadow] declaration shadows a local variable
2015-10-19 20:07:52 -07:00
Nathan Froyd
4e6d8f6705 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
2015-10-18 01:24:48 -04:00
Yoshi Huang
d2b4917583 Bug 1165272 - Part 2: replace getNoAppCodebasePrincipal. r=bholley 2015-08-18 15:01:42 +08:00
Bobby Holley
d12b79b75a Backed out 3 changesets (bug 1165272) for b2g sanity blocker. 2015-08-25 11:16:21 -07:00
Yoshi Huang
431a4ee3e8 Bug 1165272 - Part 2: Replace getNoAppCodebasePrincipal. r=bholley 2015-08-24 01:18:00 -04:00
Christoph Kerschbaumer
488ef86cce Bug 1195519 - Use channel->ascynOpen2 toolkit/components/downloads/ApplicationReputation.cpp (r=sicking) 2015-08-18 09:53:47 -07:00
Emanuel Hoogeveen
b30abdc582 Bug 905127 - Part 1 - Make some functions from nsNetUtil not inline. r=jduell 2015-07-07 04:17:00 +02:00