Граф коммитов

164 Коммитов

Автор SHA1 Сообщение Дата
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Sylvestre Ledru 47a5dd1fb8 Bug 1519636 - Reformat everything to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D16388

--HG--
extra : moz-landing-system : lando
2019-01-16 08:50:07 +00:00
Nathan Froyd fc065671fb Bug 1513615 - part 3 - do more work in nsTimerEvent's constructor; r=glandium
nsTimerEvent goes through a multi-step initialization for reasons that
are lost to time.  We are also seeing peculiar crashes in
`nsTimerEvent::SetTimer()` that are only explainable by `SetTimer`
finding a non-null pointer where there should have been a null pointer.
The compiler ought to have been able to optimize those bits away, but no
matter: we can do the job ourselves and make the code clearer.

Since we only call `SetTimer` once, we should just move its work into
nsTimerEvent's constructor.
2019-01-08 19:31:40 -05:00
Nathan Froyd 7cb315f948 Bug 1513615 - part 2 - move some code around in PostTimerEvent; r=glandium
Doing this code movement separately will ideally make the next part of
this work easier to review.  The idea is that we want to extract all the
necessary information from `timer` before we pass ownership of it into
the newly-allocated nsTimerEvent.
2019-01-08 19:31:40 -05:00
Nathan Froyd b9a6220890 Bug 1513615 - part 1 - tweak nsTimerEvent allocation; r=glandium
Unlike many of our uses of `new`, nsTimerEvent has its own definition of
`operator new`, to ensure instances are allocated through
TimerEventAllocator.  And allocating with TimerEventAllocator can fail.
Later changes, however, want to assume that constructing an nsTimerEvent
can't fail, which is difficult to guarantee with the current structure.

To make that guarantee, we need to make explicit what calling `new`
does: there's an "allocate memory" step and a "construct the object"
step.  The first part can fail, and that's what we care about here.
Once we have a chunk of memory, we can construct the object as normal,
secure in the knowledge that calling (placement) `new` is now guaranteed
to succeed.
2019-01-08 19:31:40 -05:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Andrew McCreight 68a1d4dad7 Bug 1508818, part 3 - Shrink comments so they don't get poorly reflowed by clang-format. r=froydnj
Clang format does not always reflow comments correctly to get them
within 80 columns.

The major categories of failures I have noticed in xpcom/ are:

- Comments that are lists. I fixed these by manually getting them so
  they'll be within 80 columns after clang-format runs.

- Comments intermixed with lists of things like enums, initializers,
  or even fields in a class. It doesn't seem to associate the comment
  with the item in the list correctly. The worst cases of these happen
  when it changes initializer lists from having commas at the start of
  each item to having them at the end. In the initializer comma cases,
  I fixed them by making the commas at the end, so clang-format won't
  mix things up. For other cases, I often moved the comment for an
  item onto its own line, because it was not possible to have both the
  comment and the item on the same line and stay within 80 columns.

- One odd case is nsEnumeratorUtils.cpp, where the end of line comment
  after a NS_DECL macro confused clang-format and made it stop
  realizing that the NS_DECL thing was a complete statement. I also
  added a blank line to that file before a declaration because I think
  that is better.

Depends on D13183

Differential Revision: https://phabricator.services.mozilla.com/D13184

--HG--
extra : moz-landing-system : lando
2018-11-28 21:06:09 +00:00
Brian Hackett 54c917ef76 Bug 1465452 Part 13 - Avoid recording some timer thread state, r=froydnj.
--HG--
extra : rebase_source : f5a2e514099be1221960fb91de83d827e2121801
2018-07-21 14:36:02 +00:00
Nika Layzell 0c3ba13e4c Bug 1437167 - Part 1: Stop using PRIntervalTime as the argument to CondVar::Wait and Monitor::Wait, r=mstange, r=froydnj 2018-04-10 17:49:47 -04:00
Nathan Froyd efd709bd4f Bug 1447744 - don't implement nsINamed for mozilla::Runnable when it's unused; r=erahm
We only use nsINamed on runnables for certain kinds of telemetry, and
those kinds of telemetry aren't being gathered on RELEASE_OR_BETA
builds.  We effectively make nsINamed::GetName a no-op when we're not
collecting said telemetry.  But implementing nsINamed does have a cost:
the vtable of every runnable (and we have hundreds of subclasses of
mozilla::Runnable) will contain pointers for GetName (and extra pointers
for QueryInterface/AddRef/Release), and all those pointers times all
those subclasses adds up quickly.  Let's not implement nsINamed when
nsINamed isn't going to be used.

This change saves ~100K of binary size on x86-64 Linux; the savings
should be similar on other 64-bit systems, and ~50K on 32-bit systems.
2018-03-23 14:53:55 -04:00
Miko Mynttinen 65c6bee9d6 Bug 1445302 - Replace TArray.RemoveElementAt(TArray.Length() - 1) pattern with TArray.RemoveLastElement() or TArray.PopLastElement() r=froydnj
MozReview-Commit-ID: rGjabnP2iz

