Commit Graph

106 Commits

Author SHA1 Message Date
Carsten "Tomcat" Book
cebdb18236 Backed out changeset 452a777db125 (bug 1046109) 2014-07-31 10:14:18 +02:00
Thomas Zimmermann
7dfd3fc360 Bug 1046109: Cleanup |UnixSocketImpl|, r=kyle
This patch cleans up |UnixSocketImpl| and it's file in general. The
patch

 - renames |UnixSocketImpl| to |UnixSocketConsumerIO|,
 - moves method definitions out of class definition,
 - adds const correctness,
 - adds MOZ_FINAL to several classes, and
 - moves task classes to a separate location.

No functional changes are performed.
2014-07-31 09:29:20 +02:00
Thomas Zimmermann
d4e730d905 Bug 1046109: Add |SocketIOShutdownTask|, r=kyle
|SocketIOShutdownTask| invokes the shutdown procedure for Socket I/O
objects on the I/O thread.
2014-07-31 09:29:20 +02:00
Thomas Zimmermann
f0e201cdc3 Bug 1046109: Add |SocketIOSendTask|, r=kyle
|SocketIOSendTask| moves data from the main thread to the Socket I/O
class on the I/O thread, and invokes the Socket I/O classes sending
methods.
2014-07-31 09:29:20 +02:00
Thomas Zimmermann
698aaed632 Bug 1046109: Add |SocketIOTask|, r=kyle
|SocketIOTask| is a task-class template that holds a reference to
a Socket I/O object. It replaces |UnixSocketImplTask|, which only
supports objects of type |UnixSocketImpl|.
2014-07-31 09:29:20 +02:00
Thomas Zimmermann
43583cc692 Bug 1046109: Add |SocketIOBase|, r=kyle
|SocketIOBase| is a base class for Socket I/O classes. It's not a
requirement, but provides a number of helpful methods for common
I/O operations on the I/O thread.
2014-07-31 09:29:19 +02:00
Thomas Zimmermann
ecd328b34b Bug 1046109: Add |SocketIODeleteInstanceRunnable|, r=kyle
|SocketIODeleteInstanceRunnable| deletes a Socket I/O object on the
main thread. This is required to serialize the close operation of
Socket consumers.
2014-07-31 09:29:19 +02:00
Thomas Zimmermann
2eb11e2b96 Bug 1046109: Add |SocketIORequestClosingRunnable|, r=kyle
|SocketIORequestClosingRunnable| notifies the Socket consumer on
the main thread to clean up the Socket I/O object and close the
connection.
2014-07-31 09:29:19 +02:00
Thomas Zimmermann
5bcb6a6ac5 Bug 1046109: Add |SocketIOReceiveRunnable|, r=kyle
|SocketIOReceiveRunnable| sends received data from the Socket I/O
object on the I/O thread to the Socket consumer on the main thread.
2014-07-31 09:29:18 +02:00
Thomas Zimmermann
f7d3ad8087 Bug 1046109: Add |SocketIOEventRunnable|, r=kyle
|SocketIOEventRunnable| sends a notification from the Socket I/O
object to a Socket consumer on the main thread.
2014-07-31 09:29:18 +02:00
Thomas Zimmermann
8cd8d45fd1 Bug 1046109: Add |SocketIORunnable|, r=kyle
|SocketIORunnable| is a runnable class template that holds a
reference to a arbitrary Socket I/O object.  |SocketIORunnable|
replaces |UnixSocketImplRunnable|, which only handles objects of
type |UnixSocketImpl|.
2014-07-31 09:29:18 +02:00
Thomas Zimmermann
2a41a6c122 Bug 1046109: Add |SocketConsumerBase| and inherit |UnixSocketConsumer| from it, r=kyle
|SocketConsumerBase| handles connection state for |UnixSocketConsumer|
and its derived classes. Implementing classes must override a number of
virtual methods, to handle notifications about changes to the state of
the connection.
2014-07-31 09:29:17 +02:00
Shelly Lin
d63debcb8f Bug 908995 - Part 3: Add source events for TaskTracer. r=khuey,smaug. 2014-04-23 15:32:31 +08:00
Kyle Huey
b6957123df Bug 991812: Remove uses of AtomicRefCounted<T> that live in Gecko. r=ehsan
--HG--
extra : rebase_source : 0d14e02c64d548fd3177681248d722683aaa87c3
2014-04-14 12:04:25 -07:00
Ryan VanderMeulen
601b02224e Backed out changesets ddbac34527fe and fa82f32d0c39 (bug 991812) for B2G bustage.
CLOSED TREE
2014-04-14 16:16:18 -04:00
Kyle Huey
acd8c16b76 Bug 991812: Remove uses of AtomicRefCounted<T> that live in Gecko. r=ehsan 2014-04-14 12:04:25 -07:00
Thomas Zimmermann
cab5fcb4dd Bug 990984: Explicitly close socket file descriptor, r=kyle
Closing the socket explicitly will make UnixSocket fail
if we're trying to read or write afterwards; indicating
potential bugs.
2014-04-08 09:30:58 +02:00
Thomas Zimmermann
88cf1c0e54 Bug 981239: Use atomic ref-counting for |UnixSocketConsumer|, r=kyle
|SocketSendTask| acquires a reference to |UnixSocketConsumer| on
the main thread and releases this reference on the I/O thread;
leading to race-conditions. This patch adds

  - atomicity for ref-counting of |UnixSocketConsumer|, and
  - stricter tests in the destructor of this class.
