Commit Graph

97 Commits

Author SHA1 Message Date
Nathan Froyd
e4e2da55c9 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
2015-10-18 01:24:48 -04:00
Nathan Froyd
5254890206 Bug 1207245 - part 3 - switch all uses of mozilla::RefPtr<T> to nsRefPtr<T>; r=ehsan
This commit was generated using the following script, executed at the
top level of a typical source code checkout.

 # Don't modify select files in mfbt/ because it's not worth trying to
 # tease out the dependencies currently.
 #
 # Don't modify anything in media/gmp-clearkey/0.1/ because those files
 # use their own RefPtr, defined in their own RefCounted.h.
find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    grep -v 'mfbt/RefPtr.h' | \
    grep -v 'mfbt/nsRefPtr.h' | \
    grep -v 'mfbt/RefCounted.h' | \
    grep -v 'media/gmp-clearkey/0.1/' | \
    xargs perl -p -i -e '
 s/mozilla::RefPtr/nsRefPtr/g; # handle declarations in headers
 s/\bRefPtr</nsRefPtr</g; # handle local variables in functions
 s#mozilla/RefPtr.h#mozilla/nsRefPtr.h#; # handle #includes
 s#mfbt/RefPtr.h#mfbt/nsRefPtr.h#;       # handle strange #includes
'

 # |using mozilla::RefPtr;| is OK; |using nsRefPtr;| is invalid syntax.
find . -name '*.cpp' -o -name '*.mm' | xargs sed -i -e '/using nsRefPtr/d'

 # RefPtr.h used |byRef| for dealing with COM-style outparams.
 # nsRefPtr.h uses |getter_AddRefs|.
 # Fixup that mismatch.
find . -name '*.cpp' -o -name '*.h'| \
    xargs perl -p -i -e 's/byRef/getter_AddRefs/g'
2015-10-18 00:40:10 -04:00
Chris Peterson
dd2fcb9b7d Bug 1207030 - Enable -Wshadow flag in more directories that have no -Wshadow warnings. r=glandium 2015-09-22 21:39:03 -07:00
Nicholas Nethercote
69d088e45f Bug 1198334 (part 1) - Replace the opt-in FAIL_ON_WARNINGS with the opt-out ALLOW_COMPILER_WARNINGS. r=glandium.
The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.
2015-08-27 20:44:53 -07:00
Andrea Marchesini
eff949a801 Bug 1156632 - Remove unused forward class declarations - patch 4 - netwerk image and dom, r=ehsan 2015-04-22 08:29:20 +02:00
Nathan Froyd
d86ff9f990 Bug 1042878 - part 2 - move MOZ_CAIRO_CFLAGS et al additions to C*FLAGS into moz.build; r=glandium 2014-07-24 11:55:33 -04:00
Chris Peterson
b5cc0a5be9 Bug 1007741 - Fix -Wunused-function warning in ipc/glue/ and mark ipc/ subdirectories as FAIL_ON_WARNINGS. r=bsmedberg 2014-05-07 23:55:30 -07:00
Shawn Huang
0cef3a54a6 Bug 1000961 - Make DBusReplyHandler use thread-safe ref-counting, r=echou, f=tzimmermann 2014-04-29 11:13:37 +08:00
Ehsan Akhgari
78aec23d8b Bug 999884 - Make DBusReplyHandler not use mozilla::RefCounted; r=smaug
--HG--
extra : rebase_source : 3b48a1e8cba18af2871a34b0ef36f2d548dfcc85
2014-04-23 17:47:22 -04:00
Thomas Zimmermann
9c757eef59 Bug 995912: Remove BLUEZ_DBUS_BASE_IFC from RawDBusConnection, r=qdot, echou
This patch removes the constant BLUEZ_DBUS_BASE_IFC from the file
RawDBusconnection.cpp. The constant is specific to BlueZ, and that's
where it's located now.
2014-04-17 11:16:12 +02:00
Ehsan Akhgari
83afc1afae 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
754aad3a07 Bug 972253: Remove DBusThread.{cpp,h}, r=kyle
These files are obsolete and not used any longer.
2014-02-20 12:56:24 +01:00
Thomas Zimmermann
eb9026aa52 Bug 968868: Move DBusWatcher to RawDBusConnection, r=qdot
DBusWatcher is a helper for RawDBusConnection. This patch moves
both classes into the same file. Calling RawDBusConnection::Watch
installs a DBusWatcher for the connection.
2014-02-07 12:01:27 +01:00
Thomas Zimmermann
98a88f00f6 Bug 968275: Remove task classes from RawDBusConnection, r=qdot
This patch removes the internal tasks from the implementation of
RawDBusConnection. All calls to RawDBusConnection are invoked on
the I/O thread, so the sender tasks only impose an overhead.
2014-02-06 17:28:44 +01:00
Thomas Zimmermann
856a7041d6 Bug 956841: Respect DBusWatch flags in I/O-thread watchers, r=qdot
Currently DBusWatcher registers read and write watchers on
the I/O thread unconditionally. Thus for read-only DBusWatch
structures, the write watcher on the I/O thread generates a
significant amount of CPU overhead by constantly reporting
success via calls to OnFileCanWriteWithoutBlocking.

