Commit Graph

2259 Commits

Author SHA1 Message Date
Carsten "Tomcat" Book
3470d6dfe0 Backed out changeset 928ad5e93372 (bug 1308317) 2016-10-14 14:58:35 +02:00
Carsten "Tomcat" Book
b6187e2b2e Backed out changeset 96d1b7238832 (bug 1308317) 2016-10-14 14:58:33 +02:00
Eric Rahm
9aeecd32b2 Bug 1308317 - Part 8: Just use an nsTAutoArray. r=froydnj
This switches over from using a half-baked auto array to nsTAutoArray.

MozReview-Commit-ID: 6FR2SjOhoZR
2016-10-13 22:04:42 -07:00
Eric Rahm
5e0a57ef2e Bug 1308317 - Part 7: Remove nsSupportsArray::RemoveElementsAt. r=froydnj
MozReview-Commit-ID: H3A3gxckw5o
2016-10-13 22:04:41 -07:00
Eric Rahm
b3bce28ad5 Bug 1308317 - Part 6: Remove nsSupportsArray::GetIndexOfStartingAt. r=froydnj
This removes the scriptable method |GetIndexOfStartingAt| which is unused in
our codebase and turns up no references in the plugins repo. This allows to
remove the non-scriptable |IndexOfStartingAt| which is folded into |IndexOf|.

MozReview-Commit-ID: 2ADz5mLIvMU
2016-10-13 22:04:39 -07:00
Eric Rahm
08e653d2cf Bug 1308317 - Part 5: Remove nsSupportsArray::DeleteLastElement. r=froydnj
|DeleteLastElement| is scriptable, but a search of our add-on repo turned up
no hits and there were no references in gecko code. This also allows us to
remove the non-scriptable |RemoveLastElement| which was only called by
|DeleteLastElement|.

MozReview-Commit-ID: 20FXBrosacA
2016-10-13 22:04:38 -07:00
Eric Rahm
b8014cf9d8 Bug 1308317 - Part 4: Remove nsSupportsArray::Equals. r=froydnj
|Equals| is not scriptable and unused in our codebase.

MozReview-Commit-ID: BsbJIuR9fSk
2016-10-13 22:04:37 -07:00
Eric Rahm
23dd90cee5 Bug 1308317 - Part 3: Remove nsSupportsArray::SizeTo. r=froydnj
|SizeTo| is not scriptable and unused in our codebase.

MozReview-Commit-ID: 1DrTm46qbar
2016-10-13 22:04:35 -07:00
Eric Rahm
a3599628c0 Bug 1308317 - Part 2: Remove nsSupportsArray::MoveElement. r=froydnj
|MoveElement| is not scriptable and unused in our codebase.

MozReview-Commit-ID: CBe8WZHG1JG
2016-10-13 22:04:34 -07:00
Eric Rahm
f4bf8c3f70 Bug 1308317 - Part 1: Remove debug code. r=froydnj
MozReview-Commit-ID: 7TQG7flcJkj
2016-10-13 22:04:33 -07:00
Eric Rahm
11d01803a8 Bug 1308036 - Check sizes when growing nsISupportsArray. r=froydnj
This adds size checks when growing the nsISupportsArray. It also removes
|InsertElementsAt| and |AppendElements| which are unused notxpcom interfaces
that would need similar modifications.

MozReview-Commit-ID: ET32q0OCrLU
2016-10-07 09:55:32 -07:00
Nathan Froyd
d50eeaffb6 Bug 1305422 - followup - use correct check for memory allocation failure in nsWindowsRegKey.cpp; r=bustage 2016-09-30 01:56:28 -04:00
Nathan Froyd
d59bcecbbd Bug 1305422 - part 2 - don't call size_forward on ns*String::iterators to check for SetLength failure; r=erahm
We have better ways of checking for SetLength failure nowadays, and even
if these SetLength calls did fail, the program would crash anyway.
2016-09-29 22:33:58 -04:00
Thomas Wisniewski
ba6cb5196e Bug 1305202 - Use NullString() more and remove superfluous Truncates(). r=smaug 2016-09-23 21:10:01 -04:00
David Anderson
f80736e0c8 Shutdown XPCOM-dependent resources in ImageBridgeChild at the appropriate time. (bug 1298938 part 3.1, r=mattwoodrow)
--HG--
extra : rebase_source : 9579e1ca6ec1af2fac7cd0fc4574b849cc8b8e12
2016-09-13 16:30:57 -07:00
Nicholas Nethercote
c2306345d5 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.

--HG--
extra : rebase_source : e94323614bd10463a0c5134a7276238a7ca1cf23
2016-08-24 15:23:45 +10:00
Kan-Ru Chen
b6d880aca1 Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj
The patch is generated from following command:

  rgrep -l unused.h|xargs sed -i -e s,mozilla/unused.h,mozilla/Unused.h,

MozReview-Commit-ID: AtLcWApZfES


