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

77 Коммитов

Автор SHA1 Сообщение Дата
Andi-Bogdan Postelnicu 5ca687e238 Bug 1311669 - use auto type specifier for variable declarations to improve code readability and maintainability. r=valentin
MozReview-Commit-ID: F5YO9pVK5O8

--HG--
extra : rebase_source : 7c8d22df9ec2ade3421d5f34229827f9c419b4d2
2016-11-01 14:44:09 +02:00
Andrew Osmond 7c53a79c5a Bug 1275464 - Part 2. Move socket transport service thread shutdown to xpcom-shutdown-threads. r=dragana 2016-09-19 13:29:59 -04:00
Dragana Damjanovic 3432aadb24 Bug 1294032 - Fix poll hang - on shutdown hang in poll post event multiple times. r=mcmanus
--HG--
extra : rebase_source : 1d56be9b3d04bb3cf6fcb1151aa4e2cfc26ffeee
2016-09-13 04:43:00 -04:00
Julian Seward 7c7afaaa0a Bug 1296716 - Uninitialised value uses somehow relating to nsSocketTransportService::AnalyzeConnection. r=valentin.gosu@gmail.com. 2016-09-10 08:16:14 +02:00
Jinank Jain 17c45acab3 Bug 712936 - Convert users of PR_STATIC_ASSERT to C++11 static_assert(). r=Ms2ger 2016-08-26 11:40:16 -04:00
Dragana Damjanovic 63d2bc4e3b Bug 1292181 - Let each dispatch event sends data to the socket. r=mcmanus yolo CLOSED TREE 2016-08-11 16:30:23 -07: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
Nicholas Nethercote 642d2ef877 Bug 1278452 - Avoid a possible null deref in netwerk/base/. r=valentin.
--HG--
extra : rebase_source : a538aeb4e261a1462fb276e8600481ab9e80339d
2016-06-07 15:07:54 +10:00
Patrick McManus c5691caef2 Bug 1277943 - atomic fix to sockettransport::debugautomutex r=hurley 2016-06-03 15:56:26 -04:00
Kannan Vijayan ext:(%2C%20Jonas%20Sicking%20%3Cjonas%40sicking.cc%3E) 8687d34336 Bug 1272099, Bug 1272101 - FlyWeb core implementation, DOM and Network changes. r=baku r=hurley
--HG--
extra : amend_source : 73ed6e6bccb6b39d7aafd5851bb836a46bcd4e10
2016-06-02 02:47:00 -04:00
Xidorn Quan 5c01d7c3ee Bug 1276549 - Remove rvalue reference mark for already_AddRefed params of nsIEventTarget::Dispatch and related methods. r=froydnj
MozReview-Commit-ID: J5RAfGW3X7T

--HG--
extra : source : e1ff4b0d5d9d2599ac00bac376597357ffd58ce0
2016-06-01 10:04:54 +10:00
Patrick McManus 636ad8d0dc Bug 1202468 - remove mPendingQ lock r=dragana 2016-05-23 12:20:58 -04:00
Patrick McManus 11128b2023 Bug 1275054 - Remove expired NETWORK_SESSION_AT_256FD telemetry r=dragana 2016-05-23 13:48:18 -04:00
Patrick McManus 2cd574f25f Bug 1274376 - more mozilla::net namespaces r=dragana
--HG--
extra : rebase_source : 914d48f23a4a5db052a789b9e21c1ff922533d35
2016-05-18 22:02:57 -04:00
Patrick McManus f3e258d25a Bug 1135104 - increase send window on modern windows r=dragana 2016-05-11 05:31:01 -04:00
Patrick McManus f03b618067 Bug 1236969 - remove autodialer r=valentin 2016-02-19 14:33:59 -05:00
Kyle Huey c85171ace9 Bug 1269056: Part 1 - Implement a rough PostDelayedTask equivalent on nsThread. r=froydnj 2016-05-12 15:15:43 -07:00
Randell Jesup 73a32768d1 Bug 1271402: name and cleanup DataStorage thread when running XPCshell r=froyd,dkeeler
MozReview-Commit-ID: 2brXgEcp91J
2016-05-11 00:11:40 -04: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
Carsten "Tomcat" Book ba3fe0975c Backed out changeset 85ce8cb0639a (bug 1268313)
--HG--
extra : rebase_source : 56d1cf41a2dc4959b67f834e07192a5c772176a8
2016-04-29 14:21:16 +02: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
Nils Ohlmeier [:drno] 4d0aaaafea Bug 1244926: added TCP socket filter to only allow outgoing STUN. r=jesup
MozReview-Commit-ID: 8PpL6Z0za71

