Commit Graph

108 Commits

Author SHA1 Message Date
Nathan Froyd
d260382328 Bug 1443900 - don't allocate nsCStrings when doing integer parsing; r=michal
There's no need to allocate a completely new nsCString when all we want
to do is parse a character string into an integer.  We can allocate a
dependent string instead, which will avoid some memory churn.
2018-03-08 09:43:00 -05:00
Nathan Froyd
0f56acaf26 Bug 1437604 - remove NS_INTERFACE_MAP_END_THREADSAFE; r=mystor
This macro is identical to NS_INTERFACE_MAP_END and encourages the
reader to think that there's something extra-special threadsafe about QI
implementations that use the macro, when in reality there's nothing of
the sort.
2018-02-12 14:36:46 -05:00
Michal Novotny
a60970a6a1 Bug 1403010 - Crash due to race condition in CacheFileMetadata::SizeOfExcludingThis when reading or writing metadata, r=valentin 2017-10-03 16:49:39 +02:00
Michal Novotny
a565b2a018 Bug 1381766 - Remove wrong assertions from CacheFile::SetNetworkTimes, r=junior
kIndexTimeNotAvailable has a special meaning when reading the times from the index, but measured times are passed to CacheFile::SetNetworkTimes and 65535ms is a valid time.
2017-07-18 11:04:16 +02:00
Sylvestre Ledru
4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02:00
Michal Novotny
f4d299e123 Bug 1378083 - Assertion failure: !mListener in CacheFileChunk::Hash(), r=valentin 2017-07-04 03:07:00 +02:00
Michal Novotny
7652415367 Bug 1368887 - Crash in mozilla::net::CacheFile::IsKilled, r=valentin, r=honzab
CacheFile::OnChunkRead and CacheFile::OnChunkWritten now correctly handle discarded chunks. It's now also ensured that the chunk which is going to be discarded isn't references by any input stream.
2017-06-27 22:57:38 +02:00
Bill McCloskey
f115503a0b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Carsten "Tomcat" Book
8a1350b5a6 Backed out changeset 4f6302a98ae4 (bug 1372405)
--HG--
extra : rebase_source : 41632f3158e88e692809731394a683d065a73dfb
2017-06-21 13:59:26 +02:00
Bill McCloskey
6b3e84ed5f Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Carsten "Tomcat" Book
ea1b86680c Backed out changeset 9846de3bd954 (bug 1372405)
--HG--
extra : rebase_source : 5d4a48e8ec394c329994689d938d2a6e9b2752b0
2017-06-20 08:27:02 +02:00
Bill McCloskey
4592152411 Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00
Bill McCloskey
7cb6a23814 Bug 1365101 - Convert NS_GetCurrentThread uses in netwerk/ (r=meyhemer)
MozReview-Commit-ID: IHBt6XAG8em
2017-06-12 20:21:43 -07:00
Junior Hsu
6d4fca1d99 Bug 1325088 - Part 2: Expose the index-update to cache entry. r=michal
--HG--
extra : rebase_source : 8c8eaf6cea7eb3491de4cdf9dbe9783491296130
2017-03-28 12:02:45 +08:00
Junior Hsu
6dc5f1d10e Bug 1325088 - Part 1: Add net-response-time-onstart/onstop to cache index. r=michal
--HG--
extra : rebase_source : 76b3365ffccc170287be04678dc29227a2fc88ca
2017-03-28 11:40:21 +08:00
Junior Hsu
8fc810c5c9 Bug 1325091 - Add flag indicating presence of alternative data in the cache entry to cache index. r=michal 2017-03-06 18:21:59 +08:00
Michal Novotny
43f8cee68d Bug 1343916 - CacheFile::Truncate doesn't update hashes in CacheFileMetadata, r=valentin 2017-03-09 17:28:56 +01: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
Andrew McCreight
fccb0645ed Bug 1323042 - forbid MOZ_COUNT_{CTOR,DTOR} for nsISupports classes; r=froydnj 2016-12-12 09:27:58 -05:00
Nathan Froyd
826598caba Backout aba6c73511a2 (bug 1307961) for massive test bustage resulting in a CLOSED TREE; r=alltheorange 2016-12-12 08:45:46 -05:00
Andrew McCreight
e31b5489da Bug 1307961 - require consistent bloatview reporting for nsISupports classes; r=froydnj 2016-12-12 07:58:33 -05:00
Valentin Gosu
3c75088cde Bug 1313095 - Add telemetry to measure if cache loads are faster than network loads r=michal
MozReview-Commit-ID: C6kMSPw8gxv
* * *
[mq]: bug1313095-telemetry-reval.patch

