Commit Graph

2783 Commits

Author SHA1 Message Date
Mike Hommey
daa695d2f2 Bug 1189967 - Be slightly more explicit about some conversions to std::wstring. r=nfroyd 2015-08-23 22:20:19 +09:00
Mike Conley
894fb80991 Bug 1191976 - Intentionally crash if we hit an IPC FatalError in the parent process. r=billm
When the parent process has trouble deserializing an IPC message from the content
process, it originally killed that content process. This doesn't result in us
creating a crash report (and doing so is difficult if the FatalError is hit
off main thread). We now crash the parent process if we hit such a FatalError
in the parent process. This will hopefully give us an idea of how frequent
these FatalErrors are, since up until now we've been getting no crash data
for them.
2015-08-18 15:28:01 -04:00
Mike Conley
6ca832b8e4 Bug 1106321 - Serialize DEVMODE down to the content process when printing on Windows. r=jimm 2015-08-06 17:36:54 -04:00
Kyle Huey
1ffb03e8dc 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
Botond Ballo
68f04d81d4 Bug 1056356 - Allow calling NewRunnableMethod() with a const pointer to the callee object. r=froydnj 2015-07-29 19:51:36 -04:00
Carsten "Tomcat" Book
c012e7f38c Merge mozilla-central to b2g-inbound 2015-08-03 16:20:10 +02:00
Thomas Zimmermann
e12e2b923f Bug 1187904: Add |DaemonSocketConnector|, r=shuang
|DaemonSocketConnector| is a copy of |BluetoothDaemonConnector| and
also includes |BluetoothDaemonInterface::CreateRandomAddressString|.
2015-08-03 13:17:02 +02:00
Bob Owen
f2e95303a1 Bug 1189352: Fix NSPR_LOG_FILE with absolute paths for sandboxed child on Windows. r=bbondy 2015-08-03 07:58:43 +01:00
Makoto Kato
e92450872e Bug 830801 - Part 2. Remove NOMINMAX define from moz.build. r=mshal 2015-08-03 10:07:09 +09:00
Jesse Ruderman
e08f0ec656 Bug 1024259: Use NS_FREE_PERMANENT_DATA more consistently. r=mccr8 2015-07-31 12:11:48 -07:00
Cervantes Yu
2ba703ba73 Bug 1155547, Part 2: Create PNuwa protocol (managed by PBackground) for forking content processes. r=khuey
This allows us to send a sync fork request to the Nuwa process when we need one but there is no
spare process available. After an app is launched, the request to fork a spare process is still
handled asynchronously.
2015-07-31 15:25:27 +08:00
Andrea Marchesini
27d25d23ff Bug 1188776 - Remove appId/isInBrowserElement from BroadcastChannel. r=bholley 2015-07-29 06:56:00 -04:00
Ryan VanderMeulen
5ec75e6c41 Merge inbound to m-c. a=merge 2015-07-30 16:08:21 -04:00
Thomas Zimmermann
bd17253ac7 Bug 1187249: Move Bluetooth init operators to ipc/hal, r=shuang 2015-07-30 10:34:51 +02:00
Thomas Zimmermann
f4f402420d Bug 1183249: Move PDU helper functions to ipc/hal, r=shuang 2015-07-30 10:34:51 +02:00
Thomas Zimmermann
f2449f1905 Bug 1187249: Move |DaemonSocketPDUHeader| to hal/ipc, r=shuang 2015-07-30 10:34:51 +02:00
Bob Owen
f9cb6a4fda Bug 1171796: Add sandbox rule for child process NSPR log file on Windows. r=bbondy
This also moves the initialization of the sandbox TargetServices to earlier in
plugin-container.cpp content_process_main, because it needs to happen before
xul.dll loads.
2015-07-30 10:04:42 +01:00
Bobby Holley
106e778c81 Bug 1188696 - Hoist nsRefPtr.h into MFBT. r=froydnj 2015-07-29 10:44:59 -07:00
Aaron Klotz
aec9d88268 Bug 1185639 - Allow deferred message processing to happen between consecutive IPC message dispatches. r=jimm 2015-07-21 01:21:51 -06:00
Ehsan Akhgari
4f8ac374e9 Bug 1188211 - Fix more constructors in IPC; r=billm 2015-07-28 08:53:31 -04:00
David Anderson
3e60fe55d0 Add default initializers for primitive fields in IPDL structs. (bug 1154522, r=billm) 2015-07-28 00:02:10 -07:00
Mike Hommey
46df179a4f Bug 1187533 - Change how Gtk+2 plugin-container is started on Gtk+3 builds. r=billm
The current situation looks like this: Firefox launches the plugin-container
with two environment variables set:
  LD_LIBRARY_PATH=$FIREFOX_DIR:$LD_LIBRARY_PATH
  LD_PRELOAD=$FIREFOX_DIR/libmozgtk2.so:$LD_PRELOAD

