Commit Graph

326 Commits

Author SHA1 Message Date
Bogdan Postelnicu
8fd9e0aea6 Bug 1230939 - check the return of sGlobalEntryTables->Get(aContextKey, &diskEntries). r=mayhemer 2015-12-07 06:38:00 +01:00
Nicholas Nethercote
0df63629ad Bug 1187134 (part 5) - Replace nsBaseHashtable::Enumerate() calls in netwerk/cache{,2}/ with iterators. r=valentin. 2015-12-03 14:00:04 -08:00
Nicholas Nethercote
c6eb443078 Bug 1187134 (part 4) - Replace nsBaseHashtable::Enumerate() calls in netwerk/cache{,2}/ with iterators. r=valentin. 2015-12-03 14:00:03 -08:00
Nicholas Nethercote
ebabc765c0 Bug 1187134 (part 3) - Replace nsBaseHashtable::Enumerate() calls in netwerk/cache{,2}/ with iterators. r=valentin. 2015-12-03 14:00:02 -08:00
Nicholas Nethercote
523f2e6b26 Bug 1187134 (part 2) - Replace nsBaseHashtable::Enumerate() calls in netwerk/cache{,2}/ with iterators. r=valentin. 2015-12-03 13:59:58 -08:00
Nathan Froyd
996b610edd Bug 1223808 - part 2 - use UniquePtr<uint8_t[]> instead of nsAutoArrayPtr<SHA1Sum::Hash> in HandleHashKey; r=michal 2015-11-18 15:56:47 -05:00
Nicholas Nethercote
3972bc8629 Bug 1186783 (part 3) - Replace nsBaseHashtable::EnumerateRead() calls in netwerk/ with iterators. r=valentin. 2015-11-19 16:46:10 -08:00
Nicholas Nethercote
acba203d28 Bug 1186783 (part 2) - Replace nsBaseHashtable::EnumerateRead() calls in netwerk/ with iterators. r=valentin. 2015-11-19 16:44:24 -08:00
Nicholas Nethercote
6a729805d4 Bug 1186783 (part 1) - Replace nsBaseHashtable::EnumerateRead() calls in netwerk/ with iterators. r=valentin. 2015-11-19 15:31:28 -08:00
Yoshi Huang
dc3740f0fa Bug 1209162 - Create OriginAttributes subtypes. IGNORE IDL r=sicking. 2015-11-03 09:50:54 +08:00
Michal Novotny
90f5c2606d Bug 1222782 - TSan: data race netwerk/cache2/CacheIOThread.cpp:148 Target (race on mXPCOMThread), r=jseward 2015-11-13 18:49:29 +01:00
Michal Novotny
ce912d02cd Bug 1190951 - TSan: data race netwerk/cache2/CacheIndex.cpp:1397 CacheIndex::IsUpToDate, r=valentin.gosu 2015-11-12 11:07:48 +01:00
Patrick McManus
dc124e51a4 bug 1219466 - convert netwerk to LazyLogModule r=valentin.gosu 2015-11-02 23:35:29 -05:00
Honza Bambas
391d8cf230 Bug 1206060 - Show pinning status at about:cache. r=michal 2015-10-30 08:12:00 +01:00
Birunthan Mohanathas
94998cf5fe Bug 1219392 - Capitalize mozilla::unused to avoid conflicts. r=froydnj 2015-11-02 07:53:26 +02:00
Honza Bambas
c5e600d42f Bug 1032254 - Generic way to pin reasource in the HTTP cache, r=michal
* * *
Bug NNNNNNN - message, r=reviewer
2015-10-22 12:11:00 +02:00
Nathan Froyd
e4e2da55c9 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
Honza Bambas
b9f7e7b3ec Bug 1165269 - Use OriginAttributes in nsILoadContextInfo, r=michal+allstars 2015-10-11 18:13:09 +02:00
Nicholas Nethercote
27be6f6f2f Bug 1209351 (part 4) - Optimize nsTHashTable::RemoveEntry() usage in netwerk/. r=michal.novotny. 2015-09-24 19:10:37 -07:00
Nathan Froyd
ccb9ab203d Bug 1156974 - mark CacheFileHandle::mIsDoomed as a release/acquire Atomic variable; r=michal 2015-08-04 00:32:36 -04:00
Nikhil Marathe
cb21e8e41f 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
69d088e45f Bug 1198334 (part 1) - Replace the opt-in FAIL_ON_WARNINGS with the opt-out ALLOW_COMPILER_WARNINGS. r=glandium.
The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.
2015-08-27 20:44:53 -07:00
Honza Bambas
f559a5a5e2 Bug 1082735 - Don't use InsertElementSorted in HTTP cache, r=michal 2015-08-17 15:18:59 -07:00
Arnaud Bienner
5f922f1572 Bug 1190086 - Use new String::Contains(char) method more widely r=froydnj 2015-08-14 00:49:15 +02:00
Kyle Huey
0a62d4d460 Bug 1179909: Refactor stable state handling. r=smaug
This is motivated by three separate but related problems:

