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

64 Коммитов

Автор SHA1 Сообщение Дата
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
Nicholas Hurley 65fb80c877 Bug 1190985 - Fix data race in DebugMutexAutoLock r=mcmanus
--HG--
extra : rebase_source : 27a37b0244ae734e39291ae298d65593c9c83f67
2015-08-04 14:16:49 -07:00
Nicholas Hurley e3cddeaf6a Bug 1152048 - Make the RELEASE_ASSERT on the sts lock a DIAGNOSTIC_ASSERT. r=bagder
--HG--
extra : rebase_source : ad174342a2ed85229611a848314776d8c5568287
extra : histedit_source : dea062e08393566ab0b00c8afa2ff3d1f3d302fe
2015-07-31 13:33:48 -07:00
Benoit Girard fe3dfcf5b2 Bug 1182516 - Add Chaos Mode environment variable MOZ_CHAOSMODE. r=roc
--HG--
extra : commitid : qfYBMvxZ7k
extra : rebase_source : 4c7098464712d7e5fa88ba1d8fba7c044772b0d6
2015-07-14 17:29:23 -04:00
Randell Jesup c87c478f4f Bug 1155059: Patch 1&2 - Convert Dispatch() and friends to already_AddRefed<> r=froydnj
Modify Dispatch IDL and code to deal with MSVC issues with overloaded templates r=froydnj
2015-07-09 23:21:46 -04:00
Randell Jesup 859e49874b Bug 1109338: Part 1: Separate UDPSocket logging from network logging r=dragana 2015-05-29 10:13:39 -04:00
Nicholas Hurley f4847624a3 Bug 1152048 - release assert non-reentrancy of sts lock acquisition. r=honzab DONTBUILD relanding 2015-05-28 13:50:52 -07:00
Nicholas Hurley 665b6d670f Backout 91a3fb327007 (wrong commit message) DONTBUILD 2015-05-28 13:50:51 -07:00
Nicholas Hurley 87dff12666 Bug 1159747 - release assert non-reentrancy of sts lock acquisition. r=honzab 2015-05-28 13:36:02 -07:00
Cervantes Yu 55152ad9d9 Backout change 39e167bbd14c, a80140872ea5, adae9be2294d and b71ccef9c674 (bug 970307). 2015-05-19 14:31:25 +08:00
Carsten "Tomcat" Book 005c5ce415 Backed out changeset 4d2839eea957 (bug 970307) 2015-05-19 11:44:27 +02:00
Cervantes Yu a12ce249b1 Backout change 39e167bbd14c, a80140872ea5, adae9be2294d and b71ccef9c674 (bug 970307).
--HG--
extra : rebase_source : 829e80228e07440285383316d2c4fea017828529
2015-05-19 14:31:25 +08:00
Eric Rahm 58dea0dee9 Bug 1162336 - Part 1: Remove instances of #ifdef PR_LOGGING in netwerk. r=froydnj
PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
2015-05-07 12:52:44 -07:00
Wes Kocher 28c02e1e6d Backed out 2 changesets (bug 1162336) for breaking at least windows builds
Backed out changeset 8952a7fa4050 (bug 1162336)
Backed out changeset 0170a6c2a5be (bug 1162336)
2015-05-07 11:13:24 -07:00