libxul.so has a dependency on libmozgtk.so (without "2"), but libmozgtk2.so
has a SONAME of libmozgtk.so, so ld.so recognizes libmozgtk2.so as a
dependency of libxul.so, and uses it instead of the actual libmozgtk.so,
making the plugin-container use Gtk+2 instead of Gtk+3 to load Gtk+2 plugins.

Now, ASan sets things up in shared libraries such that they needs a symbol
from the executable binary. So in the case of plugin-container, the
plugin-container executable itself contains some ASan symbols such as
__asan_init_v3. libmozgtk2.so, OTOH, contains an undefined weak reference to
that symbol, like all other Firefox shared libraries.

Since libmozgtk2.so is LD_PRELOADed, it is loaded _before_ the
plugin-container executable, and __asan_init_v3 can't be resolved.

Disabling ASan for libmozgtk2.so would be a possibility, but the build system
doesn't really know how to do that, and filtering out -fsanitize=address
can be fragile.

The alternative possibility, implemented here, is to change the library
loading strategy, renaming libmozgtk2.so to gtk2/libmozgtk.so, and setting
the following environment variable when Firefox launches the plugin-container:
  LD_LIBRARY_PATH=$FIREFOX_DIR/gtk2:$FIREFOX_DIR:$LD_LIBRARY_PATH
2015-07-28 08:19:13 +09:00
Ryan VanderMeulen
0365cafa35 Merge m-c to inbound. a=merge 2015-07-27 16:06:20 -04:00
Ryan VanderMeulen
30e0a38249 Backed out changeset b2d0e28fe539 (bug 1185639) test_plugin_focus.html timeouts. 2015-07-27 16:06:03 -04:00
Andrew McCreight
5855ecb901 Bug 1089816 - Let ASan content processes run to completion. r=billm
There are a variety of ways that the parent and child process ensure that
the child process exits quickly in opt builds, but for AddressSanitizer
builds we want to let the child process to run to completion, so that we
can get a LeakSanitizer report.

This requires adding some addition LSan suppressions, because running
LSan in child processes detects some new leaks.
2015-07-27 12:49:48 -07:00
Aaron Klotz
70f3f21c79 Bug 1185639: Allow deferred message processing to happen between consecutive IPC message dispatches; r=jimm 2015-07-21 01:21:51 -06:00
Thomas Zimmermann
9d5274ac92 Bug 1187230: Generalize Bluetooth daemon runnables, r=shuang
The new daemon runnables are generalized implementations of the
Bluetooth daemon runnables. The code is unchanged, except for name
changes and fixes to the coding style.
2015-07-27 13:33:17 +02:00
Carsten "Tomcat" Book
9237895ae0 Backed out changeset fa4f742c5c11 (bug 1187230) for bustage on a CLOSED TREE 2015-07-24 15:42:39 +02:00
Thomas Zimmermann
e9838bafe8 Bug 1187230: Generalize Bluetooth daemon runnables, r=shuang
The new daemon runnables are generalized implementations of the
Bluetooth daemon runnables. The code is unchanged, except for name
changes and fixes to the coding style.
2015-07-24 14:50:06 +02:00
Jeff Muizelaar
d93fe7cfe4 Bug 1186025. Optimize the usage of regions. r=mstange
This eliminates a bad idiom in some places.
2015-07-21 10:54:44 -04:00
Thomas Zimmermann
8399857001 Bug 1185478: Remove strong references from socket I/O class to socket classes
The shutdown procedure for socket classes ensures that the I/O class is
deleted independently from its socket class. If the socket class has been
deleted, no I/O is performed and no socket events are forwarded. The I/O
class therefore doesn't require a strong reference to its socket class.

This patch removes the remaining ref-counted pointers from the socket I/O
classes. The socket class clears the weak reference in its socket I/O class
when closing the socket.
2015-07-21 08:06:29 +02:00
Thomas Zimmermann
1cdfb998aa Bug 1185478: Add leak checks to socket I/O classes 2015-07-21 08:06:29 +02:00
Christoph Kerschbaumer
c12c53450c Bug 1143922 - Add AsyncOpen2 to nsIChannel and perform security checks when opening a channel - loadinfo changes (r=sicking,tanvi,sworkman) 2015-07-19 19:11:57 -07:00
Christoph Kerschbaumer
a1adafb4ba Bug 1175803 - Store redirect chain within loadInfo - part 1 (r=sicking,mayhemer) 2015-07-19 19:11:03 -07:00
Thomas Zimmermann
d4dd652789 Bug 1171994: Cleanup JSAPI code of |RilConsumer|, r=htsai
This patch cleans up the JSAPI code of |RilConsumer| and moves it
into the class itself.
2015-07-17 12:10:01 +02:00
Thomas Zimmermann
f74aa11b5a Bug 1171994: Use |RilSocket| to handle RIL messages on the RIL worker, r=htsai
This patch finally breaks up forwarding received RIL messages to the
main thread before they go to the RIL worker. Any RIL message that is
received on th I/O thread is forwarded directly to the RIL worker
thread and handed over to the RIL worker JS code.

