Commit Graph

102 Commits

Author SHA1 Message Date
Jonathan Kew
116a1e3d84 Bug 1368654 - pt 1 - Implement memory reporter support for FrameProperties. r=mats 2017-05-31 19:52:47 +01:00
Mats Palmgren
fc6be39c2d Bug 1364805 part 3 - Implement Type() by indexing a static array using the mClass field. Remove the nsIFrame::mType field. r=jfkthame
In the nsWindowMemoryReporter.cpp / nsArenaMemoryStats.h I'm only
including the concrete frame classes now - we obviously never have
instances of the other IDs so there's no need to collect stats for them.

MozReview-Commit-ID: 48uFCZ3xKBC
2017-05-26 12:11:11 +02:00
Tom Tromey
e90d95a3f9 Bug 1060419 - make AppendPrintf and nsPrintfCString use Printf.h, r=froydnj
MozReview-Commit-ID: 2E8FoiNxU8L
2016-12-14 09:32:21 -07:00
Bill McCloskey
54da76be6b Bug 1339289 - Give names to a lot of common timers (r=ehsan)
MozReview-Commit-ID: IMsv5bkyjBL
2017-02-15 12:30:01 -08:00
Nicholas Nethercote
62b6b0fce6 Bug 1297961 (part 1) - Introduce nsURI::GetSpecOrDefault(). r=hurley.
This function is an infallible alternative to nsIURI::GetSpec(). It's useful
when it's appropriate to handle a GetSpec() failure with a failure string, e.g.
for log/warning/error messages. It allows code like this:

  nsAutoCString spec;
  uri->GetSpec(spec);
  printf("uri: %s", spec.get());

to be changed to this:

  printf("uri: %s", uri->GetSpecOrDefault().get());

This introduces a slight behavioural change. Previously, if GetSpec() failed,
an empty string would be used here. Now, "[nsIURI::GetSpec failed]" will be
produced instead. In most cases this failure string will make for a clearer
log/warning/error message than the empty string.
* * *
Bug 1297961 (part 1b) - More GetSpecOrDefault() additions. r=hurley.

I will fold this into part 1 before landing.
2016-08-26 16:02:31 +10:00
Nicholas Nethercote
1009bf0056 Bug 1297658 - Avoid unnecessary checking in memory reporters. r=erahm.
This patch removes checking of all the callback calls in memory reporter
CollectReport() functions, because it's not useful.

The patch also does some associated clean-up.

- Replaces some uses of nsIMemoryReporterCallback with the preferred
  nsIHandleReportCallback typedef.

- Replaces aCallback/aCb/aClosure with aHandleRepor/aData for CollectReports()
  parameter names, for consistency.

- Adds MOZ_MUST_USE/[must_use] in a few places in nsIMemoryReporter.idl.

- Uses the MOZ_COLLECT_REPORT macro in all suitable places.