--HG--
rename : media/mtransport/stun_udp_socket_filter.cpp => media/mtransport/stun_socket_filter.cpp
rename : media/mtransport/stun_udp_socket_filter.h => media/mtransport/stun_socket_filter.h
rename : netwerk/base/nsIUDPSocketFilter.idl => netwerk/base/nsISocketFilter.idl
extra : rebase_source : 2acf092e587a19a2019f463fa0a015373d3881d3
2016-02-11 01:18:46 -08:00
Patrick McManus 7cf04dba6b Bug 1260764 - Creation of PollableEvent needs a lock r=dragana a=kwierso
MozReview-Commit-ID: 2R0ydTeLPqr

--HG--
extra : histedit_source : f4a189f30dff540442eb94468bb62ab0e654ca74
2016-03-30 11:16:03 -04:00
Patrick McManus ea8cc58c8b Bug 1260218 - SocketTransportService socket expansion r=dragana 2016-03-23 20:44:28 -04:00
Patrick McManus b76d381e0b Bug 698882 - mozilla::net::PollableEvent r=dragana r=mayhemer 2016-03-22 11:02:39 -04:00
Dragana Damjanovic 75726942c9 Bug 1257809 - "Improve telemetry for PR_Connect". r=mcmanus
--HG--
extra : rebase_source : 93d5de4062db70a9cf59045a7a42b9a8ed74e30a
2016-03-19 04:25:00 +01:00
Patrick McManus 78cb6a4c07 Bug 698882 - backout 34046c232ee1 r=backout 2016-03-23 13:06:02 -04:00
Patrick McManus 6f258a71a8 Bug 698882 - mozilla::net::PollableEvent r=dragana r=mayhemer 2016-03-22 11:02:39 -04:00
Phil Ringnalda d171b7485c Back out changeset 06e41d2080a2 (bug 698882) for (at least) 10.6 leaks including PollableEvent
CLOSED TREE
2016-03-20 17:24:48 -07:00
Patrick McManus 2a402eafbc Bug 698882 - mozilla::net::PollableEvent r=dragana r=mayhemer 2016-02-11 15:00:22 -05:00
Eric Rahm 217f7e1cbf Bug 1251493 - Remove remaining references to MOZILLA_XPCOMRT_API from netwerk. r=mcmanus 2016-02-29 11:16:30 -08:00
Bogdan Postelnicu 855925309f Bug 1250115 - initialized pollInterval with 0 in order to prevent garbage value if Poll(..) doesn't get called. r=dragana
MozReview-Commit-ID: HoMv3sBg74W

--HG--
extra : rebase_source : c12a2a3342ed74909125cf18ebb54726fdeac35a
2016-02-24 13:47:18 +02:00
Carsten "Tomcat" Book fc53b9744d Backed out changeset 3955642fc8a9 (bug 1250115) for bustage 2016-02-24 12:17:39 +01:00
Bogdan Postelnicu 6948abc600 Bug 1250115 - initialized pollInterval with 0 in order to prevent garbage value if Poll(..) doesn't get called. r=dragana
MozReview-Commit-ID: HoMv3sBg74W