1. Our concept of recursion depth is broken for things that run from AfterProcessNextEvent observers (e.g. Promises). We decrement the recursionDepth counter before firing observers, so a Promise callback running at the lowest event loop depth has a recursion depth of 0 (whereas a regular nsIRunnable would be 1). This is a problem because it's impossible to distinguish a Promise running after a sync XHR's onreadystatechange handler from a top-level event (since the former runs with depth 2 - 1 = 1, and the latter runs with just 1).

2. The nsIThreadObserver mechanism that is used by a lot of code to run "after" the current event is a poor fit for anything that runs script. First, the order the observers fire in is the order they were added, not anything fixed by spec. Additionally, running script can cause the event loop to spin, which is a big source of pain here (bholley has some nasty bug caused by this).

3. We run Promises from different points in the code for workers and main thread. The latter runs from XPConnect's nsIThreadObserver callbacks, while the former runs from a hardcoded call to run Promises in the worker event loop. What workers do is particularly problematic because it means we can't get the right recursion depth no matter what we do to nsThread.

The solve this, this patch does the following:

1. Consolidate some handling of microtasks and all handling of stable state from appshell and WorkerPrivate into CycleCollectedJSRuntime.
2. Make the recursionDepth counter only available to CycleCollectedJSRuntime (and its consumers) and remove it from the nsIThreadInternal and nsIThreadObserver APIs.
3. Adjust the recursionDepth counter so that microtasks run with the recursionDepth of the task they are associated with.
4. Introduce the concept of metastable state to replace appshell's RunBeforeNextEvent. Metastable state is reached after every microtask or task is completed. This provides the semantics that bent and I want for IndexedDB, where transactions autocommit at the end of a microtask and do not "spill" from one microtask into a subsequent microtask. This differs from appshell's RunBeforeNextEvent in two ways:
a) It fires between microtasks, which was the motivation for starting this.
b) It no longer ensures that we're at the same event loop depth in the native event queue. bent decided we don't care about this.
5. Reorder stable state to happen after microtasks such as Promises, per HTML. Right now we call the regular thread observers, including appshell, before the main thread observer (XPConnect), so stable state tasks happen before microtasks.
2015-08-11 06:10:46 -07:00
Nicholas Nethercote
df9fddf22b Bug 1182961 (part 2, attempt 2) - Use nsTHashtable::Iterator in CacheIndex. r=michal. 2015-07-26 20:15:36 -07:00
Nicholas Nethercote
512bf68d9c Bug 1182961 (part 1, attempt 2) - Use nsTHashtable::Iterator in CacheIndex. r=michal. 2015-07-28 21:14:39 -07:00
Nicholas Nethercote
3d89b3a826 Bug 1182961 (part 3, attempt 2) - Use nsTHashtable::Iterator in CacheIndex. r=michal. 2015-07-26 20:35:31 -07:00
Nicholas Nethercote
1a5ac2af8f Bug 1182961 (part 4, attempt 2) - Use nsTHashtable::Iterator in CacheFileHandles. r=michal. 2015-07-26 23:31:22 -07:00
Nicholas Nethercote
126502630c Backout bff74cecc67c, ffe0edb2aae7, b60b7c267cef, 6da154b43265, bcf6fd3ab9bb (bug 1182961 parts 1--5) for possible intermittent failures and performance problems. 2015-08-06 16:30:47 -07:00
Nicholas Nethercote
5c4088957b Bug 1182961 (part 4) - Use nsTHashtable::Iterator in CacheFileHandles. r=michal. 2015-07-26 23:31:22 -07:00
Nicholas Nethercote
54440af933 Bug 1182961 (part 3) - Use nsTHashtable::Iterator in CacheIndex. r=michal. 2015-07-26 20:35:31 -07:00
Nicholas Nethercote
47de426a44 Bug 1182961 (part 2) - Use nsTHashtable::Iterator in CacheIndex. r=michal. 2015-07-26 20:15:36 -07:00
Nicholas Nethercote
0c2ec2d27a Bug 1182961 (part 1) - Use nsTHashtable::Iterator in CacheIndex. r=michal. 2015-07-28 21:14:39 -07:00
Nicholas Nethercote
953689e82d 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.)
2015-07-30 21:19:57 -07:00
Carsten "Tomcat" Book
3ab2f465e5 Backed out changeset fb2a27db76bc (bug 1032254) for OS X Static Build Bustage on a CLOSED TREE 2015-07-31 07:57:50 +02:00
Valentin Gosu
aefe552c95 Bug 1032254 - Provide a way to pin resources in the http cache r=honzab 2015-07-30 11:40:00 +02:00
Nicholas Nethercote
242308999c 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.
2015-07-28 23:24:24 -07:00
Michal Novotny
6de49b5bc3 Bug 1177278 - Large OOMs in CacheFileMetadata::WriteMetadata, r=honzab 2015-07-22 15:23:16 +02:00
Birunthan Mohanathas
47ed3a3675 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
Michael Layzell
355a5ad0bf Bug 1180993 - Part 3: Correct use sites of functions which return already_AddRefed. r=ehsan 2015-07-10 08:36:00 -04:00
Michal Novotny
21731fe6f2 Bug 1171724 - Large OOMs in CacheFileMetadata, r=honzab 2015-06-24 06:33:37 +02:00
David Major
335553d3db Bug 1173860: Null check on sGlobalEntryTables. r=mcmanus 2015-06-17 11:23:43 -04:00
Michal Novotny
4baf7e2945 Bug 1151812 - Add telemetry to find optimal cache entry hash size, r=honzab 2015-06-14 14:13:18 +02:00
Eric Rahm
387657eb09 Bug 1165515 - Part 14: Undef PR_LOG macros when using mozilla/Logging.h. r=froydnj
Make it harder for users to accidentally reintroduce usage of the PR_LOG macros
when using 'mozilla/Logging.h'. This can still be worked around by directly
including 'prlog.h' (and not 'mozilla/Logging.h') if absolutely necessary.
2015-06-03 15:26:07 -07:00
Eric Rahm
9100016c49 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
6d13987359 Bug 1165515 - Part 3: Convert PR_LOG_TEST to MOZ_LOG_TEST. r=froydnj 2015-06-03 15:22:28 -07:00
Honza Bambas
286d5912dd Bug 1170534 - Remove Visual Event Tracer. r=dougt 2015-06-02 11:44:00 -04:00
Carsten "Tomcat" Book
9432818a46 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)
2015-06-02 13:05:56 +02:00
Eric Rahm
5505ea9746 Bug 1165515 - Part 14: Undef PR_LOG macros when using mozilla/Logging.h. r=froydnj
Make it harder for users to accidentally reintroduce usage of the PR_LOG macros
when using 'mozilla/Logging.h'. This can still be worked around by directly
including 'prlog.h' (and not 'mozilla/Logging.h') if absolutely necessary.
2015-06-01 22:17:34 -07:00