Commit Graph

44 Commits

Author SHA1 Message Date
Thomas Zimmermann
368c9b8be6 Bug 1083092: Data parameter for |mozilla::ipc::SocketIOSendTask| template, r=shawnjohnjr
The data class in |SocketIOSendTask| is now a template parameter, instead
of being hard-coded to |UnixSocketRawData|. The patch also adds soem minor
cleanups to the file.
2014-10-21 10:52:12 +02:00
Thomas Zimmermann
8136d65793 Bug 1083092: Introduce |mozilla::ipc::SocketBase|, r=shawnjohnjr
The new class |SocketBase| contains the notification mechanism of
|SocketConsumerBase|. The latter still contains I/O methods.
2014-10-21 10:52:11 +02:00
Thomas Zimmermann
3a8da53d02 Bug 1074419: Close received socket file descriptors on errors, r=shawnjohnjr 2014-10-01 10:50:33 +02:00
Jamin Liu
64aaa25a4a Bug 1052304 - Notify OPP manager when Bluetooth socket message error occurs. r=btian 2014-10-09 17:54:38 +08:00
Ben Tian
1d423552ff Bug 1063066 - [Flame][KK] Bluetooth transfer does not work in Gallery App. r=tzimmermann 2014-09-25 18:35:54 +08:00
Thomas Zimmermann
3781429b8d Bug 1062754: Support peer shutdown and EOF in |SocketIOBase|, r=qdot, btian
Calling read on a socket that has been closed for reading by the
peer, read returns 0. The socket is still readable however, so
polling and reading will return constant results of 0 received
bytes.

With this patch, if a socket's peer shuts down reading or if
we reached the EOF, we stop watching the file descriptor for
readability. |SocketIOBase| will detect this case exactly once
and initiate the socket's shutdown.
2014-09-05 10:16:24 +02:00
Thomas Zimmermann
cb9d02fafc Bug 992206: Cleanup interface of |BluetoothSocket|, r=shuang
This patch cleans up the interface of Bluedroid's |BluetoothScoket|
to look more similar the interface of |UnixSocketConsumer|, from
which it descends.
2014-08-07 11:37:50 +02:00
Thomas Zimmermann
745af07704 Bug 992206: Use |SocketIOShutdownTask| for Bluetooth sockets, r=shuang 2014-08-07 11:37:50 +02:00
Thomas Zimmermann
ae10ab1fe5 Bug 992206: Use |SocketIOSendTask| for Bluetooth sockets, r=shuang 2014-08-07 11:37:49 +02:00
Thomas Zimmermann
f84576c02e Bug 992206: Use |SocketIOTask| for Bluetooth sockets, r=shuang 2014-08-07 11:37:49 +02:00
Thomas Zimmermann
984e597698 Bug 992206: Use |SocketIOBase| for Bluetooth sockets, r=shuang 2014-08-07 11:37:49 +02:00
Thomas Zimmermann
95c4438192 Bug 992206: Use |SocketIODeleteInstanceRunnable| for Bluetooth sockets, r=shuang 2014-08-07 11:37:49 +02:00
Thomas Zimmermann
adfd295aad Bug 992206: Use |SocketIORequestClosingRunnable| for Bluetooth sockets, r=shuang 2014-08-07 11:37:48 +02:00
Thomas Zimmermann
ee67071005 Bug 992206: Use |SocketIOReceiveRunnable| for Bluetooth sockets, r=shuang 2014-08-07 11:37:48 +02:00
Thomas Zimmermann
17a41cf856 Bug 992206: Use |SocketIOEventRunnable| for Bluetooth sockets, r=shuang 2014-08-07 11:37:48 +02:00
Thomas Zimmermann
d534878cd1 Bug 992206: Use |SocketIORunnable| for Bluetooth sockets, r=shuang 2014-08-07 11:37:47 +02:00
Thomas Zimmermann
0758fa5854 Bug 992206: Use |SocketConsumerBase| for Bluetooth sockets, r=shuang 2014-08-07 11:37:47 +02:00
Thomas Zimmermann
091d002338 Bug 992206: Cleanup fields in |DroidSocketImpl|, r=shuang
|DroidSocketImpl| contains several unused fields that are removed
by this patch.
2014-08-07 11:37:47 +02:00
Thomas Zimmermann
faea02b189 Bug 1038591: Convert Bluedroid status codes and error handlers, r=shuang
This patch converts Bluedroid status codes in Gecko to the
backend-neutral data type |BluetoothStatus|. All error handlers
have been adapted. The Bluedroid type |bt_status_t| only remains
in |BluetoothInterface|.
2014-08-06 11:45:32 +02:00
Thomas Zimmermann
fc3af497c6 Bug 1038591: Convert Bluetooth Socket data types in |BluetoothSocketInterface|, r=shuang
With this patch |BluetoothSocketInterface| is responsible for converting all
Bluetooth data types to Bluedroid types. All callers have been adapted.
2014-08-06 11:44:56 +02:00
Thomas Zimmermann
f9375161ab Bug 1045486: Rename |ConnectResultHandler| to |ConnectSocketResultHandler|, r=shuang
The linker mixes up |ConnectResultHandler| from BluetoothSocket.cpp
and BluetoothHfpManager.cpp. Consequently one of them gets removed
when linking libxul.so.