--HG--
extra : rebase_source : 718c383cfd6f000a78f0f3d850911aea32fbb13e
2016-02-24 11:59:07 +02:00
Patrick McManus 4033d4ec3c Bug 698882 - backout threadevent changes due to crashes with McAfee Firefox Hook r=backout 2016-02-21 17:41:21 -05:00
Patrick McManus ab744ac5a1 Bug 698882 - mozilla::net::PollableEvent r=dragana r=mayhemer 2016-02-11 15:00:22 -05:00
Bogdan Postelnicu 4c375f7a87 Bug 1242452 - only if PR_GetIdentitiesLayer return valid pointer continue and pass it's result to PR_GetIdentitiesLayer. r=mcmanus
--HG--
extra : transplant_source : %81%81%2B%60%B1%CE%84R%DAK%9C%2B%8Fd%8F%18%BE%EA%1D%15
2016-01-25 15:44:59 +02:00
Dragana Damjanovic 06c9cbac52 Bug 1240481 - Limit PR_Close calls during shutdown. r=mcmanus 2016-01-18 08:20:00 +01:00
Dragana Damjanovic 854aecd889 Bug 1239961 - Minimize amount of PR_Poll and PR_Read calls during shutdown. r=mcmanus 2016-01-15 08:21:00 +01:00
Nathan Froyd 0d181baf2d Bug 1219910 - make gSocketThread a relaxed atomic variable; r=mcmanus
Many places that (re-)declared gSocketThread already included
nsSocketTransportService2.h; we can delete the declaration for those
places.  For all the other places, we need to include
nsSocketTransportService2.h.
2015-11-06 12:00:37 -05:00
Patrick McManus 073d4a9803 bug 1219466 - convert netwerk to LazyLogModule r=valentin.gosu 2015-11-02 23:35:29 -05:00
Carsten "Tomcat" Book cb10921e0d Backed out changeset 2a233dadfc49 (bug 1219910) for bustage on a CLOSED TREE
--HG--
extra : rebase_source : 9d089223ab201540ca0f1852188114c2d2a743bd
2015-10-30 16:09:19 +01:00
Nathan Froyd a782e5c73e Bug 1219910 - make gSocketThread a relaxed atomic variable; r=mcmanus
All the places that (re-)declared gSocketThread already included
nsSocketTransportService2.h, so we can safely delete them.
2015-10-29 16:47:23 -04: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
Dragana Damjanovic e1927c0575 Bug 1152046 - move ClosingService::Start/Shutdown to nsIOService. r=mayhemer
--HG--
extra : rebase_source : 473295104e37947bcb6bd531b5c4eb00f7956b64
2015-10-04 13:43:00 +02:00
Nathan Froyd 3eae8069d0 Bug 1202497 - part 7 - make nsEventQueue use external locking; r=gerald
We want to ensure that nsThread's use of nsEventQueue uses locking done
in nsThread instead of nsEventQueue, for efficiency's sake: we only need
to lock once in nsThread, rather than the current situation of locking
in nsThread and additionally in nsEventQueue.  With the current
structure of nsEventQueue, that would mean that nsThread should be using
a Monitor internally, rather than a Mutex.

Which would be well and good, except that DOM workers use nsThread's
mutex to protect their own, internal CondVar.  Switching nsThread to use
a Monitor would mean that either:

- DOM workers drop their internal CondVar in favor of nsThread's
  Monitor-owned CondVar.  This change seems unlikely to work out well,
  because now the Monitor-owned CondVar is performing double duty:
  tracking availability of events in nsThread's event queue and
  additionally whatever DOM workers were using a CondVar for.  Having a
  single CondVar track two things in such a fashion is for Experts Only.

- DOM workers grow their own Mutex to protect their own CondVar.  Adding
  a mutex like this would change locking in subtle ways and seems
  unlikely to lead to success.

Using a Monitor in nsThread is therefore untenable, and we would like to
retain the current Mutex that lives in nsThread.  Therefore, we need to
have nsEventQueue manage its own condition variable and push the
required (Mutex) locking to the client of nsEventQueue.  This scheme
also seems more fitting: external clients merely need synchronized
access to the event queue; the details of managing notifications about
events in the event queue should be left up to the event queue itself.

Doing so also forces us to merge nsEventQueueBase and nsEventQueue:
there's no way to have nsEventQueueBase require an externally-defined
Mutex and then have nsEventQueue subclass nsEventQueueBase and provide
its own Mutex to the superclass.  C++ initialization rules (and the way
things like CondVar are constructed) simply forbid it.  But that's OK,
because we want a world where nsEventQueue is externally locked anyway,
so there's no reason to have separate classes here.

One casualty of this work is removing ChaosMode support from
nsEventQueue.  nsEventQueue had support to delay placing events into the
queue, theoretically giving other threads the chance to put events there
first.  Unfortunately, since the thread would have been holding a lock
(as is evident from the MutexAutoLock& parameter required), sleeping in
PutEvent accomplishes nothing but delaying the thread from getting
useful work done.  We should support this, but it's complicated to
figure out how to reasonably support this right now.

