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

178 Коммитов

Автор SHA1 Сообщение Дата
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 9edd615af7 Bug 1382922 - Refactor event queue to allow multiple implementations (r=erahm)
This patch refactors the nsThread event queue to clean it up and to make it easier to restructure. The fundamental concepts are as follows:

Each nsThread will have a pointer to a refcounted SynchronizedEventQueue. A SynchronizedEQ takes care of doing the locking and condition variable work when posting and popping events. For the actual storage of events, it delegates to an AbstractEventQueue data structure. It keeps a UniquePtr to the AbstractEventQueue that it uses for storage.

Both SynchronizedEQ and AbstractEventQueue are abstract classes. There is only one concrete implementation of SynchronizedEQ in this patch, which is called ThreadEventQueue. ThreadEventQueue uses locks and condition variables to post and pop events the same way nsThread does. It also encapsulates the functionality that DOM workers need to implement their special event loops (PushEventQueue and PopEventQueue). In later Quantum DOM work, I plan to have another SynchronizedEQ implementation for the main thread, called SchedulerEventQueue. It will have special code for the cooperatively scheduling threads in Quantum DOM.

There are two concrete implementations of AbstractEventQueue in this patch: EventQueue and PrioritizedEventQueue. EventQueue replaces the old nsEventQueue. The other AbstractEventQueue implementation is PrioritizedEventQueue, which uses multiple queues for different event priorities.

The final major piece here is ThreadEventTarget, which splits some of the code for posting events out of nsThread. Eventually, my plan is for multiple cooperatively scheduled nsThreads to be able to share a ThreadEventTarget. In this patch, though, each nsThread has its own ThreadEventTarget. The class's purpose is just to collect some related code together.

One final note: I tried to avoid virtual dispatch overhead as much as possible. Calls to SynchronizedEQ methods do use virtual dispatch, since I plan to use different implementations for different threads with Quantum DOM. But all the calls to EventQueue methods should be non-virtual. Although the methods are declared virtual, all the classes used are final and the concrete classes involved should all be known through templatization.

MozReview-Commit-ID: 9Evtr9oIJvx
2017-08-16 20:55:43 -07:00
Bill McCloskey 224d56eb18 Bug 1377222 - Eliminate nsITimer::InitWithFuncCallback in favor of InitWithNamedFuncCallback (r=froydnj)
MozReview-Commit-ID: 9zN9aAd7daA
2017-07-03 16:19:56 -07:00
Nicholas Nethercote 58786e1ea7 Bug 1375392 - Tweak the PROFILER_LABEL* macros. r=mstange.
This patch makes the following changes to the macros.

- Removes PROFILER_LABEL_FUNC. It's only suitable for use in functions outside
  classes, due to PROFILER_FUNCTION_NAME not getting class names, and it was
  mostly misused.

- Removes PROFILER_FUNCTION_NAME. It's no longer used, and __func__ is
  universally available now anyway.

- Combines the first two string literal arguments of PROFILER_LABEL and
  PROFILER_LABEL_DYNAMIC into a single argument. There was no good reason for
  them to be separate, and it forced a '::' in the label, which isn't always
  appropriate. Also, the meaning of the "name_space" argument was interpreted
  in an interesting variety of ways.

- Adds an "AUTO_" prefix to PROFILER_LABEL and PROFILER_LABEL_DYNAMIC, to make
  it clearer they construct RAII objects rather than just being function calls.
  (I myself have screwed up the scoping because of this in the past.)

- Fills in the 'js::ProfileEntry::Category::' qualifier within the macro, so
  the caller doesn't need to. This makes a *lot* more of the uses fit onto a
  single line.

The patch also makes the following changes to the macro uses (beyond those
required by the changes described above).

- Fixes a bunch of labels that had gotten out of sync with the name of the
  class and/or function that encloses them.

- Removes a useless PROFILER_LABEL use within a trivial scope in
  EventStateManager::DispatchMouseOrPointerEvent(). It clearly wasn't serving
  any useful purpose. It also serves as extra evidence that the AUTO_ prefix is
  a good idea.

- Tweaks DecodePool::SyncRunIf{Preferred,Possible} so that the labelling is
  done within them, instead of at their callsites, because that's a more
  standard way of doing things.