The patch includes a number of changes. They all depend on each other,
so there's no good way of landing them one-by-one.

 * |RilConsumer| now runs on the RIL worker thread.

 * |RilWorker| uses tasks to register/unregister |RilConsumer| in the worker.

 * |RilConsumer| uses |RilSocket| instead of |StreamSocket|.

 * With |RilSocket|, received RIL messages do not go through main. They are
   forwared to the RIL worker and handed over to JS immediately.
2015-07-17 12:10:01 +02:00
Thomas Zimmermann
f556613dee Bug 1171994: Store an instance of |RilWorker| for each RIL connection, r=htsai 2015-07-17 12:10:01 +02:00
Thomas Zimmermann
9557bb8ff5 Bug 1171994: Separate RIL I/O interfaces, r=htsai
This patch separates the current interface of |RilConsumer| into
two distinct classes. |RilWorker| provides the public interface
and |RilConsumer| provides the internal implementation. Running
|RilConsumer| on a worker thread will be easier this way.
2015-07-17 12:10:01 +02:00
Thomas Zimmermann
7bfe86ec48 Bug 1171994: Forward received RIL socket I/O via |WorkerCrossThreadDispatcher|, r=htsai
With this patch, |RilSocket| and it's helpers forward received data
via a WCTD. This will hand over the worker's JS context to the RIL
consumer.

In a later patch, the RIL consumer will be moved onto the RIL worker
thread and call the JS ril-worker code directly.
2015-07-17 12:10:01 +02:00
Thomas Zimmermann
bbf3f8eab9 Bug 1171994: Add |RilSocket| and |RilSocketConsumer|, r=htsai
|RilSocket| and |RilSocketConsumer| are copies of the respective stream-
socket classes. Improvements to the RIL I/O code will be implemented on
top of the new classes.
2015-07-17 12:10:01 +02:00
Bill McCloskey
b446664f65 Bug 1177013 - Bug fixes for CPOW cancelation (r=dvander) 2015-07-15 14:37:11 -07:00
Bill McCloskey
cb4ca966f0 Bug 1128454 - Fix IPDL test (r=jimm) 2015-07-15 14:30:05 -07:00
Jim Mathies
2f607ca4ab Bug 1128454 - When plugin bridging mysteriously fails, log the ipc channel state along with the nsresult error code. r=billm 2015-07-15 14:47:14 -05:00
Ryan VanderMeulen
7823423a30 Backed out 6 changesets (bug 1171994) for causing smoketest bustage. a=me
Backed out changeset 46061230e77a (bug 1171994)
Backed out changeset ea00769b70df (bug 1171994)
Backed out changeset 2dc847e4650c (bug 1171994)
Backed out changeset 14ec8c87f973 (bug 1171994)
Backed out changeset 31cdbef9fe22 (bug 1171994)
Backed out changeset 463528fcee4d (bug 1171994)
2015-07-15 12:53:28 -04:00
Wes Kocher
bf5ce91ff6 Merge b2ginbound to central, a=merge 2015-07-14 15:25:44 -07:00
Thomas Zimmermann
b5e00daa0e Bug 1171994: Cleanup JSAPI code of |RilConsumer|, r=htsai
This patch cleans up the JSAPI code of |RilConsumer| and moves it
into the class itself.
2015-07-14 16:57:00 +02:00
Thomas Zimmermann
da78986754 Bug 1171994: Use |RilSocket| to handle RIL messages on the RIL worker, r=htsai
This patch finally breaks up forwarding received RIL messages to the
main thread before they go to the RIL worker. Any RIL message that is
received on th I/O thread is forwarded directly to the RIL worker
thread and handed over to the RIL worker JS code.

The patch includes a number of changes. They all depend on each other,
so there's no good way of landing them one-by-one.

 * |RilConsumer| now runs on the RIL worker thread.

 * |RilWorker| uses tasks to register/unregister |RilConsumer| in the worker.

 * |RilConsumer| uses |RilSocket| instead of |StreamSocket|.

 * With |RilSocket|, received RIL messages do not go through main. They are
   forwared to the RIL worker and handed over to JS immediately.
2015-07-14 16:57:00 +02:00
Thomas Zimmermann
4f939a0d7b Bug 1171994: Store an instance of |RilWorker| for each RIL connection, r=htsai 2015-07-14 16:57:00 +02:00
Thomas Zimmermann
824edc1903 Bug 1171994: Separate RIL I/O interfaces, r=htsai
This patch separates the current interface of |RilConsumer| into
two distinct classes. |RilWorker| provides the public interface
and |RilConsumer| provides the internal implementation. Running
|RilConsumer| on a worker thread will be easier this way.
2015-07-14 16:57:00 +02:00
Thomas Zimmermann
5606499d67 Bug 1171994: Forward received RIL socket I/O via |WorkerCrossThreadDispatcher|, r=htsai
With this patch, |RilSocket| and it's helpers forward received data
via a WCTD. This will hand over the worker's JS context to the RIL
consumer.

In a later patch, the RIL consumer will be moved onto the RIL worker
thread and call the JS ril-worker code directly.
2015-07-14 16:57:00 +02:00