A wrinkle in this overall pleasant refactoring is that nsThreadPool's
threads wait for limited amounts of time for new events to be placed in
the event queue, so that they can shut themselves down if no new events
are appearing.  Setting limits on the number of threads also needs to be
able to wake up all threads, so threads can shut themselves down if
necessary.

Unfortunately, with the transition to nsEventQueue managing its own
condition variable, there's no way for nsThreadPool to perform these
functions, since there's no Monitor to wait on.  Therefore, we add a
private API for accessing the condition variable and performing the
tasks nsThreadPool needs.

Prior to all the previous patches, placing items in an nsThread's event
queue required three lock/unlock pairs: one for nsThread's Mutex, one to
enter nsEventQueue's ReentrantMonitor, and one to exit nsEventQueue's
ReentrantMonitor.  The upshot of all this work is that we now only
require one lock/unlock pair in nsThread itself, as things should be.
2015-09-20 05:13:09 -04:00
Nathan Froyd c6238d0d96 Bug 1202497 - part 6 - make the locking requirements of nsEventQueue explicit; r=gerald
Like the previous patch, this patch is a no-op change in terms of
functionality.  It does, however, pave part of the way for forcing
clients of nsEventQueue to provide their own locking.
2015-09-21 04:34:51 -04:00
Dragana Damjanovic 09970df1f7 Bug 1204043 - remove mServeMultipleEventsPerPollIter pref. r=mcmanus 2015-09-15 05:10:00 +02:00
Dragana Damjanovic 760a84e7cf Bug 1152046 - Make separate thread only for PRClose. r=mcmanus r=mayhemer
--HG--
extra : rebase_source : a4f4845023d6cebdd56d75b1ff7afd29447d2167
2015-09-10 19:07:00 +02:00
Kyle Huey 76e3009ab8 Bug 1179909: Refactor stable state handling. r=smaug
This is motivated by three separate but related problems:

1. Our concept of recursion depth is broken for things that run from AfterProcessNextEvent observers (e.g. Promises). We decrement the recursionDepth counter before firing observers, so a Promise callback running at the lowest event loop depth has a recursion depth of 0 (whereas a regular nsIRunnable would be 1). This is a problem because it's impossible to distinguish a Promise running after a sync XHR's onreadystatechange handler from a top-level event (since the former runs with depth 2 - 1 = 1, and the latter runs with just 1).

2. The nsIThreadObserver mechanism that is used by a lot of code to run "after" the current event is a poor fit for anything that runs script. First, the order the observers fire in is the order they were added, not anything fixed by spec. Additionally, running script can cause the event loop to spin, which is a big source of pain here (bholley has some nasty bug caused by this).

3. We run Promises from different points in the code for workers and main thread. The latter runs from XPConnect's nsIThreadObserver callbacks, while the former runs from a hardcoded call to run Promises in the worker event loop. What workers do is particularly problematic because it means we can't get the right recursion depth no matter what we do to nsThread.

The solve this, this patch does the following:

1. Consolidate some handling of microtasks and all handling of stable state from appshell and WorkerPrivate into CycleCollectedJSRuntime.
2. Make the recursionDepth counter only available to CycleCollectedJSRuntime (and its consumers) and remove it from the nsIThreadInternal and nsIThreadObserver APIs.
3. Adjust the recursionDepth counter so that microtasks run with the recursionDepth of the task they are associated with.
4. Introduce the concept of metastable state to replace appshell's RunBeforeNextEvent. Metastable state is reached after every microtask or task is completed. This provides the semantics that bent and I want for IndexedDB, where transactions autocommit at the end of a microtask and do not "spill" from one microtask into a subsequent microtask. This differs from appshell's RunBeforeNextEvent in two ways:
a) It fires between microtasks, which was the motivation for starting this.
b) It no longer ensures that we're at the same event loop depth in the native event queue. bent decided we don't care about this.
5. Reorder stable state to happen after microtasks such as Promises, per HTML. Right now we call the regular thread observers, including appshell, before the main thread observer (XPConnect), so stable state tasks happen before microtasks.
2015-08-11 06:10:46 -07:00