This patch works around the problem by renaming |ConnectResultHandler|
in BluetoothSocket.cpp to |ConnectSocketResultHandler|.
2014-08-05 09:29:14 +02:00
Thomas Zimmermann
e54dcfd3a7 Bug 1035240: Close file descriptor in BluetoothSocket, r=shuang
Currently, BluetoothSocket leaks its file descriptor on close
operations. With this patch when Gecko closes an instance of
BluetoothSocket, the file descriptor is now closed as well.
2014-07-11 09:22:51 +02:00
Thomas Zimmermann
aa4af73f0a Bug 1029387: Remove socket setup from BluetoothSocket, r=shuang
This patch removes all code related to socket setup from Bluedroid's
BluetoothSocket. The socket setup is handled by BluetoothInterface;
transparantly to its users.

Since most of the socket setup is now hidden, a comment was added to
DroidSocketImpl that explains the connection phases in server and
client.
2014-07-10 15:11:09 +02:00
Thomas Zimmermann
3c839fc138 Bug 1029387: Handle socket setup for |Accept| in BluetoothInterface, r=shuang
This patch moves the accept phase of Bluedroid's |Listen| to the
implementation of BluetoothInterface. |BluetoothInterface::Accept|
handles Bluedroid's socket-setup messages and executes the result
handler with the received file descriptor and data.
2014-07-10 15:10:54 +02:00
Thomas Zimmermann
d23c61e5d2 Bug 1029387: Handle socket setup for |Connect| in BluetoothInterface, r=shuang
Bluedroid's internal socket setup transfers 2 messages and possibly
a file descriptor as the first data of a socket connection.

This patch moves the socket-setup code for the |Connect| call to
the implementation of BluetoothInterface. BluetoothSocket only
handles the socket setup of |Listen|, and general socket state.
2014-07-10 15:10:45 +02:00
Thomas Zimmermann
12a6ce5437 Bug 1029387: Introduce connection status for Bluedroid sockets, r=shuang
In preparaton of moving the Bluedroid socket setup to BluetoothInterface,
this patch introduces connection states for Bluetooth sockets. There are
4 states,

  - Disconnected,
  - Listening,
  - Connecting, and
  - Connected.