Overall the patch reduces code size by ~300 lines and reduces the size of
libxul by about 37 KiB on my Linux64 builds.
2016-08-24 15:23:45 +10:00
Andrea Marchesini
c902e6e69c Bug 1278816 - Move Performance API into dom/performance, r=smaug 2016-06-09 12:42:21 +02:00
Nicholas Nethercote
fc3a186bf8 Bug 1187151 (part 18) - Replace nsBaseHashtable::Enumerate() calls in dom/ with iterators. r=mccr8. 2016-01-28 15:14:45 -08:00
Kyle Huey
e95edb30a9 Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug 2016-01-30 09:05:36 -08:00
Kyle Huey
8f1698c80c Bug 1241763: Don't fire dom-window-destroyed on outer windows. r=bz 2016-01-22 10:27:54 -08:00
Nicholas Nethercote
f2c03dfefc Bug 1187782 (part 3) - Replace nsBaseHashtable::EnumerateRead() calls in dom/base/ with iterators. r=khuey. 2015-10-26 22:22:10 -07:00
Kyle Huey
8f8794e1c7 Bug 1216401: Eviscerate nsIDOMWindow, move still needed methods to nsPIDOMWindow. r=bz 2015-10-26 14:37:32 -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
Nicholas Nethercote
0d572ee0cf Bug 1192128 - In DOM memory reporter, handle WindowID() being a uint64_t. r=mccr8. 2015-08-06 22:09:30 -07:00
Birunthan Mohanathas
d52615cb84 Bug 1182980 - Part 5: Use nsTHashtable::Iterator in nsWindowMemoryReporter::CollectReports. r=khuey 2015-07-22 09:42:01 -07:00
Birunthan Mohanathas
9afeb34f1b Bug 1182980 - Part 4: Use nsTHashtable::Iterator in nsWindowMemoryReporter::UnlinkGhostWindows. r=khuey 2015-07-22 09:42:01 -07:00
Juan Gomez
89035d527e Bug 1171931 - Refactor duplicated code using XRE_IsParent/ContentProcess. r=froydnj 2015-07-03 18:29:00 -07:00
Ryan VanderMeulen
7aba9d7002 Backed out changeset 8b4e4083639e (bug 1171931) for B2G debug emulator bustage. 2015-06-25 19:48:42 -04:00
Juan Gomez
7323e89a40 Bug 1171931 - Refactor duplicated code using XRE_IsParent/ContentProcess. r=froydnj 2015-06-24 14:11:00 -04:00
Cameron McCormack
07c50e206f Bug 1168299 - Break out style struct memory usage reporting from pres-shell. r=njn 2015-05-27 12:08:42 +10:00
Bobby Holley
41099b29ec Bug 951991 - Assert against calling GetCurrentInnerWindow on an inner. r=smaug
The current convention is that this returns null when invoked on an inner, which
callers may or may not handle correctly. But when we start using GetEntryGlobal,
we'll end up with a lot of inners where we used to get outers, so we should get
strict about this now.
2014-08-19 12:02:05 -07:00
Nicholas Nethercote
7b107d5931 Bug 1010064 - Allow memory reports to be anonymized. r=bsmedberg. 2014-05-20 23:06:54 -07:00
Andrew McCreight
2ea737a668 Bug 994090 - Use do_CreateInstance in nsWindowMemoryReport. r=smaug 2014-05-15 09:35:00 -04:00
Birunthan Mohanathas
eeb9aaaa94 Bug 900908 - Part 3: Change uses of numbered macros in nsIClassInfoImpl.h/nsISupportsImpl.h to the variadic variants. r=froydnj 2014-04-27 03:06:00 -04:00
Neil Rashbrook
ccc6211ccc Bug 514280 Remove concrete classes from interface maps r=bsmedberg 2014-03-28 08:40:13 +00:00
Andrew McCreight
37c97379e7 Bug 977940, part 2 - Don't automatically trigger the ghost window detector during ICC. r=smaug 2014-03-08 05:38:53 -08:00
Andrew McCreight
640767370c Bug 977940, part 1 - Don't run the ghost window detector more than every 45 seconds. r=smaug 2014-03-08 05:38:52 -08:00
Andrew McCreight
b8a6c217bb Bug 966762 - Add chrome JS function to unlink ghost windows. r=smaug 2014-02-20 12:55:40 -08:00
Andrew McCreight
524b25883d Backout bug 966762 for Valgrind leaks 2014-02-19 17:17:58 -08:00
Andrew McCreight
cace651a0c Bug 966762 - Add chrome JS function to unlink ghost windows. r=smaug 2014-02-19 13:27:15 -08:00
Nathan Froyd
afb2c7a0c5 Bug 957609 - eschew code duplication in macros for CollectWindowReports; r=njn 2014-01-10 10:15:53 -05:00
Nicholas Nethercote
4114de08a9 Bug 957021 - Fix messed-up memory reporter paths. r=khuey. 2014-01-07 17:02:23 -08:00
Ehsan Akhgari
68bfe70f09 Bug 927728 - Part 1: Replace PRUnichar with char16_t; r=roc
This patch was automatically generated by the following script:

#!/bin/bash
# Command to convert PRUnichar to char16_t

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*modules/libmar*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name prtypes.h \
       ! -name Char16.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRUnichar char16_t
