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

210 Коммитов

Автор SHA1 Сообщение Дата
Jim Chen f0b94011a2 Bug 1248695 - Check for null browser app object when handling UI telemetry events; r=snorp
The nsAppShell mBrowserApp object may not have been initialized when
handling UI telemetry events. In that case, we should bail instead of
crashing.
2016-02-16 16:57:49 -05:00
Jim Chen cea91f9d3e Bug 1244875 - Update JNI usages; r=snorp
Update JNI usages to match the changes in JNI templates.
2016-02-09 17:27:28 -05:00
Birunthan Mohanathas d7371d07d0 Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-02-02 17:36:30 +02:00
Jim Chen 6c833a3654 Bug 1243070 - Remove obsolete size-change code; r=snorp
Remove obsolete SIZE_CHANGED event and its handler in nsWindow. Also
remove some other supporting code (such as gAndroidBounds and the
FORCED_RESIZE event) that should be unnecessary by now.
2016-02-01 17:38:14 -05:00
Jim Chen 5e98c7369d Bug 1243069 - Control GeckoThread state entirely from C++ code; r=snorp
Right now, we rely on browser.js sending Gecko:Ready, to set the
GeckoThread state to RUNNING upon receiving Gecko:Ready. This patch
gets rid of this dependency on browser.js and Gecko:Ready.
2016-02-01 17:38:14 -05:00
Jim Chen 2b4561b520 Bug 1243049 - Implement new PrefsHelper native methods; r=snorp
Implement the PrefsHelper native methods. The previous browser.js
implementation supported "pseudo-prefs" that did not exist as actual
prefs, but was accessible through PrefsHelper. In order to accommodate
these pseudo-prefs, we send observer notifications in order to
communicate with browser.js about prefs that we don't support.
2016-02-01 17:38:13 -05:00
Phil Ringnalda d381b4bca6 Back out 7 changesets (bug 1235261) for cpptest failures in TestTArray
CLOSED TREE

Backed out changeset d66c3f19a210 (bug 1235261)
Backed out changeset 467d945426bb (bug 1235261)
Backed out changeset 32b61df13142 (bug 1235261)
Backed out changeset c50bb8ed4196 (bug 1235261)
Backed out changeset 0ff0fa6fe81f (bug 1235261)
Backed out changeset df70e89669da (bug 1235261)
Backed out changeset 064969357fc9 (bug 1235261)
2016-01-31 10:10:57 -08:00
Birunthan Mohanathas 373593275e Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-01-31 17:12:12 +02:00
Kyle Huey 91efc5a86c Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug 2016-01-30 09:05:36 -08:00
Jim Chen 85514b694a Bug 1237690 - Fix possible deadlock in nsAppShell::SyncRunEvent; r=snorp
In order to prevent the deadlock, we need to release sAppShellLock when
we start waiting in SyncRunEvent. However, we cannot simply unlock it
before the wait because that introduces an out-of-order unlocking wrt
mSyncRunMonitor, which can cause further deadlocks. So this patch
converts mSyncRunMoitor to a condvar and make it use sAppShellLock. That
then involves making aAppShellLock a Mutex instead of a StaticMutex. The
final result is having one lock (sAppShellLock), which supports any
other condvars that we have like mSyncRunFinished.
2016-01-13 14:35:27 -05:00
Jim Chen c42db7f1e4 Bug 1233812 - Move SyncRunEvent to nsAppShell; r=snorp
This patch moves the SyncRunEvent logic from GLControllerSupport to
nsAppShell, as it could be useful elsewhere. This patch fixes a race
condition related to shutdown, where a deadlock could occur if Gecko
shuts down when another thread is waiting for a synchronous event to
finish running. This patch also fixes a crash on shutdown when we tried
to create a mutex after the deadlock detector has shut down.
2015-12-23 22:03:35 -05:00
Jim Chen 008886b9a1 Bug 1233812 - Fix possible race in accessing nsAppShell instance; r=snorp
When getting nsAppShell from another thread, there could be a race with
nsAppShell being destroyed on the main thread. This patch makes the raw
nsAppShell pointer only accessible from the main thread, and use a
static mutex to coordinate accessing nsAppShell from other threads.
2015-12-23 22:03:35 -05:00
Jim Chen 61ae086c99 Bug 1227706 - Remove unused GLController calls and events; r=snorp
Remove GLController calls and events in GeckoAppShell and GeckoEvent
that were made obsolete by the new native calls.
2015-12-23 22:03:34 -05:00
Jim Chen 94b3e4800e Bug 1227727 - Remove geckoConnected method in LayerView; r=snorp
Right now LayerView depends on geckoConnected being called by GeckoApp
or GeckoView during its initialization. However, we can get rid of it
and let LayerView handle the task itself. As part of this change, screen
depth overriding is moved to native code in nsAppShell.
2015-12-23 22:03:33 -05:00
Jim Chen ed2c2e5b1c Bug 1227604 - Fix compositor event order; r=snorp
When the queue only contains compositor events, a compositor event
should go to the back of the queue to maintain order.