--HG--
extra : rebase_source : 318d1bc6fc1425a94aacbf489dd46e4f83211de4
2017-06-22 17:08:53 +10:00
Bill McCloskey 2ab0191db6 Bug 1365102 - Convert NS_GetCurrentThread uses in xpcom/ (r=froydnj)
MozReview-Commit-ID: 69qVzf8QJMq
2017-06-12 20:21:43 -07:00
Ben Kelly 3c709a6f61 Bug 1363829 P15 Expose nsITimer::GetAllowedEarlyFiringMicroseconds(). r=froydnj 2017-05-31 17:13:20 -07:00
Ben Kelly be1903d4a8 Bug 1363829 P12 Expose nsITimer::InitHighResolutionWithCallback() method. r=froydnj 2017-05-31 17:13:19 -07: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] 85231bad6e Bug 1361100: Perform all timer init after removal from TimerThread. r=froydnj 2017-05-01 14:50:37 -05: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
Ben Kelly a2eeb6e4f1 Bug 1325254 P5 Make nsITimer::Cancel() O(c). r=froydnj 2017-04-20 17:56:07 -04:00
Byron Campen [:bwc] f3a2ca7fb5 Bug 1339588 - Part 3: Don't break the nsTimer/nsTimerImpl cycle during Fire. r=froydnj, a=dveditz
MozReview-Commit-ID: J6TNJqGsBv4

--HG--
extra : rebase_source : 363923520a2527911c9b82aaf28d3d3291e95a71
2017-04-06 12:29:57 -05:00
Byron Campen [:bwc] 259065f253 Bug 1339588 - Part 2: Help prevent nullptr crashes due to misuse of the timer API. r=froydnj
MozReview-Commit-ID: BXCGYWnFqSj

--HG--
extra : rebase_source : 04d7d2180ad7713b5ee256cfd256cddd9d0d8dd7
extra : source : f21b4b01a1a95554f266cc184347d07c6583e395
2017-02-14 16:27:33 -06:00
Bill McCloskey 0cda76d680 Bug 1339289 - Give names to a lot of common timers (r=ehsan)
MozReview-Commit-ID: IMsv5bkyjBL
2017-02-15 12:30:01 -08:00
Jeff Walden d7372e37d9 Bug 1338374 - Use alignas/alignof to define Variant's internal raw storage. r=froydnj
--HG--
extra : rebase_source : a75613ba7c17ceccf20e6f096a118bfedfa1eb15
2017-01-30 15:56:05 -08: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
Bill McCloskey 928b73f143 Bug 1331804 - Anonymize nsITimer runnable names (r=njn)
MozReview-Commit-ID: 5qoN9BKkH18
2017-01-24 16:34:37 -08:00
Bill McCloskey cf9eef1ea4 Bug 1331804 - Give runnable names to some generic dispatch sites (r=ehsan)
MozReview-Commit-ID: 83IL5zcor1W
2017-01-24 16:34:37 -08:00
Wes Kocher f7ccafcb58 Backed out 8 changesets (bug 1331804, bug 1332100) for windows vm debug dt5 failures a=backout
Backed out changeset 8bf7f0e27c6c (bug 1331804)
Backed out changeset 600c0b9026c2 (bug 1331804)
Backed out changeset 3a5b5b9ecace (bug 1331804)
Backed out changeset c76432c9954e (bug 1331804)
Backed out changeset 46a9096745e7 (bug 1332100)
Backed out changeset 8b751230fa23 (bug 1331804)
Backed out changeset 2810212347fd (bug 1331804)
Backed out changeset be72b7763910 (bug 1331804)

MozReview-Commit-ID: Ywdsr4GZ4a
2017-01-24 15:12:21 -08:00
Bill McCloskey d8c4c4f53b Bug 1331804 - Anonymize nsITimer runnable names (r=njn)
MozReview-Commit-ID: 5qoN9BKkH18
2017-01-24 10:04:55 -08:00
Bill McCloskey 5e4b276c5d Bug 1331804 - Give runnable names to some generic dispatch sites (r=ehsan)
MozReview-Commit-ID: 83IL5zcor1W
2017-01-24 10:04:55 -08:00
Nicholas Nethercote 949658eb73 Bug 1329857 - Remove NS_METHOD and NS_CALLBACK. r=froydnj.
Bug 1295053 removed most uses of NS_METHOD and NS_CALLBACK, but one use was
unintentionally left behind (in the XPIDL parser) and another has since crept
in (in MediaDrmCDMProxy.h).

So this patch removes NS_METHOD and NS_CALLBACK. NS_METHOD_(nsresult) and
NS_CALLBACK_(nsresult, T) can still be used for the same purpose, but those
alternatives are less likely to be used unintentionally.

--HG--
extra : rebase_source : a50fc7b2a64a36d1ca9beda81bc0edb8f2ec1934
2017-01-10 14:08:43 +11: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
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] 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
Byron Campen [:bwc] 0cf5031cd7 Bug 1157323 - Part 2: Factor nsTimerImpl into two classes, so we don't need to do racy stuff in nsTimerImpl::Release. r=froydnj
MozReview-Commit-ID: DAe4TpMqBpA