2014-04-08 09:27:47 +02:00
Ben Tian
506a83d68c Bug 979668 - [Bluetooth] Sender name is not shown in transfer requests, f=tzimmermann, r=kyle 2014-03-10 10:11:27 +08:00
Thomas Zimmermann
b8da10ea47 Bug 977672: Cleanup includes and defines in UnixSocket.cpp, r=kyle
The patch removes unnecessary includes and define statements from
UnixSocket.cpp.
2014-02-28 10:16:53 +01:00
Thomas Zimmermann
aeb9f13274 Bug 977672: Cleanup runnables and tasks in UnixSocket.cpp, r=kyle
This patch cleans up runnables and tasks in UnixSocket.cpp. Every
runnable's name now ends in Runnable. There are a base classes for
runnables and tasks that hold reference to UnixSocketImpl and from
which all runnables and tasks inherit.
2014-02-28 10:16:53 +01:00
Thomas Zimmermann
a3e0c85af9 Bug 977672: Assert O_NONBLOCK for watched file descriptors, r=kyle
We cannot use blocking file-descriptor I/O on the I/O thread. This
patch adds an assertion to UnixFdWatcher the tests for the O_NONBLOCK
flag, when installing a file descriptor. In UnixFileWatcher, the
Open method tests for the O_NONBLOCK flag for the opened file.

File-descriptor flags for UnixSocketImpl et al are currently set by
UnixSocketImpl itself. Later patches should move this into the
methods of connector classes.
2014-02-28 10:16:52 +01:00
Thomas Zimmermann
ceb3f29bcc Bug 974410: Cleanup UnixSocketImpl, r=kyle
This patch cleans up the implementation of UnixSocketImpl by

 - inlining all calls to SetUpIO,
 - removing the unsued constant SOCKET_RETRY_TIME_MS, and
 - separating logging from Bluetooth.
2014-02-26 17:52:18 +01:00
Thomas Zimmermann
928bfd8605 Bug 974410: Inherit UnixSocketImpl from UnixSocketWatcher, r=kyle
The base class UnixSocketWatcher handles the connection state of
the socket. UnixSocketImpl overrides UnixSocketWatcher's callback
methods for implementing it's functionality.
2014-02-26 17:52:09 +01:00
Thomas Zimmermann
aaab8a6062 Bug 974410: Inherit UnixSocketImpl from UnixFdWatcher, r=kyle
With this patch UnixSocketImpl inherits from UnixFdWatcher. The
new base class implements general file-descriptor handling and
I/O watchers.
2014-02-26 17:52:00 +01:00
Ehsan Akhgari
f1e844fd62 Bug 935778 - Part 0.4: Spray even more MOZ_DECLARE_REFCOUNTED_TYPENAME across the tree 2014-02-21 09:11:33 -05:00
Thomas Zimmermann
6d2e9a37cb Bug 972265: Maintain connect delay in UnixSocketConsumer, r=kyle
UnixSocketConsumer now maintains a delay for re-establishing closed
connection. The initial delay is zero, so that the first connect call
is processed immediately. At the first failed attempt to connect, the
delay is set to ~1 second, and is increased by a factor of 2 on each
successive error until it reaches ~1 minute.