2014-01-04 10:02:17 -05:00
Nicholas Nethercote
49912eb578 Bug 955942 (part 2) - Remove MemoryUniReporter. r=mccr8. 2013-12-07 22:09:10 -08:00
Nicholas Nethercote
3f5924c2e0 Bug 955942 (part 1) - Remove unnecessary nsIMemoryReporter qualifiers from UNITS_* and KIND_* constants. r=mccr8. 2013-12-11 11:59:39 -08:00
Nathan Froyd
3351670052 Bug 946781 - part 4 - revert measuring the proto and iface cache on nsGlobalWindow (bug 922094); r=me 2013-12-06 13:11:53 -05:00
Nicholas Nethercote
0e122b9e83 Bug 947798 (part 1) - Rename NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN as MOZ_DEFINE_MALLOC_SIZE_OF. r=mccr8. 2013-12-07 21:38:32 -08:00
Nathan Froyd
96bad0df62 Bug 922094 - part 1 - report proto/iface cache size to about:memory; r=njn
This is just the nsWindowMemoryReporter bits; the actual measurements come later.
2013-11-21 09:13:31 -05:00
Nicholas Nethercote
0d8c64efcc Bug 936964 (part 7, attempt 2) - Make lots of classes report their own memory consumption, instead of using a separate reporter class. r=mccr8,sr=bz.
* * *
Bug 936964 (part 7b) - Fix a use-after-free found by ASan.
2013-11-07 16:35:30 +11:00
Nicholas Nethercote
188ae9dd5f Bug 943660 (attempt 2) - Remove nsIMemoryReporter::name, because it's (a) unused and (b) a bad idea. r=mccr8. 2013-11-26 18:38:50 -08:00
Ehsan Akhgari
65aaebab72 Backed out 9 changesets (bug 943660, bug 936964) because of ASAN use-after-free crashes on browser-chrome and mochitest-other
Backed out changeset 85486c4aa3d8 (bug 936964)
Backed out changeset 25312eb71998 (bug 936964)
Backed out changeset 6dbb8333960c (bug 936964)
Backed out changeset da6465ad476f (bug 936964)
Backed out changeset a87ffc992f38 (bug 936964)
Backed out changeset 4ae3a61182db (bug 936964)
Backed out changeset 34e9c3137804 (bug 936964)
Backed out changeset fd1459e71585 (bug 936964)
Backed out changeset 3e8a701d8bdc (bug 943660)

Landed on a CLOSED TREE
2013-11-27 20:05:00 -05:00
Nicholas Nethercote
c363b9d028 Bug 936964 (part 7) - Make lots of classes report their own memory consumption, instead of using a separate reporter class. r=mccr8,sr=bz. 2013-11-07 16:35:30 +11:00
Nicholas Nethercote
30104bd7d7 Bug 943660 - Remove nsIMemoryReporter::name, because it's (a) unused and (b) a bad idea. r=mccr8. 2013-11-26 18:38:50 -08:00
Birunthan Mohanathas
fd194c1851 Bug 784739 - Switch from NULL to nullptr in dom/ (1/2); r=ehsan 2013-10-28 10:04:12 -04:00
Nils Maier
3236a58b33 Bug 929297 - Part 2: Avoid calling amIAddonManager in reporters off the main process. r=njn 2013-10-28 04:53:00 +00:00
Kyle Huey
7b7ebb37b7 Bug 904720: Count event listeners. r=njn,smaug 2013-10-28 17:47:18 +08:00
Nicholas Nethercote
7d16eaa962 Bug 918207 - Support per-tab memory profiling. r=billm,mccr8,till,smaug,nfroyd. 2013-10-22 14:53:26 -07:00
Nicholas Nethercote
e3c39c80ab Bug 921923 (part 3) - Make multi-output sizeOfFoo() functions more consistent in content/, dom/ and layout/. r=till. 2013-09-30 16:20:23 -07:00
Nicholas Nethercote
ab290a0d9f Bug 913260 (part 4) - Use distinguished amounts for all the memory measurements done by telemetry. r=mccr8.
CLOSED TREE
2013-09-19 15:52:30 -07:00
Nicholas Nethercote
e9f1496c1c Bug 913260 (part 2) - Tweak ghost window reporters. r=mccr8. 2013-09-18 19:01:29 -07:00