--HG--
extra : commitid : I7bHvJCe68o
2015-12-01 13:48:18 -08:00
Jim Chen 4bce9b46f1 Bug 1211704 - Count key and IME events as UI events; r=esawin
GeckoEvent.KEY_EVENT and GeckoEvent.IME_EVENT used to count as UI events
for the hang monitor. We should count the new native calls as native
events too through this patch.
2015-10-22 17:45:47 -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
Jim Chen 13b339824b Bug 1211919 - Allow quitting when asked explicitly; r=snorp
Right now we don't allow quitting Fennec when the last nsWindow closes
(e.g. when the last GeckoView is destroyed) because we want to keep the
Gecko thread running throughout the app process lifetime. However, when
we are asked to quit explicitly through nsIAppStartup::Quit, we should
release the hold on nsAppStartup and allow quitting to continue.
2015-10-15 15:49:48 -04:00
Wes Kocher 45375c9d90 Merge m-c to inbound, a=merge 2015-10-08 14:35:43 -07:00
Jim Chen e924946ea2 Bug 1200426 - Convert PROCESS_OBJECT GeckoEvent to native call; r=snorp
The PROCESS_OBJECT GeckoEvent is used to set the layer client object in
Gecko once Gecko is done loading. This patch converts it to a native
call in GeckoView.Window.
2015-10-08 15:25:49 -04:00
Ahmed Khalil 3f5aa180f0 Bug 1201926 - Add support for keyed histograms to Fennec's Telemetry module, r=nalexander 2015-10-08 11:32:52 +05:30
Carsten "Tomcat" Book 049a35a49c Backed out changeset 2e8206d7352e (bug 1200426) for Android Perma Failures 2015-10-08 10:07:11 +02:00
Jim Chen c05389afcc Bug 1200426 - Convert PROCESS_OBJECT GeckoEvent to native call; r=snorp
The PROCESS_OBJECT GeckoEvent is used to set the layer client object in
Gecko once Gecko is done loading. This patch converts it to a native
call in GeckoView.Window.
2015-10-08 01:12:57 -04:00
Wes Kocher d31f5415b2 Backed out 2 changesets (bug 1200426) for android tpn bustage
Backed out changeset 4dcc2fb45208 (bug 1200426)
Backed out changeset 2dea192c7f33 (bug 1200426)
2015-10-07 09:05:01 -07:00
Jim Chen 0f413bc2a3 Bug 1200426 - Convert PROCESS_OBJECT GeckoEvent to native call; r=snorp
The PROCESS_OBJECT GeckoEvent is used to set the layer client object in
Gecko once Gecko is done loading. This patch converts it to a native
call in GeckoView.Window.
2015-10-07 08:57:30 -04:00
Jim Chen 08e3d9ccd5 Bug 1200343 - Implment PrefsHelper native calls; r=snorp
This patch implements the PrefsHelper native calls for getting prefs;
2015-09-28 12:07:10 -04:00
Jim Chen eb87f7d742 Bug 1200343 - Remove pref events from GeckoEvent; r=snorp
Now that we use native calls, we can remove the pref-related events from
GeckoEvent.
2015-09-28 12:07:09 -04:00
Jim Chen 3d7c253ff0 Bug 1208041 - Fix race condition when coalescing viewport events; r=snorp
We have a pretty messy system of coalescing viewport events that
introduced a race condition during the recent JNI refactoring. This
patch makes that code simpler and fixes the race condition. Instead of
keeping track of a previous viewport event, we now scan the event queue
for previous viewport events. This shouldn't be a perf concern because
we only scan the queue for viewport and native callback events, and stop
scanning as soon as we find another kind of event.
2015-09-28 12:07:09 -04:00
Wes Kocher e143a6410c Backed out 4 changesets (bug 1200343) for android talos failures
Backed out changeset 67dc42cbf02b (bug 1200343)
Backed out changeset b077acafcebb (bug 1200343)
Backed out changeset e115ca114601 (bug 1200343)
Backed out changeset 905e1fb54fd4 (bug 1200343)
2015-09-25 13:21:58 -07:00
Jim Chen a0ed6d9e5e Bug 1200343 - Implment PrefsHelper native calls; r=snorp
This patch implements the PrefsHelper native calls for getting prefs;
2015-09-25 15:03:35 -04:00
Jim Chen 83e034c311 Bug 1200343 - Remove pref events from GeckoEvent; r=snorp
Now that we use native calls, we can remove the pref-related events from
GeckoEvent.
2015-09-25 15:03:35 -04:00
Jim Chen e6f22f3cfa Bug 1197957 - Switch PROFILE_READY state to correspond to profile-after-change; r=snorp
Originally, the GeckoThread PROFILE_READY state was chosen to correspond
to the profile-do-change event, to give priority to JNI code (e.g.
window creation) over other events that may be registered under
profile-after-change event. However, this leads to broken tests because
our testing infra expects things like window creation to happen during
profile-after-change at the earliest. This is because we have to wait
for addons like SpecialPowers to be loaded between profile-do-change and
profile-after-change. This patch changes the PROFILE_READY state to
correspond to the profile-after-change event, so things are consistent
again.
2015-09-21 10:13:33 -04:00
Jim Chen 99ef489a78 Bug 1197957 - Implement GeckoView.Window.open in nsWindow; r=snorp
nsWindow will implement native methods of GeckoView.Window. This patch
implements the open method, which opens a new window in the same manner
as the CLH, and associates the new nsWindow with the GeckoView.Window
instance.
2015-09-21 10:13:32 -04:00
Jim Chen f57ad9e80a Bug 1197976 - Provide compatibility with AndroidGeckoEvent; r=snorp
With the new nsAppShell event loop based on runnable events, we need to
implement AndroidGeckoEvent handling as a runnable event. This patch adds
nsAppShell::LegacyGeckoEvent and adopts its implementation from existing
code that handle AndroidGeckoEvent.
2015-09-21 10:13:32 -04:00
Jim Chen d01f456063 Bug 1197976 - Use runnable events for nsAppShell event loop; r=snorp
nsAppShell is currently based on AndroidGeckoEvent objects, which mirror
GeckoEvent on the Java side. With GeckoEvent going away, we will be
gradually removing AndroidGeckoEvent as well. This patch makes the
nsAppShell event loop based on runnable objects, which derive from
nsAppShell::Event. Using runnable objects is much more flexible and allows
us, for example, to post a lambda to the event loop to be run later.
2015-09-21 10:13:32 -04:00
Jim Chen 797447c09d Bug 1197974 - Don't exit Gecko on Android even if there's no window; r=snorp
Gecko on Android follows the Android app model where it never stops
until it is killed by the system or told explicitly to quit. Therefore,
we should exit Gecko when there is no window or the last window is closed.
2015-09-18 09:17:10 -04:00
Jim Chen 192182c441 Bug 1195496 - Implement speculative connection method in GeckoThread; r=snorp
One thing we do in the Fennec CLH is to make a speculative connection
based on the URI that's passed in. However, by the time the CLH runs,
we're far along into startup, and the advantage of a speculative
connection is reduced. This patch implements making speculative
connection as a method in GeckoThread, so that Fennec can make a
speculative connection without relying on the Fennec CLH.
2015-08-19 18:14:47 -04:00
Jim Chen 93533110bc Bug 1195496 - Add PROFILE_READY Gecko state; r=snorp
Many Gecko operations depend on the profile being available. This
patch adds a PROFILE_READY Gecko state so that we can queue calls
until profile is loaded.
2015-08-19 18:14:47 -04:00
William Chen 6d6411c090 Bug 1131470 - Part 2: Update screen configuration HAL to report orientation angle. r=snorp,mwu
--HG--
extra : rebase_source : c6eb4dd4f54b1e9db7e7d2c39e535ba4bcd8af1f
2015-08-18 14:55:15 -07:00
William Chen 3c9928ced9 Bug 1131470 - Part 1: Rename existing use of ScreenOrientation to ScreenOrientationInternal. r=baku
--HG--
extra : rebase_source : 72e978d48e8356da9e8c66adfa0a97983034aa5a
2015-08-18 14:55:09 -07:00
Nathan Froyd 160a6405bb Bug 1194806 - part 2 - mark overrides as such in widget/android/; r=snorp 2015-08-14 22:06:20 -04:00
Jim Chen 24514e7c7a Bug 1192082 - Followup to iniialize/deinitialize JNI in nsAppShell; r=me 2015-08-13 16:57:34 -04:00
Jim Chen ee3de3a3c3 Bug 1192082 - Iniialize/deinitialize JNI in nsAppShell; r=snorp
First we need to set the Gecko thread JNIEnv* in nsAndroidStartup, but
after that we can initialize and deinitialize the rest of JNI, including
AndroidBridge, in GeckoAppShell. This makes nsAppShell control the
AndroidBridge lifetime. Over time, parts of the AndroidBridge
functionality will be migrated to nsAppShell.
2015-08-13 00:53:40 -04:00
Jim Chen d1f529698f Bug 1192077 - Convert AndroidBridge JNIEnv calls; r=esawin 2015-08-13 00:53:39 -04:00
Emanuel Hoogeveen 7d1e52f2ff Bug 905127 - Part 1 - Make some functions from nsNetUtil not inline. r=jduell 2015-07-07 04:17:00 +02:00
Juan Gomez 258ad59e3f Bug 1171931 - Refactor duplicated code using XRE_IsParent/ContentProcess. r=froydnj 2015-07-03 18:29:00 -07:00
Ryan VanderMeulen 5f5c327690 Backed out changeset 8b4e4083639e (bug 1171931) for B2G debug emulator bustage. 2015-06-25 19:48:42 -04:00
Juan Gomez 702a59d135 Bug 1171931 - Refactor duplicated code using XRE_IsParent/ContentProcess. r=froydnj
--HG--
extra : rebase_source : 2ecbe6c1dd8a7ad8dc529b53349ad431cf1116c9
2015-06-24 14:11:00 -04:00
Eric Rahm 4879ae86f4 Bug 1165518 - Part 2: Replace prlog.h with Logging.h. rs=froydnj 2015-05-19 11:15:34 -07:00
Eric Rahm 15f7146909 Bug 1162293 - Part 1: Remove instances of #ifdef PR_LOGGING. r=froydnj
PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
2015-05-07 09:43:38 -07:00