The UnixSocketConsumer code resets the delay to zero if it is lower
than the time that the connection was open. This heuristics protects
against cases where the peer establishes a connection, and closes it
shortly afterwards. Incompatible versions of rild show this behavior.
2014-02-14 08:03:05 +01:00
Kyle Machulis
bd80ec4f6f Bug 843857 - Make sure all socket errors fire events back to, r=tdz 2013-12-09 16:46:20 -08:00
Ryan VanderMeulen
6c0a308b3e Backed out changeset f3c055585a4f (bug 843857) for B2G mochitest bustage. 2014-01-24 17:19:52 -05:00
Kyle Machulis
ecf3912cec Bug 843857: Fix connection error handling in UnixSocket; r=tzimmermann 2014-01-24 12:06:40 -08:00
Ehsan Akhgari
124f372395 Bug 951207 - Rename the chromium LOG macro to CHROMIUM_LOG; r=bent 2013-12-17 13:26:45 -05:00
Ryan VanderMeulen
ca386608b9 Merge b2g-inbound to m-c. 2013-12-09 17:26:11 -05:00
Birunthan Mohanathas
2a97f4dc0d Bug 713082 - Part 1: Remove unnecessary Util.h includes. r=Waldo 2013-12-08 21:52:33 -05:00
Thomas Zimmermann
16f635c504 Bug 936402: Duplicate connection status in UnixSocketImpl, r=bent
UnixSocketImpl, which mostly runs on the I/O thread, doesn't control
its reference to UnixSocketConsumer. If the connection status is
stored in UnixSocketConsumer, the I/O thread can't read it safely.

This patch duplicates the connection status in UnixSocketImpl, where
reading from the I/O thread is safe. Methods of UnixSocketImpl don't
need to access mConsumer any longer to obtain the connection status.
2013-12-09 14:21:18 +01:00
Mike Hommey
a65383e1e9 Bug 939632 - Remove LIBRARY_NAME for leaf libraries. r=gps
Landing on a CLOSED TREE.
2013-11-19 11:50:54 +09:00
Mike Hommey
8ceb917350 Bug 939074 - Remove most LIBXUL_LIBRARY. rs=gps 2013-11-19 11:48:10 +09:00
Mike Hommey
bb6779efe3 Bug 939044 - Remove most definitions of MODULE. r=mshal 2013-11-19 11:47:39 +09:00
Mike Hommey
d7b6f95761 Bug 935881 - Use FINAL_LIBRARY for all (fake) libraries that end up linked in a single other library. r=gps 2013-11-19 11:47:14 +09:00
Chuck Lee
c81c6692fc Bug 928223 - 0001. Add function to perform setup for listen socket. r=qDot echou vicamo yoshi 2013-10-25 10:00:22 +08:00
Mike Hommey
1d566f7586 Bug 929905 - Consolidate sources in moz.build. r=gps 2013-10-25 08:23:05 +09:00
Brian O'Keefe
4c98f61956 Bug 928709 - Convert chromium-config.mk to mozbuild, r=mshal 2013-10-02 13:17:55 -04:00
Shawn Huang
db3e2aadbe Bug 880610: Part2-Add build flag in UnixSocket to distinguish between bluez and bluedroid stack, r=echou 2013-10-23 14:12:24 +08:00
Eric Chou
78d847180e Backed out changeset 089f015f15bb and e907ab075ec8 (bug 880610) for hitting MOZ_ASSERT 2013-10-19 16:01:25 +08:00
Shawn Huang
2b492aa310 Bug 880610: Part2-Add build flag in UnixSocket to distinguish between bluez and bluedroid stack. r=echou 2013-10-17 18:25:55 +08:00
Ms2ger
7ffcd856c2 Bug 900980 - Part a: Move unconditional assignments to EXPORT_LIBRARY to moz.build; rs=gps 2013-10-03 09:11:13 +02:00
Thomas Zimmermann
c44d624ad1 Bug 912996: Remove memcpy when reading from Unix socket, r=qdot
We used to allocate memory on the stack when reading from a file
descriptor and copied the result into an instance of UnixSocketRawData.

This patch

 - cleans up the interface of UnixSocketRawData,
 - removes the large stack allocation (64KiB), and
 - removes the unnecessary memcpy.

Other memcpys for sending data have been moved into the constructor
of UnixSocketRawData.

--HG--
extra : rebase_source : 46ed1c73481732c3f3350bf0bedb56d376c24e98
2013-09-06 10:18:35 +02:00
Thomas Zimmermann
ee48608b82 Bug 912996: Fix whitespaces, r=qdot
--HG--
extra : rebase_source : 1494c72c57e9e47dd7e082ef39bc264d348b6224
2013-09-06 10:17:55 +02:00
Mike Hommey
f1cf3b4238 Bug 912293 - Remove now redundant boilerplate from Makefile.in. r=gps 2013-09-05 09:01:46 +09:00
Brian O'Keefe
4f68eb9b02 Bug 875934 - Move LIBRARY_NAME to moz.build, batch 3; r=mshal 2013-08-15 09:02:09 -04:00
Eric Chou
e65c1c0f30 Bug 902460 - Close socket before NotifyError(), r=qdot 2013-08-27 12:10:48 +08:00