--HG--
rename : mfbt/unused.h => mfbt/Unused.h
2016-08-24 14:47:04 +08:00
Nicholas Nethercote
3873d0c8f6 Bug 1295053 (part 4) - Don't use NS_METHOD for remaining xpcom functions. r=froydnj.
These don't need __stdcall on Win32.

--HG--
extra : rebase_source : 19e4bf0d67b7fe25f53c0cff24471ef23d26dcf0
2016-08-15 14:49:26 +10:00
Igor
175543fda8 Bug 1293384 - Part 2: Rename Snprintf.h header to Sprintf.h. r=froydnj 2016-08-14 23:43:21 -07:00
Igor
a57972337d Bug 1293384 - Part 1: Rename snprintf_literal to SprintfLiteral. r=froydnj 2016-08-14 23:44:00 -07:00
Nicholas Nethercote
3b0485fcdb 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%.

--HG--
extra : rebase_source : c15d85298e0975fd030cd8f8f8e54501f453959b
2016-08-12 17:36:22 +10:00
Igor
4878f6bf37 Bug 1289890 - Change nsCOMArray::ReplaceObjectAt() return type from "bool" to "void", since it always succeeds. r=froyndnj 2016-08-02 16:20:00 +02:00
Matthew Wein
33de9c036e Bug 1285063 - Part 1: Add a helper to XPCOMUtils to iterate over entries in a category. r=kmag
MozReview-Commit-ID: 3mjrPrRuLej

--HG--
extra : rebase_source : 7b7dad1a4bab958a590c24d97f564e34b3355633
2016-07-11 17:33:06 -07:00
Tom Tromey
5538d692d3 Bug 1286877 - do not set c-basic-offset for python-mode; r=gps
This removes the unnecessary setting of c-basic-offset from all
python-mode files.

This was automatically generated using

    perl -pi -e 's/; *c-basic-offset: *[0-9]+//'

... on the affected files.

The bulk of these files are moz.build files but there a few others as
well.

MozReview-Commit-ID: 2pPf3DEiZqx

--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
2016-07-14 10:16:42 -06:00
Chris Peterson
d634a99cad Bug 1277106 - Part 4: Remove MOZ_UTF16() macro. r=Waldo 2016-07-19 21:07:53 -07:00
Ralph Giles
956493cd6e Bug 1275744 - Reference MOZ_LOG in xpcom comments. r=erahm
NSPR_LOG_MODULES is deprecated.

MozReview-Commit-ID: Cel3JCLXLmp

--HG--
extra : rebase_source : da100ece62fd571d19a07455f8c256f5cd39f62b
2016-05-25 15:26:10 -07:00
Jarda Snajdr
a8fa0feb87 Bug 1269765 - Notify http-on-opening-request in content process. r=valentin 2016-05-30 01:24:00 +02:00
Bobby Holley
70200c80e9 Bug 1275755 - Remove main-thread restrictions on atoms. r=froydnj 2016-05-28 17:08:10 +01:00
Bobby Holley
2c597c5a3d Bug 1275755 - Use a GC scheme to free unused atoms. r=froydnj 2016-05-28 17:08:08 +01:00
Bobby Holley
95caf3be29 Bug 1275755 - Protect gAtomTable with a lock. r=froydnj 2016-05-28 17:08:07 +01:00
Bobby Holley
3eec1c3284 Bug 1275755 - Use an explicit init routine for the atom table. r=froydnj 2016-05-28 17:08:05 +01:00
Bobby Holley
60591b7a86 Bug 1275755 - Remove MOZ_DUMP_ATOM_LEAKS. r=froydnj
I don't think anyone is using this anymore. It would be good to assert that there
are no leaks, but that doesn't pass for me in a local build, and I don't have time
to chase it.
2016-05-28 17:08:03 +01:00
Honza Bambas
bd3a9d8a05 Bug 1274583 - Add SkipUntil method to mozilla::Tokenizer, r=froydnj
MozReview-Commit-ID: HndyF0L0pdx

--HG--
extra : rebase_source : ffac585c1ed47eebe6e5e9f0ae8c4d566c7cd317
2016-05-22 07:33:00 -07:00
Chris Peterson
8a9e2d2bd4 Bug 1272513 - Part 2: Remove redundant -Wshadow CXXFLAGS from moz.build files. r=glandium 2016-05-14 00:54:55 -07:00
Kyle Huey
941ab1f522 Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-05-05 01:45:00 -07:00
Nathan Froyd
9b00f3e468 Bug 1262399 - remove Impl suffixes from nsSupports* implementations; r=mccr8
Having the Impl suffix isn't really necessary, and if we start creating
instances of these classes directly, it's also rather ugly.  Let's get
rid of them.
2016-05-03 15:25:41 -05:00
Nicholas Nethercote
7cc5e1d84e Bug 1268772 (part 5) - Use MOZ_MUST_USE in other parts of xpcom/ds/. r=erahm.
As well as adding MOZ_MUST_USE to a number of functions, this patch:

- Changes the return type of nsObserverList::GetObserverList() from |nsresult|
  to |void|, because it always returned NS_OK and none of the callers checked
  the result.