--HG--
extra : rebase_source : 1ef6c5ce028ac9ebd9f3176d57835c43fe46bada
2018-03-13 14:51:33 +01:00
Byron Campen [:bwc] 6b3da0609f Bug 1383019: Move more logic under the protection of nsTimerImpl::mMutex, and simplify. r=froydnj, a=abillings
MozReview-Commit-ID: JjYScKwyika

--HG--
extra : rebase_source : a5a8a17f86459ace51d9250454bd4cf1433130b0
2017-09-14 12:19:24 -05: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
Olli Pettay c6e5adc488 Bug 1371438, investigate why assertion fails on Windows, r=bkelly 2017-06-10 03:21:29 +03:00
Olli Pettay e4559f5c3b Bug 1368493, TimerThread::FindNextFireTimeForCurrentThread should look at timers in order, r=bkelly
--HG--
extra : rebase_source : a86b344380cbcd34d8930688eb90192846636dd8
2017-06-05 16:49:54 +03:00
Ben Kelly 3c709a6f61 Bug 1363829 P15 Expose nsITimer::GetAllowedEarlyFiringMicroseconds(). r=froydnj 2017-05-31 17:13:20 -07:00
Olli Pettay 2c06db876d Bug 1311425, review comment fix to ensure low priority timers aren't taken into account when calling NS_GetTimerDeadlineHintOnCurrentThread, r=smaug 2017-05-26 09:13:39 -04:00
Andreas Farre 892408079a Bug 1311425 - Add pref for how far into the timer queue, r=smaug,f=froydnj
--HG--
extra : rebase_source : 170404bed646efffa71f1e5b0970ec69f6dc4ce5
2017-05-24 21:14:29 -04:00
Andreas Farre 8e2322bcce Bug 1311425 - Make idle callbacks aware of nsITimers, r=froydnj
--HG--
extra : rebase_source : 3baa3054c1ca08783fd0d04dab91d3f97d2e65f1
2017-05-24 21:12:55 -04:00
Byron Campen [:bwc] 2394603d23 Bug 1361098: Simplify TimerThread::Init some. r=froydnj
--HG--
extra : rebase_source : dad786e4130964e48aef9812773e7cf4840ba46d
extra : amend_source : f6d7b3421c036bc94a2067439244b78dc75ccb68
2017-05-01 13:42:11 -05:00
Cervantes Yu cc5836fbae Bug 1024669 - Part 1: Annotate crash reports with thread names. r=gsvelto
NS_SetCurrentThreadName() is added as an alternative to PR_SetCurrentThreadName()
inside libxul. The thread names are collected in the form of crash annotation to
be processed on socorro.

MozReview-Commit-ID: 4RpAWzTuvPs
2017-02-07 18:57:23 +08:00
Ben Kelly a2eeb6e4f1 Bug 1325254 P5 Make nsITimer::Cancel() O(c). r=froydnj 2017-04-20 17:56:07 -04:00
Ben Kelly 497ffb3b7c Bug 1325254 P4 Dynamically allocate Entry structs stored in TimerThread::mTimers. r=froydnj 2017-04-20 17:56:07 -04:00
Ben Kelly 0a01ed59e5 Bug 1325254 P3 Sort TimerThread list as a binary heap. r=froydnj 2017-04-20 17:56:07 -04:00
Ben Kelly b208c81349 Bug 1325254 P2 Make TimerThread list store an entry struct and just drop nsTimerImpl ref on cancel. r=froydnj 2017-04-20 17:56:07 -04:00
Ben Kelly da850ec4e1 Bug 1325254 P1 Make TimerThread::mTimers store RefPtr<nsTimerImpl> objects. r=froydnj 2017-04-20 17:56:06 -04:00
Sebastian Hengst 1828ea89ca Backed out changeset 7fdcabdbb675 (bug 1024669) for failing mda, GTest and talos jobs. r=backout on a CLOSED TREE 2017-04-10 19:05:44 +02:00
Cervantes Yu 364e524eca Bug 1024669 - Part 1: Annotate crash reports with thread names. r=gsvelto
MozReview-Commit-ID: 4RpAWzTuvPs
2017-02-07 18:57:23 +08:00
Carsten "Tomcat" Book 02ddc23c74 Backed out changeset 7a52d887bcea (bug 1024669) for bustage 2017-04-10 11:43:49 +02:00
Cervantes Yu ece1ce1a7d Bug 1024669 - Part 1: Annotate crash reports with thread names. r=gsvelto
MozReview-Commit-ID: 4RpAWzTuvPs
2017-02-07 18:57:23 +08:00
Eric Rahm 478755933a Bug 1351732 - Part 2: Replace use of PLArena with ArenaAllocator in xpcom. r=froydnj
This swaps xpcom's plarena usage to ArenaAllocator. The new ArenaStrdup
extensions are used as well.