MozReview-Commit-ID: 8jwMgq0cx3Z
2016-11-10 16:14:34 +01:00
Michal Novotny
2b03d7b575 Bug 1201042 - Update HTTP cache index format to work with OriginAttributes' suffix, r=honzab 2016-11-08 21:11:30 +01:00
Carsten "Tomcat" Book
dbc8d15cba Backed out changeset bd16c2fde4bf (bug 1201042) for bc test failures 2016-11-07 12:58:23 +01:00
Michal Novotny
55b3501a07 Bug 1201042 - Update HTTP cache index format to work with OriginAttributes' suffix, r=honzab 2016-11-07 10:28:46 +01:00
Honza Bambas
c9cce146d4 Bug 1306033 - Only fatal console warnings on failures of OpenAlternativeInputStream in HTTP cache. r=michal
--HG--
extra : rebase_source : 147258f504b3ce5433739b09c96ee68ffec30c0d
2016-09-29 07:26:00 -04:00
Valentin Gosu
29eff7dfe4 Bug 1231565 - (Part 3) Make alt-data responses report the correct content length r=michal
MozReview-Commit-ID: DvQP7NB4SqW
2016-09-27 10:26:00 +02:00
Michal Novotny
46b5c2fb6e Bug 1258747 - Support for alternative data in CacheFile, r=honzab 2016-08-17 12:58:44 +02:00
Nicholas Nethercote
e7f10a07fd Bug 1293603 (part 2) - Make Run() declarations consistent. r=erahm.
This patch makes most Run() declarations in subclasses of nsIRunnable have the
same form: |NS_IMETHOD Run() override|.

As a result of these changes, I had to add |override| to a couple of other
functions to satisfy clang's -Winconsistent-missing-override warning.

--HG--
extra : rebase_source : 815d0018b0b13329bb5698c410f500dddcc3ee12
2016-08-08 12:18:10 +10:00
Andrew McCreight
afa9136306 Bug 1287602 - CacheFile::GetChunk() is unused. r=michal 2016-07-20 15:18:59 -07:00
Michal Novotny
43bbac13b3 Bug 1279246 - Hang due to CacheFileInputStream deadlock, r=honzab 2016-07-12 17:58:38 +02:00
Kyle Huey
c73656947b Bug 1265927: Move nsRunnable to mozilla::Runnable, CancelableRunnable to mozilla::CancelableRunnable. r=froydnj 2016-04-25 17:23:21 -07:00
Michal Novotny
3e05444c44 Bug 1253040 - Do not write metadata if CacheFile is killed, r=honzab 2016-04-17 16:23:49 +02:00
J. Ryan Stinnett
2a55d065b7 Bug 1238160 - Rename OriginAttributes.mInBrowser and associated methods. r=bz,mayhemer
This change renames OriginAttributes.mInBrowser to mInIsolatedMozBrowser and
nsIPrincipal::GetIsInBrowserElement to GetIsInIsolatedMozBrowserElement.  Other
methods that pass these values around also have name changes.

Tokens such as "inBrowser" have previously been serialized into cache keys, used
as DB column names, stored in app registries, etc.  No changes are made to any
serialization formats.  Only runtime method and variable names are updated.

No behavior changes are made in this patch, so some renamed methods may have
nonsensical implementations.  These are corrected in subsequent patches
focused on behavior.

MozReview-Commit-ID: 66HfMlsXFLs
2016-03-02 10:35:56 -06:00
Honza Bambas
f6e228e9d3 Bug 1247644 - Don't do any I/O on doomed and unused HTTP cache entries, r=michal 2016-02-12 14:45:00 +01:00
radu stoica
913ed1d7ab Bug 1248558 - "[Static Analysis][Unintentional integer overflow][CacheFile.cpp::PreloadChunk, CacheFile.cpp::GetChunkLocked]". r=michal
--HG--
extra : rebase_source : a13923fa1d2618f7a00363b17e3a8f9bf090e89f
2016-02-16 04:29:00 +01:00
Honza Bambas
6bbabfc4b2 Bug 1121672 - Make CacheFile::IsDoomed() protect mHandle with lock, r=michal 2016-01-12 09:24:00 +01:00
Nicholas Nethercote
59bbf6548a Bug 1187134 (part 5) - Replace nsBaseHashtable::Enumerate() calls in netwerk/cache{,2}/ with iterators. r=valentin.
--HG--
extra : rebase_source : d47d5a91025ce6a06ec63155d68b0969c45e4d29
2015-12-03 14:00:04 -08:00
Nicholas Nethercote
edfdcd39d9 Bug 1187134 (part 4) - Replace nsBaseHashtable::Enumerate() calls in netwerk/cache{,2}/ with iterators. r=valentin.
--HG--
extra : rebase_source : 0d62ad6d5e6cad0d4202cb58ec77890e3213cecf
2015-12-03 14:00:03 -08:00
Nicholas Nethercote
2e1080a108 Bug 1187134 (part 3) - Replace nsBaseHashtable::Enumerate() calls in netwerk/cache{,2}/ with iterators. r=valentin.
--HG--
extra : rebase_source : c7de2d58545b298f362a042788531fe9e13fc52a
2015-12-03 14:00:02 -08:00
Honza Bambas
8f88fd6cdc Bug 1032254 - Generic way to pin reasource in the HTTP cache, r=michal
* * *
Bug NNNNNNN - message, r=reviewer

