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

28 Коммитов

Автор SHA1 Сообщение Дата
JW Wang 524f4b0e37 Bug 1361305. P1 - use forwarding reference for the ListenerImpl constructor to enable move whenever possible. r=gerald
MozReview-Commit-ID: AFsbYtx0xMR

--HG--
extra : rebase_source : e822a686003d37a9d5ab21c16b460ac21b2e8864
extra : source : 1e0441900550645f0c9db82ac6119642cd53c3b9
2017-05-02 17:11:51 +08:00
JW Wang 1fe207329e Bug 1361259. P5 - fix MediaEventSource::CopyEvent2 which is broken by P2. r=gerald
We avoid passing event data to the listener function to save copies
if it doesn't take any arguments at all.

MozReview-Commit-ID: 7Hkzxrluemm

--HG--
extra : rebase_source : 22b894a58e2bc3836d37b7fd6aaa1f09d82eaeee
extra : source : 67a57b8eaebd355f73b0f10fb99afeaf2ccdb89e
2017-04-29 00:17:57 +08:00
JW Wang a1108d032e Bug 1361259. P4 - enforce copy in NonExclusive mode for each listener must get a copy. r=gerald
MozReview-Commit-ID: Mqt0N2erP6

--HG--
extra : rebase_source : 29c5a468401cd8926d5bd636caa7f63ab50e00aa
extra : source : c685f9768d516ffac538cb7fc240aaf5e4844693
2017-04-28 17:56:57 +08:00
JW Wang 2b44a55d99 Bug 1361259. P3 - remove unused code. r=gerald
MozReview-Commit-ID: 5svcAzJfGMS

--HG--
extra : rebase_source : 485b3868194932d54778701dc24c0bb202dfcf7a
extra : source : 8141c8cfad1bcf13fdda48a1039e2e96842e75cd
2017-04-28 17:18:50 +08:00
JW Wang 56feb1362b Bug 1361259. P2 - use NewRunnableMethod() to pass event data to the listener function. r=gerald
Note this breaks the MediaEventSource::CopyEvent2 gtest since there is always
one copy or move when storing the event data in the runnable created by
NewRunnableMethod() even when the listener function takes no arguments at all.

We will fix it later.

MozReview-Commit-ID: J9T63yxXko2

--HG--
extra : rebase_source : f15fa78129e562fb3a65027114095b205791d4c7
extra : source : e734b4d950c415be18e2fbc30e26e617758aa556
2017-04-28 16:28:47 +08:00
JW Wang 93fb1e26e2 Bug 1361259. P1 - let ListenerBase inherit RevocableToken. r=gerald
This is needed by P2 where |Listener| must be ref-counted so we can use
NewRunnableMethod() to pass event data to the listener function.

MozReview-Commit-ID: CpAgOmxcijc

--HG--
extra : rebase_source : f80a302788f6312a912d710262322b30b2bce4c0
extra : source : 4ce544aacca4897bc3d2bb25fd415df93dc940b4
2017-04-28 14:18:38 +08:00
JW Wang b4ee0ecebf Bug 1360423 - backout P5 and P2 from bug 1281090. r=gerald
It turns out that sync notification is a bad idea which is easy
to be misused and could results in unexpected reentrant call flow.
Since it has no users after the mass media code refactoring, it is
good to remove it now to prevent future users.

Backed out changeset fb5b05298007
Backed out changeset 9e1fb308cf51

MozReview-Commit-ID: 9WGvRCbvJhQ

--HG--
extra : rebase_source : 748cae9449636c68f3fffbaed0e08347fe63cd91
2017-04-28 11:28:13 +08:00
JW Wang 755272513a Bug 1316145 - pass DontAssertDispatchSuccess when dispatching events because it is hard to enforce notification happens before AbstractThread shutdown. r=jya
MozReview-Commit-ID: 2SATSQfdskl

--HG--
extra : rebase_source : a9b6cfcb5633f62daa919dc0e3326469d8589837
2016-11-18 17:50:27 +08:00
JW Wang a96557277e Bug 1281090. Part 5 - don't lock while sending synchronous notification to avoid deadlock. r=gerald.
MozReview-Commit-ID: hOasuXLf5a