MozReview-Commit-ID: DHDfl6IkGJL
2017-03-30 16:46:58 -07:00
Byron Campen [:bwc] ada35c9a53 Bug 1339588 - Part 1: Simplify nsTimerEvent::Cancel, since there's no need to release the nsTimerImpl itself. r=froydnj
MozReview-Commit-ID: 6br6DaDqxR0

--HG--
extra : rebase_source : 13cde860824483332c42ac2f86bca722bf42d36b
extra : source : 47a3ac382469cb8bd4cdfa123457a6d6b4f11d39
2017-02-14 15:29:01 -06:00
Byron Campen [:bwc] 276d12bcef Bug 1328643: Add some locking to prevent races caused by Cancel/Init from threads other than the target. r=froydnj
MozReview-Commit-ID: FdAPTGDNKup

--HG--
extra : rebase_source : f0b04c73f0867708750fb9022e07f929ec221e84
2017-01-11 13:59:19 -06:00
Markus Stange 692210bd80 Bug 1323100 - Assign names to all remaining threads that are created through NS_NewThread and create them using NS_NewNamedThread instead. r=froydnj
MozReview-Commit-ID: 7W1dt2BBKJZ

--HG--
extra : rebase_source : c7e335dac2e0f02782f0eb229a7181c8d01317a2
2016-12-21 11:43:50 +01:00
Bill McCloskey 6df682a091 Bug 1320753 - Adding nsINamed naming to nsITimer (r=ehsan)
MozReview-Commit-ID: AbyLcMhRvbx
2016-11-30 18:01:59 -08:00
Byron Campen [:bwc] 70c2bbb4dc Bug 1307350: Compensate for repeating timers that have not been appropriately cancelled. r=froydnj
MozReview-Commit-ID: 20VpLbgSjh4

--HG--
extra : rebase_source : b5b38c69c228b750e986cc502db1a6c2242919b4
2016-10-04 10:23:39 -05:00
Byron Campen [:bwc] bd9637251a Bug 1310925: Acquire a reference before unlocking, just in case. r=froydnj
MozReview-Commit-ID: BLExeLU8AFs

--HG--
extra : rebase_source : f5103a955f21a9f1bdf52130b4e061b5904bea5f
2016-10-18 09:42:13 -05:00
Byron Campen [:bwc] 060752fb8e Bug 1306733: Don't crash on release builds if mTimer isn't set here. r=froydnj
MozReview-Commit-ID: eupSpSpJU3

--HG--
extra : rebase_source : d943f86b4bc015011f04f26fc8c2190f2472d111
2016-09-30 16:42:45 -05:00
Byron Campen [:bwc] 1a6b8f0e4e Bug 1157323 - Part 5: Remove some unnecessary members. r=froydnj
MozReview-Commit-ID: Fhkq0CZoqQP

--HG--
extra : rebase_source : fb0624ad264173656de1c28ebbafcc509533ebb2
2016-08-05 13:39:34 -05:00
Byron Campen [:bwc] 0f00611fff Bug 1157323 - Part 4: Stop modifying mTimeout/mDelay from the TimerThread, plus some simplification. r=froydnj
MozReview-Commit-ID: 1pMCKLi9DLZ

--HG--
extra : rebase_source : 03eabab8f39865bdb2489a96c809abb99b1fb7d9
2016-08-05 12:50:00 -05:00
Byron Campen [:bwc] d317470863 Bug 1157323 - Part 3: Do not allow mTimeout to change while a timer is in the queue. r=froydnj
MozReview-Commit-ID: 3ZyikUsix8D

--HG--
extra : rebase_source : 94a71aae125f541ef1aee962b1aae69c6e326a42
2016-08-05 10:07:38 -05:00
Alexandre Lissy 0af5b943b6 Bug 1284674 - Remove NUWA r=cyu
MozReview-Commit-ID: GyMRNzOBKw6

--HG--
extra : rebase_source : 293af1cd55f2035ce6a99f4ebf144059c32a2b8f
2016-08-02 14:54:00 +02:00
Nathan Froyd bab285064e Bug 1283151 - make nsTimerEvent final; r=tbsaunde
Nothing should be deriving from nsTimerEvent, and perhaps this will make
some of the timer code slightly more efficient.
2016-06-29 19:44:03 -04:00
L. David Baron af57a43c72 Bug 1271182 - Remove MOZ_COUNT_[CD]TOR from nsTimerEvent, since it uses XPCOM reference counting macros. r=khuey
I suspect this will fix the odd behavior we're seeing, although I
haven't really thought through how very closely.

MozReview-Commit-ID: qHgBRAc1PE
2016-05-25 18:04:36 -07:00
L. David Baron fc6592bdbc Bug 1271182 - Add some deleted assignment operators and copy constructors. r=khuey
These are generally good practice for reference-counted objects; they
catch cases where these operations are used by accident, breaking
reference-counting.

This doesn't show any existing problems, though.

MozReview-Commit-ID: EvRkNCymOqT
2016-05-25 18:04:35 -07: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