This patch changes DBusWatcher to respect the status flags
of supplied DBusWatch structures. It will only poll for
read or write status if the DBus watch has the corresponding
flag set.

DBus keeps track of these flags and calls the toggle callback
when it needs to wait on a certain DBusWatch.
2014-01-15 09:32:11 +01:00
Ehsan Akhgari
2292de0034 Bug 951207 - Rename the chromium LOG macro to CHROMIUM_LOG; r=bent 2013-12-17 13:26:45 -05:00
Thomas Zimmermann
f14c38867f Bug 932728: Run DBus on the I/O thread, r=qdot
This patch converts DBusWatcher to run on the I/O thread. When a
caller starts DBus, StartDBus creates a new connection and adds
it to the I/O thread's poll loop. DBusWatchers are created and
removed automatically by the DBus libary.

The I/O thread provides all features of the DBus thread. So most
of the existing code has been removed or rewritten. The former
includes the control socket and the DBus thread, the latter is in
the DBusWatcher code.
2013-10-29 16:03:40 +01:00
Thomas Zimmermann
65622282db Bug 932728: Use private DBus connection, r=qdot
Using a private DBus connection gives each of its users, such as
Bluetooth, its own connection to the DBus server. This simplifies
the use of DBusWatch structures and ensures that all resources of
a connection are free'd when the connection gets closed.
2013-10-29 16:03:40 +01:00
Thomas Zimmermann
8149608bb0 Bug 932728: Open only one connection to DBus, r=echou,qdot
Bluetooth maintains two connections to the DBus server and the DBus
system itself maintains a third one. This implies some overhead and
makes the code more difficult to understand.

This patch changes the Bluetooth code to use the connection that is
established by the DBus system.
2013-12-12 12:56:00 +01:00
Thomas Zimmermann
994b42124a Bug 932728: Don't inherit DBusWatcher from RawDBusConnection, r=qdot
DBusWatcher is not a DBus connection, so it shouldn't inherit from
it. This patch converts the inheritance into a class member.
2013-10-29 16:03:39 +01:00
Birunthan Mohanathas
bd0f161288 Bug 713082 - Part 1: Remove unnecessary Util.h includes. r=Waldo 2013-12-08 21:52:33 -05:00
Mike Hommey
931cb49886 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
db9e5129bc Bug 939074 - Remove most LIBXUL_LIBRARY. rs=gps 2013-11-19 11:48:10 +09:00
Mike Hommey
f0d1cd1e10 Bug 939044 - Remove most definitions of MODULE. r=mshal 2013-11-19 11:47:39 +09:00
Mike Hommey
f81885e53b 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
Bhargav Gurappadi
f60ed17bad Bug 931306 - DBusThread fails to compile on latest compilers. r=tzimmermann, r=qDot 2013-10-25 19:37:57 -07:00
Thomas Zimmermann
46da2f00b6 Bug 930952: Dispatch DBus messages after reading socket, r=qdot
DBusWatcher::Poll currently breaks after reading DBus data from the
socket. Thus, it never processes the data and dispatches the DBus
messages. This patch fixes the code to dispatch DBus messages after
reading the DBus socket.
2013-10-29 17:19:02 +01:00
Thomas Zimmermann
814877463a Bug 931038: Remove blocking DBus interface, r=qdot
All blocking calls to DBus have been replaced by non-blocking
code. This patch removes the corresponding DBus interfaces.
2013-10-29 11:08:16 +01:00
Ed Morley
815b5c0198 Merge mozilla-central and b2g-inbound 2013-10-25 12:12:23 +01:00
Mike Hommey
f1c0c07862 Bug 929905 - Consolidate sources in moz.build. r=gps 2013-10-25 08:23:05 +09:00
Thomas Zimmermann
38ee6cc7c0 Bug 927859: Cleanup DBus thread after DBusWatcher, r=qdot
This patch changes the DBus shutdown to only cleanup the DBus
thread from the main thread after DBusWatcher has completed.
This should ensure that the main thread will not have to wait
for the DBus thread.

--HG--
extra : rebase_source : 09ebb40a4e515ef5b0ebddfc1c3b7187cc546313
2013-10-25 09:31:20 +02:00
Thomas Zimmermann
7a8c1137cc Bug 927459: Move helpers to DBusWatcher, r=qdot
PollFdComparator, DBusEventTypes and flag conversion are only used by
DBusWatcher. This patch moves them into DBusWatcher's namespace.

--HG--
extra : rebase_source : 688403e55e139440e6d6d28e9802f8a48d7c355d
2013-10-25 09:31:04 +02:00
Thomas Zimmermann
57ec974519 Bug 927459: Add DBusWatcher::Stop, r=qdot
The Stop method encapsulates the code for sending the exit command
to a running DBus watcher.

--HG--
extra : rebase_source : 6963e6fa60b2e1e725046672a45cd325fc40a836
2013-10-25 09:30:54 +02:00
Thomas Zimmermann
c93d0d8855 Bug 927459: Move poll functionality to DBusWatcher, r=qdot
The DBus poll functionality is actually part of DBusWatcher. This
patch moves it to a class method.