--HG--
extra : rebase_source : 4caeb1ffc41b0704e5c1c111ef869d8edfb6d30c
2016-07-20 15:16:40 -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
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
Jan Beich aac69f16d7 Bug 1254218 - Rely on old-configure.in to detect dladdr(). r=njn
MozReview-Commit-ID: Ff9DCLu2Cv9
2016-03-07 19:00:41 +00:00
Eric Rahm 4c23f5cd8d Bug 1251482 - Remove remaining references to MOZILLA_XPCOMRT_API from xpcom. r=froydnj 2016-02-26 18:10:56 -08:00
Wes Kocher 72d9604d91 Backed out 8 changesets (bug 1251482, bug 1251494, bug 1251473, bug 1239870) for gtest failures
Backed out changeset f064a5efbb8c (bug 1251494)
Backed out changeset 9e33adec1aa6 (bug 1251482)
Backed out changeset ab0347657e25 (bug 1251473)
Backed out changeset 1d385d4f195d (bug 1239870)
Backed out changeset ceb3e1ee7dda (bug 1239870)
Backed out changeset 8574075bf42f (bug 1239870)
Backed out changeset ba077a3afbc7 (bug 1239870)
Backed out changeset eb99ab06414d (bug 1239870)

MozReview-Commit-ID: 7r9SEk4VGNU
2016-02-26 17:14:57 -08:00
Eric Rahm ae72b68e62 Bug 1251482 - Remove remaining references to MOZILLA_XPCOMRT_API from xpcom. r=froydnj 2016-02-26 15:31:19 -08:00
Eric Rahm 5b38c55967 Bug 1174785 - Part 2: Convert xpcom over to LogModule. r=froydnj
--HG--
extra : rebase_source : 58d3b32bd0174f2540512cef810cafdd3556ef6b
2015-10-19 12:50:14 -07:00
Nicholas Nethercote cb3685d2fb Bug 1205941 - Make TimerFirings logging output post-processible with fix_linux_stack.py. r=glandium. 2015-09-21 17:13:51 -07:00
Nicholas Nethercote 0d5b7b370d Bug 1203427 (part 6) - Add link to MDN docs about TimerFirings logging. r=me.
DONTBUILD because comment-only change.

--HG--
extra : rebase_source : 0f94403df66f19ad4382d89655fac0da6ccaf294
2015-09-16 21:49:24 -07:00
Nicholas Nethercote f429eae6a5 Bug 1203427 (part 5) - Add logging of timer firings. r=froydnj. 2015-09-10 00:50:51 -07:00
Nicholas Nethercote 886074f2e3 Bug 1203427 (part 3) - Change order of InitCommon() arguments. r=froydnj.
This makes the order of |aDelay| and |aType| match those of the InitWith*()
functions.

I've made this change because the inconsistency tripped me up during the
development of part 4.

--HG--
extra : rebase_source : 7d49f3f643e76955ea3de57e0954deb22cda3ddf
2015-09-14 15:57:17 -07:00
Nicholas Nethercote 0a97485195 Bug 1190735 - Remove nsITimer.TYPE_REPEATING_PRECISE. r=froydnj.
--HG--
extra : rebase_source : e4424bde52b0f90adbd328071f62b89193098d34
2015-08-04 17:30:53 -07:00
Byron Campen [:bwc] 309a57122b Bug 1059572 - Part 2: Make absolutely sure a timer is removed before reinitting it. r=nfroyd
--HG--
extra : rebase_source : 9a952241e046321a25adf52167bd7a538d25f37a
2015-07-28 10:10:54 -05:00
Byron Campen [:bwc] e145322168 Bug 1059572 - Part 1: Move PostTimerEvent to TimerThread to allow TimerThread's monitor to protect it. r=nfroyd
--HG--
extra : rebase_source : ec9623818cd1a5f3a2665a1c4af4be7869c0dec3
2015-07-22 12:39:34 -05: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
Shelly Lin 4eff0a1842 Bug 1113562 - Expected delay time of tasks should not be the latency of those kind. r=sinker
--HG--
extra : rebase_source : b5e012fb6570e87270a0924fbe395dc56e6242ec
2015-06-16 10:57:19 +08:00
Eric Rahm 75c4bebb79 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 f50b813989 Bug 1165515 - Part 3: Convert PR_LOG_TEST to MOZ_LOG_TEST. r=froydnj 2015-06-03 15:22:28 -07:00