- Removes an unnecessary |new| check in nsSupportsArray::Enumerate().

--HG--
extra : rebase_source : 3a93124ef2a7db3929119194ceacbc56bc80d2c6
2016-04-28 17:11:17 +10:00
Nicholas Nethercote
2ae68d12e9 Bug 1268772 (part 4) - Use MOZ_MUST_USE with NS_NewISupportsArray(). r=erahm.
A few callers of NS_NewISupportsArray() didn't use the return value to detect
failure, but instead checked if the |array| argument was null after the call.
This is inconsistent with the majority of the calls to NS_NewISupportsArray().
This patch changes them to be checked in the normal way.

--HG--
extra : rebase_source : bf91836d7c3b159833c303a3716f4d9366f8b76a
2016-05-02 09:06:47 +10:00
Nicholas Nethercote
e049e2be4f Bug 1268772 (part 3) - Remove NS_NewWindowsRegKey()'s return value. r=erahm.
It's always NS_OK. The patch also removes an unnecessary failure check as a
result.

--HG--
extra : rebase_source : 3a0c30f9ca0e838682204ed1a8d46d6ab35e20b8
2016-05-02 09:06:45 +10:00
Nicholas Nethercote
27327f8bea Bug 1268772 (part 2) - Make infallible nsVariant methods return |void| instead of |nsresult|. r=erahm.
This makes things clearer and removes some unnecessary nsresult checks.

The patch also:
- removes some unnecessary |new| and moz_xmalloc() checks;
- adds MOZ_MUST_USE to some fallible nsVariant methods.

--HG--
extra : rebase_source : fd0bd0c55c22ebf194246ec9997fe971cf282e69
2016-04-29 13:47:44 +10:00
Nicholas Nethercote
a2776c6af7 Bug 1268772 (part 1) - Remove nsCheapSet::Put()'s return value. r=erahm.
It's always NS_OK and none of the call sites look at it.

--HG--
extra : rebase_source : c70ca0c98ef27065ddfacc0a1e84dcfef2ff500a
2016-04-28 15:59:58 +10:00
Carsten "Tomcat" Book
ba3fe0975c Backed out changeset 85ce8cb0639a (bug 1268313)
--HG--
extra : rebase_source : 56d1cf41a2dc4959b67f834e07192a5c772176a8
2016-04-29 14:21:16 +02:00
Nicholas Nethercote
2511b2c327 Bug 1267550 (part 2) - Rename MOZ_WARN_UNUSED_RESULT as MOZ_MUST_USE. r=froydnj.
It's an annotation that is used a lot, and should be used even more, so a
shorter name is better.

MozReview-Commit-ID: 1VS4Dney4WX

--HG--
extra : rebase_source : b26919c1b0fcb32e5339adeef5be5becae6032cf
2016-04-27 14:16:50 +10:00
Kyle Huey
48a594a09e Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-04-28 14:08:25 -07:00
Chris Peterson
c2fe3cc9ea Bug 1266295 - Remove unnecessary compiler version checks for gcc <= 4.8.0 in xpcom. r=froydnj 2016-04-17 17:10:00 -07:00
Nicholas Nethercote
d8cfadc76d Bug 1261744 - Add two missing null checks for nsStringBuffer::Alloc(). r=erahm.
--HG--
extra : rebase_source : 7465db70cf5a3e19416a742481b3321e8b6eef16
2016-04-07 09:35:50 +10:00
Valentin Gosu
a44929e1eb Bug 1261382 - Add ReadUntil method to Tokenizer r=mayhemer 2016-04-08 16:27:32 +02:00
Nicholas Nethercote
9601d6a63f Bug 1261735 (part 4) - Change StaticAtomEntry::mAtom to |StaticAtom*|. r=erahm.
This required reordering a bunch of stuff, so I took the opportunity to do a
big reordering. The new order:

- class CheckStaticAtomSizes;
- class DynamicAtom, class StaticAtom, their methods;
- gAtomTable and related functions;
- ~DynamicAtom() (here because it depends on gAtomTable stuff);
- gStaticAtomTable and related functions;
- exported functions.

--HG--
extra : rebase_source : 5fd4bf9a3f0c628dc3f74c0d8a81aadf48fd6dd7
2016-04-06 12:01:24 +10:00
Nicholas Nethercote
cd63c6bfee Bug 1261735 (part 3) - De-virtualize nsIAtom::IsStaticAtom(). r=froydnj,erahm.
This avoids the need for some virtual function calls and also will help lead to
distinct representations for dynamic and static atoms.

--HG--
extra : rebase_source : 16bbe6f1e1309ee3e4fab7a0d222e638178a2a9c
2016-04-06 11:28:40 +10:00
Nicholas Nethercote
a1d85c6ab8 Bug 1261735 (part 2) - Inline some {Dynamic,Static}Atom methods. r=erahm.
--HG--
extra : rebase_source : 0e50d8542fdf5de18b22dd2aa4a5fea71f48d032
2016-04-06 11:28:39 +10:00