--HG--
extra : rebase_source : 74b84944360afcd4ea50390153d071c8e63a74b4
2016-06-21 16:32:13 +08:00
JW Wang f972c4f7af Bug 1281090. Part 4 - prune disconnected listeners more aggressively to avoid hitting the assertion. r=gerald.
MozReview-Commit-ID: 1Z5L3swKBx6

--HG--
extra : rebase_source : 05c147239fa97d754439ce1154d34d29c22542df
2016-06-21 16:31:03 +08:00
JW Wang 9c080bdb61 Bug 1281090. Part 2 - add synchronous notification to MediaEventSourceImpl. r=gerald.
MozReview-Commit-ID: 6uWl4IP5iEP

--HG--
extra : rebase_source : 045d7e18650aa4a17c05f35f33fc4fa80e9a030c
2016-06-20 18:31:01 +08:00
JW Wang 7cb843e953 Bug 1281090. Part 1 - rename ListenerMode to ListenerPolicy. r=gerald.
MozReview-Commit-ID: IaRwKRlAoxy

--HG--
extra : rebase_source : 8d438b3c768f2d78b8b62e83e0ab55000d8a7fb7
2016-06-20 16:06:54 +08:00
JW Wang 0618cbfada Bug 1280175 - Allow passing lvalue to MediaEventProducerExc<T>::Notify. r=gerald
MozReview-Commit-ID: 6Wr3obvkVXo

--HG--
extra : rebase_source : 09ae3a471caa065cdf908bf302d56fe33548157d
2016-06-14 15:25:45 +08:00
JW Wang 39a058508a Bug 1278772 - Use value semantics to facilitate compiler optimization. r=kinetik.
MozReview-Commit-ID: 2TAU0GFwasB

--HG--
extra : rebase_source : 4d664e84b15076564ed9ea88163b08712f1f6ca9
2016-06-08 15:26:28 +08: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
JW Wang 45b81db1ac Bug 1233648 - Fix some insufficient includes. r=kinetik. 2015-12-18 15:12:45 +08:00
JW Wang ef41bf18de Bug 1219984. Part 2 - add support for multiple arguments. r=kinetik. 2015-11-02 10:48:01 +08:00
JW Wang eb17eba41a Bug 1219984. Part 1 - remove EventPassMode::Both. In order to support multiple arguments, all arguments must be either moved or copied. r=kinetik. 2015-11-02 10:47:59 +08:00
JW Wang 08767bf029 Bug 1219974 - Add DisconnectIfExists() to MediaEventListener. r=kinetik. 2015-10-30 09:13:10 +08:00
Nathan Froyd 01583602a9 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

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
JW Wang f6179e5445 Bug 1194112. Part 5 - remove dead code. r=kinetik. 2015-08-24 10:38:37 +08:00
JW Wang 4aed3938f0 Bug 1194112. Part 4 - reimplement Listener/ListenerImpl to support Move. r=kinetik. 2015-08-24 10:38:33 +08:00
JW Wang db0abb5fc0 Bug 1194112. Part 3 - use perfect forwarding in MediaEventProducer::Notify() so MediaEventSource can decide whether to copy or move according to its ListenerMode. r=kinetik. 2015-08-24 10:38:28 +08:00
JW Wang 9904cca471 Bug 1194112. Part 2 - small code refactoring to reduce typing. r=kinetik. 2015-08-24 10:38:24 +08:00
JW Wang 481dca5497 Bug 1194112. Part 1 - extract event dispatch code from ListenerImpl to its own class. r=kinetik. 2015-08-24 10:38:16 +08:00
JW Wang 003fc818b3 Bug 1193117. Add an exclusive mode to allow at most one listener. r=kinetik. 2015-08-14 13:01:03 +08:00
JW Wang 4312487e6f Bug 1192109 - Fix insufficient includes in MediaEventSource.h. r=kinetik. 2015-08-07 11:11:18 +08:00
JW Wang 646d8bce1b Bug 1187214. Part 1 - Implement MediaEventSource. r=kinetik. 2015-07-24 09:03:11 +08:00