--HG--
extra : rebase_source : 012813cf1d0967d6c29f7e085e49940570e1d58d
2013-10-25 09:30:20 +02:00
Thomas Zimmermann
78fd2c9341 Bug 927459: Cleanup DBusThread, r=qdot
This patch renames DBusThread to DBusWatcher to make its purpose
more clear. Several callback functions for DBus are converted to
methods of DBusWatcher. Their POSIX calls are now protected by
TEMP_FAILURE_RETRY.

--HG--
extra : rebase_source : d8c6963aa8388c462917180d78e8e4289f9e987a
2013-10-25 09:30:09 +02:00
Eric Chou
d743b77e70 Bug 923369 - Return true when RawDBusConnection::SendWithError() executed without any error, r=tzimmerman, r=qdot 2013-10-05 14:35:00 +08:00
Ms2ger
df62fb8b0f 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
b951e3bea6 Bug 919913: Introduce DBusReplyCallback, r=qdot,echou
DBusReplyCallback replaces the removed DBusCallback as type for
reply-handler functions. Bluetooth, the only user of DBus, has
been updated as well.
2013-10-01 10:20:55 +02:00
Thomas Zimmermann
b5e7a17af5 Bug 919913: Cleanup DBusUtils, r=qdot
This patch cleans up the DBus utilitys and helper classes. All functions
for sending have been removed. Their users have been converted to the
new methods in RawDBusConnection. Include statements have been cleaned
up as well. Some methods of DBusMessageRefPtr have been moved from the
header to the source file to prevent inclusion of the DBus API from within
the header file.
2013-10-01 10:20:39 +02:00
Thomas Zimmermann
59b461412b Bug 919913: Add send methods to RawDBusConnection, r=qdot
This patch adds methods for sending DBus messages to the class
RawDBusConnection. There are 3 types of interfaces.

 - Send             Sends a message over DBus. No error checking or
                    handling of replies is performed. These methods
                    do not block the sending thread.

 - SendWithReply    Sends a message over DBus and runs a call-back
                    function for the reply. This should be the default
                    case for most scenarios. These methods do not
                    block the sending thread.

 - SendWithError    Sends a message over DBus and waits for the reply
                    or an error. This interface has only been added for
                    some existing code that can safely block the sending
                    thread. Don't use it in new code.

These 3 types of interfaces represent what is currently used of the
existing send functions in DBusUtils. When all users have been converted
to the new methods, the interfaces in DBusUtils can be removed.
2013-10-01 10:20:21 +02:00
Wes Kocher
10df022340 Merge m-c to inbound 2013-09-04 18:04:50 -07:00
Mike Hommey
05b3f24e0e Bug 912293 - Remove now redundant boilerplate from Makefile.in. r=gps 2013-09-05 09:01:46 +09:00
Thomas Zimmermann
fc9e658022 Bug 853550: Cleanup DBus thread handling, r=qdot
For replacing the Bluetooth command thread with a LazyIdleThread,
we need to make sure that the DBus service thread is shutdown from
within the main thread.

This patch changes the DBus stop code to cleanup the DBusThread
structure from the service thread to prevent race conditions during
shutdown. The DBus service thread itself gets shutdown from the main
thread to fulfill the requirements of LazyIdleThread. The patch also
makes sure that it's not possible to accidently dispatch a runnable
while the DBus thread terminates.
2013-08-30 20:18:40 +02:00
Brian O'Keefe
0ee041b9fd Bug 875934 - Move LIBRARY_NAME to moz.build, batch 3; r=mshal 2013-08-15 09:02:09 -04:00
Birunthan Mohanathas
ee5104f639 Bug 784739 - Switch from NULL to nullptr in ipc/. r=ehsan 2013-08-23 15:51:44 -04:00
Ms2ger
8085d723ed Bug 883284 - Part d: Move LIBXUL_LIBRARY into moz.build (f-j); r=bsmedberg 2013-08-22 08:56:00 +02:00
Brian O'Keefe
3dadb0e396 Bug 896177 - Remove useless config.mk includes; r=gps 2013-07-17 16:06:53 -04:00
Thomas Zimmermann
7a59930c64 Bug 891866: Use AtomicRefCounted for RawDBusConnection, r=Ms2ger
RawDBusConnection incorrectly uses detail::RefCounted, which it
shouldn't. This patch converts it to use AtomicRefCounted instead.

--HG--
extra : rebase_source : 229bbbae3b43a47b362ab73dba5d1134a5ae1dac
2013-07-23 11:00:20 +02:00
Thomas Zimmermann
a0003d5854 Bug 891866: Support nsRefPtr<RawDBusConnection>, r=qdot
Instances of RawDBusConnection can now be contained in nsRefPtr. This
allows to share the DBus connection among multiple threads.

--HG--
extra : rebase_source : fb24472b3b55e77abc7354f17ef679661f62b7fb
2013-07-22 13:30:22 +02:00
Brian O'Keefe
f98dd45a72 Bug 883502 - Part 1: Move 'chromium_config.mk' includes after rules.mk. r=gps 2013-07-04 08:28:43 -04:00