--HG--
rename : netwerk/test/unit/test_cache2-28-concurrent_read_resumable_entry_size_zero.js => netwerk/test/unit/test_cache2-29a-concurrent_read_resumable_entry_size_zero.js
rename : netwerk/test/unit/test_cache2-29-concurrent_read_non-resumable_entry_size_zero.js => netwerk/test/unit/test_cache2-29b-concurrent_read_non-resumable_entry_size_zero.js
2015-10-22 12:11:00 +02:00
Nathan Froyd
01583602a9 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

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Honza Bambas
4bd41740d0 Bug 1165269 - Use OriginAttributes in nsILoadContextInfo, r=michal+allstars 2015-10-11 18:13:09 +02:00
Nikhil Marathe
8dbf443150 Bug 1167809 - Add skip size check flag to cache for use with ServiceWorkers. r=mayhemer
For non-e10s Service Worker, we use Cache entries to achieve interception.
While this is a temporary measure, the fact that cache enforces size limits on
cache entries (which make sense for the purpose it was designed) prevents large
files from being served via a Service Worker. This patch adds a skip size check
flag to CacheStorage that is relayed to CacheEntry and CacheFile. It is set to
false by default leading to normal cache behaviour.
The patch also adds nsICacheStorageService.synthesizedCacheStorage() that
retrieves a cache storage with this flag set to true, which is used by
nsHttpChannel in case of possible interception.
2015-09-03 16:05:42 -07:00
Nicholas Nethercote
d98d14fa1e Bug 1189156 (part 4) - Don't use enumeration style for nsBaseHashtable::SizeOf{In,Ex}cludingThis(). r=erahm,jfkthame.
After this change, we have ShallowSizeOf{In,Ex}cludingThis(), which don't do
anything to measure children. (They can be combined with iteration to measure
children.)

--HG--
extra : rebase_source : f98420176f50990bbc5a25e35788328154cfeb00
2015-07-30 21:19:57 -07:00
Carsten "Tomcat" Book
9fcb673926 Backed out changeset fb2a27db76bc (bug 1032254) for OS X Static Build Bustage on a CLOSED TREE
--HG--
rename : netwerk/test/unit/test_cache2-29a-concurrent_read_resumable_entry_size_zero.js => netwerk/test/unit/test_cache2-28-concurrent_read_resumable_entry_size_zero.js
rename : netwerk/test/unit/test_cache2-29b-concurrent_read_non-resumable_entry_size_zero.js => netwerk/test/unit/test_cache2-29-concurrent_read_non-resumable_entry_size_zero.js
2015-07-31 07:57:50 +02:00
Valentin Gosu
30be843b5b Bug 1032254 - Provide a way to pin resources in the http cache r=honzab
--HG--
rename : netwerk/test/unit/test_cache2-28-concurrent_read_resumable_entry_size_zero.js => netwerk/test/unit/test_cache2-29a-concurrent_read_resumable_entry_size_zero.js
rename : netwerk/test/unit/test_cache2-29-concurrent_read_non-resumable_entry_size_zero.js => netwerk/test/unit/test_cache2-29b-concurrent_read_non-resumable_entry_size_zero.js
2015-07-30 11:40:00 +02:00
Nicholas Nethercote
87b80f8c66 Bug 1188745 - Rename nsTArray::SizeOfExcludingThis() as ShallowSizeOfExcludingThis(). r=froydnj.
This makes it clearer that, unlike how SizeOf*() functions usually work, this
doesn't measure any children hanging off the array.

And do likewise for nsTObserverArray.

--HG--
extra : rebase_source : 6a8c8d8ffb53ad51b5773afea77126cdd767f149
2015-07-28 23:24:24 -07:00
Birunthan Mohanathas
a8939590de Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Eric Rahm
58dea0dee9 Bug 1162336 - Part 1: Remove instances of #ifdef PR_LOGGING in netwerk. r=froydnj
PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
2015-05-07 12:52:44 -07:00