All sockets start in Disconnected and transition to Connected via one
of the other states. Server socket transition through Listening, Client
sockets transition through Connecting. There is currently a lot of code
duplication in read and write methods. This will be cleaned up when the
connection setup is handled by BluetoothInterface.
2014-07-10 15:10:36 +02:00
Thomas Zimmermann
b2f94a0df3 Bug 1029387: Convert Bluedroid Socket's Connect method to asynchronous design, r=shuang 2014-07-10 15:10:26 +02:00
Thomas Zimmermann
907eb2797c Bug 1029387: Convert Bluedroid Socket's Listen method to asynchronous design, r=shuang 2014-07-10 15:10:13 +02:00
Thomas Zimmermann
54c1bbb4d7 Bug 1027030: Convert Bluetooth to use Bluedroid wrappers, r=shuang
This patch converts the Bluedroid backend to use the wrapper
classes. The affected interfaces are Core, Sockets, Handsfree,
A2DP, and AVRCP.
2014-06-27 15:45:26 +08:00
Thomas Zimmermann
b11ec67cd4 Bug 997137: Inherit |DroidSocketImpl| from |UnixFdWatcher|, r=echou
This patch converts |DroidSocketImpl| to inherit from |UnixFdWatcher|.
|UnixFdWatcher| maintains a Unix file descriptor on the I/O loop, and
replaces similar functionality in |DroidSocketImpl|.

As a side effect, all file descriptors in |DroidSocketImpl| are now
non-blocking. This does change the way how the code works, but ensures
that it doesn't block on the I/O thread.
2014-05-14 13:21:10 +02:00
Thomas Zimmermann
a66cd36350 Bug 992922: Cleanup unused code for Bluedroid sockets 2014-04-15 15:35:00 +02:00
Thomas Zimmermann
d777760bcf Bug 992922: Move listen operation to |DroidSocketImpl|, r=echou, f=shuang
With this patch, the listen operation for Bluedroid sockets
runs on the I/O thread. The related interface is identical to
the one of |UnixSocketConsumer|.
2014-04-15 15:35:00 +02:00
Thomas Zimmermann
3dc34550ea Bug 992922: Move connect operation to |DroidSocketImpl|, r=echou, f=shuang
With this patch, the connect operation for Bluedroid sockets
runs on the I/O thread. The related interface is identical to
the one of |UnixSocketConsumer|.
2014-04-15 15:35:00 +02:00
Ben Tian
bca0e37677 Bug 956258 - [cleanup] Patch 2/2: reduce warnings and remove cancel_discovery() in SendFile(), r=echou 2014-01-03 17:25:04 +08:00
Birunthan Mohanathas
dfbad43639 Bug 784739 - Switch from NULL to nullptr in remaining directories; r=ehsan
--HG--
extra : rebase_source : 1ff19b2c8fd0e77fa8e822f5007a9fa3a6b6d474
2014-01-06 10:06:04 -05:00
Ben Tian
90fe54e775 Bug 939022 - BluetoothUtils for bluedroid. Patch 2/3: Modify files, r=echou 2013-12-23 11:24:11 +08:00
Ben Tian
9be1a17136 Bug 948247 - [bluedroid] Race condition in BluetoothSocket may result in segmentation fault, r=echou 2013-12-11 16:53:11 +08:00
Ben Tian
2983de1747 Bug 945193 - Print function name in bluetooth logs, r=echou 2013-12-02 18:50:23 +08:00
Ben Tian
a21c6b6e29 Bug 915533 - Patch 2/2: [bludroid OPP] BluetoothSocket, r=echou 2013-12-02 10:39:58 +08:00
Ben Tian
47bb7aa534 Bug 915533 - Patch 1/2: [bludroid OPP] Move files, r=echou 2013-11-29 14:18:04 +08:00
Carsten "Tomcat" Book
4f1cc24db3 Backed out changeset 2faed81ad05f (bug 915533) for Build Bustage 2013-12-02 08:53:30 +01:00
Carsten "Tomcat" Book
47a9fe8e52 Backed out changeset 22ad4bbd595d (bug 915533) for Build Bustage 2013-12-02 08:53:16 +01:00
Ben Tian
2e7c598429 Bug 915533 - Patch 2/2: [bludroid OPP] BluetoothSocket, r=echou 2013-12-02 10:39:58 +08:00
Ben Tian
eeaacaa8cf Bug 915533 - Patch 1/2: [bludroid OPP] Move files, r=echou 2013-11-29 14:18:04 +08:00