Commit Graph

69 Commits

Author SHA1 Message Date
Alastor Wu
013f2364d5 Bug 1373888 - part8 : add log. r=cpearce
MozReview-Commit-ID: JyLXnA9J9Ic

--HG--
extra : rebase_source : 56545a7818f5c5ed3b11e31e7b5eb26ca214e19c
2017-08-29 15:28:28 +08:00
Alastor Wu
c599481d78 Bug 1373888 - part7 : modify platform wakelocks. r=cpearce,snorp,spohl
* OSX
Make the lock of the type kIOPMAssertionTypeNoDisplaySleep and kIOPMAssertionTypeNoIdleSleep
as a singleton. Won't need to require an extra lock.

* Windows
Add |mRequireForDisplay| to ensure the "audio-playing" won't overwrite the previous
display requirement.

* Android
Add "audio-playing" and "video-playing", and make sure the audio-lock won't be cancel
when receiving "WakeLockDelegate.STATE_LOCKED_BACKGROUND".

MozReview-Commit-ID: 97oNX7H2qij

--HG--
extra : rebase_source : 24fa8b267ad97d668fa55462d1f61ef5c92b632f
2017-08-29 15:28:23 +08:00
Alastor Wu
0be0a7c288 Bug 1373888 - part4 : request non-display wake lock for audio playing. r=cpearce,spohl
According to [1], kIOPMAssertionTypeNoDisplaySleep prevents display sleep and
kIOPMAssertionTypeNoIdleSleep prevents idle sleep.

We should use kIOPMAssertionTypeNoIdleSleep for audio playing, because it won't
need to block the display.

[1] https://developer.apple.com/library/content/qa/qa1340/_index.html

---

On Windows, ES_DISPLAY_REQUIRED forces display on, and ES_SYSTEM_REQUIRED forces
system on working state [2].

[2] https://msdn.microsoft.com/zh-tw/library/windows/desktop/aa373208(v=vs.85).aspx

MozReview-Commit-ID: Izs29PdzQOW

--HG--
extra : rebase_source : d0726131735b9cedf566f937204e585345b9d5e3
2017-08-29 15:25:34 +08:00
Alastor Wu
6a6ee2a0d7 Bug 1373888 - part3 : rename the topic of the wake lock. r=cpearce
For knowing the wake lock usage more clearly, we should use more specific topic name.

In OSX, you can use "$ pmset -g assertions" to check all the wakelock.
In Windows, using "$ powser -energy" to generate the energy report.

MozReview-Commit-ID: rAXnkxTvLc

--HG--
extra : rebase_source : 42ebf204673d3c913739f64c71c24af20d37c95d
2017-08-29 10:54:28 +08:00
Bill McCloskey
a7bc022071 Bug 1384336 - Stop using OS-level event loop in content process (r=mstange)
MozReview-Commit-ID: 1ouSlgGchWl
2017-08-09 21:24:20 -07:00
Alex Gaynor
11a211f901 Bug 1386308 - stop trying to change the display sleep settings from the content process; r=haik
Before this change we were trying to change the settings from both the content
and parent processes, so this doesn't change any functionality. This allows to
remove access to the com.apple.PowerManagement.control mach service from the
content process.

MozReview-Commit-ID: 3DOhqG5U6oz

--HG--
extra : rebase_source : dee0b97c444ae95cfc8f80cb0fb99aa9e2658d51
2017-08-01 12:22:42 -04:00
Brendan Dahl
987400a824 Bug 1355147 - Add basic support for headless mode on macOS. r=jrmuizel
MozReview-Commit-ID: 23Wchhimynz
2017-07-28 11:00:27 -07:00
Josh Aas
9d7fb5a517 Bug 1372599 - Only turn off CGEvent logging on buggy versions of OSX to avoid delays in first paint. r=mstange
--HG--
extra : amend_source : 6ac7d91aac2458e50a3de8a59e2e6ce0f1fd4509
2017-07-06 23:31:00 -04:00
Nicholas Nethercote
58786e1ea7 Bug 1375392 - Tweak the PROFILER_LABEL* macros. r=mstange.
This patch makes the following changes to the macros.

- Removes PROFILER_LABEL_FUNC. It's only suitable for use in functions outside
  classes, due to PROFILER_FUNCTION_NAME not getting class names, and it was
  mostly misused.

- Removes PROFILER_FUNCTION_NAME. It's no longer used, and __func__ is
  universally available now anyway.

- Combines the first two string literal arguments of PROFILER_LABEL and
  PROFILER_LABEL_DYNAMIC into a single argument. There was no good reason for
  them to be separate, and it forced a '::' in the label, which isn't always
  appropriate. Also, the meaning of the "name_space" argument was interpreted
  in an interesting variety of ways.

- Adds an "AUTO_" prefix to PROFILER_LABEL and PROFILER_LABEL_DYNAMIC, to make
  it clearer they construct RAII objects rather than just being function calls.
  (I myself have screwed up the scoping because of this in the past.)

- Fills in the 'js::ProfileEntry::Category::' qualifier within the macro, so
  the caller doesn't need to. This makes a *lot* more of the uses fit onto a
  single line.

The patch also makes the following changes to the macro uses (beyond those
required by the changes described above).

- Fixes a bunch of labels that had gotten out of sync with the name of the
  class and/or function that encloses them.

- Removes a useless PROFILER_LABEL use within a trivial scope in
  EventStateManager::DispatchMouseOrPointerEvent(). It clearly wasn't serving
  any useful purpose. It also serves as extra evidence that the AUTO_ prefix is
  a good idea.

- Tweaks DecodePool::SyncRunIf{Preferred,Possible} so that the labelling is
  done within them, instead of at their callsites, because that's a more
  standard way of doing things.

--HG--
extra : rebase_source : 318d1bc6fc1425a94aacbf489dd46e4f83211de4
2017-06-22 17:08:53 +10:00
Kan-Ru Chen
dbb51ca5fc Bug 1194751 - Part 8. Implement ScreenHelperCocoa and delete old nsScreenManagerCocoa/nsScreenCocoa. r=mstange
ScreenHelperCocoa is the platform dependent part of the original
nsScreenManagerCocoa and nsScreenCocoa. It registers
NSApplicationDidChangeScreenParametersNotification and pushes updates
to ScreenManager. See patch part 4. for how ScreenManager works.

MozReview-Commit-ID: 1A5ha4Ys2dL

--HG--
rename : widget/cocoa/nsScreenManagerCocoa.h => widget/cocoa/ScreenHelperCocoa.h
rename : widget/cocoa/nsScreenManagerCocoa.mm => widget/cocoa/ScreenHelperCocoa.mm
extra : rebase_source : c7737e18656710c36f6c04ac71a17deeca3224a5
2017-03-09 19:34:49 +08:00
Chris Peterson
469de34a31 Bug 1313903 - Fix -Wmismatched-parameter-types warning in widget/cocoa/nsAppShell.mm. r=spohl
widget/cocoa/nsAppShell.mm:113:47 [-Wmismatched-parameter-types] conflicting parameter types in implementation of 'nextEventMatchingMask:untilDate:inMode:dequeue:': 'NSEventMask' (aka 'unsigned long long') vs 'NSUInteger' (aka 'unsigned long')

NSWindow's nextEventMatchingMask method expects a parameter of type NSEventMask, not NSUInteger, when building  x86_64 with SDK 10.12:

https://developer.apple.com/reference/appkit/nswindow/1419304-nexteventmatchingmask
2016-11-02 21:18:36 -07:00
Sebastian Hengst
cdcc9e20da Bug 1304829 - rename RELEASE_BUILD to RELEASE_OR_BETA: main part. r=ted,Mossop
MozReview-Commit-ID: 1lCt0xTMV5O
2016-10-08 11:14:49 +02:00
stefanh@inbox.com
5e50e79d79 Bug 1281028 - Remove run-time Mavericks checks in nsAppShell.mm. r=spohl. 2016-06-20 20:41:18 +02:00
Kirk Steuber
d8c748eec4 Bug 1248985 - Fix Spelling Error in nsAppShell.mm. r=josh
MozReview-Commit-ID: LqJrA0UOUfi

--HG--
extra : transplant_source : %7D%08%5C%25%2A6%DD%7F%E0%5D%14R%FA%E8a%9F%A1M%A0%F5
2016-02-17 07:09:39 -08:00
Steven Michaud
d59e2ac8dc Bug 1181977 - Firefox app menu contains only "Quit" in certain edgecases. r=spohl 2015-08-24 10:57:02 -05:00
Kyle Huey
76e3009ab8 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
Steven Michaud
09ad196ba3 Bug 1186158 - Receive notifications of sandbox violations in the browser on OS X. r=spohl 2015-07-28 15:19:55 -05:00
Ryan VanderMeulen
0b120e2884 Backed out changeset 4fd14cf6b415 (bug 1186158) for OSX Werror bustage. 2015-07-27 15:21:52 -04:00
Steven Michaud
36ac32cb02 Bug 1186158 - Receive notifications of sandbox violations in the browser on OS X. r=spohl 2015-07-27 13:56:08 -05:00
Steven Michaud
edb79b5fd7 Bug 1151345 - Firefox app menu sometimes contains only "Quit" on OS X. r=spohl 2015-06-03 16:19:51 -05:00
Ehsan Akhgari
883849ee32 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Aaron Klotz
5d33b28500 Bug 1132305 - Ensure that BHR knows when thread activity has resumed in nextEventMatchingMask. r=smichaud 2015-02-12 10:31:42 -07:00
Neil Deakin
a744e9625f Bug 1102039, Ensure that the popup's widget visibility is updated after rollup, allows popups to disappear at the start of the minimize animation rather than after, r=tn 2015-01-07 20:52:20 -05:00
Ehsan Akhgari
390eaebf41 Bug 1117044 - Mark virtual overridden functions as MOZ_OVERRIDE in widget; r=roc 2015-01-02 09:02:51 -05:00
Josh Aas
f9e3926e19 Bug 1092630: Get rid of native widgets for OS X NPAPI plugins, make things work much better under e10s. Patch by Josh Aas, Markus Stange, Steven Michaud, David Parks. r=smichaud/jst/josh (more reviews pending) 2014-12-11 08:44:07 -06:00
Mason Chang
74c80403e2 bug 552020 Part 1: Hook into CVDisplayLink to get vsync events on OSX. r=benwa,mstange 2014-11-18 13:28:42 -08:00
Ryan VanderMeulen
87e1d173f4 Backed out changesets a99bd0b3b075, a7fb851f823a, and 9fc2d99376cd (bug 552020) for non-unified bustage and OSX 10.6 tsvgr crashes.
CLOSED TREE
2014-11-14 15:57:35 -05:00
Mason Chang
ee275a75dc Bug 552020. Part 1: Hook into CVDisplayLink to get vsync events on OSX. r=benwa,mstange 2014-11-14 08:31:04 -08:00
Steven Michaud
9556bac074 Bug 1092855 - Work around bad interaction between jemalloc and Apple uninitialized memory bug. r=spohl 2014-11-11 15:28:18 -06:00
Steven Michaud
e46726de80 Bug 1017595 - Links from external applications sometimes fail to open when Firefox is hidden. r=spohl 2014-10-31 17:14:44 -05:00
Sebastian Hengst
1e915ce56f Bug 1078033 - Remove remaining Camino code. r=ted 2014-10-10 17:00:29 +02:00
Ralph Giles
d2a60e7b9b Bug 1043489 - Fix MacOS X holding screensaver lock with fullscreen video. r=smichaud
This ports the fix Chris Pearce made to the windows code in bug 1063995.
We just listen for the 'screen' topic and rely on the notification
machinery to filter duplicates. This avoids incrementing the
lock count on both playback start and fullscreen, and thus waiting
until fullscreen exits after playback stops before enabling the
screensaver again.
2014-10-07 18:20:00 -07:00
Benoit Jacob
9b83c2d49b Bug 1028588 - Fix dangerous public destructors of Mac-specific reference-counted classes - r=mstange 2014-07-06 11:25:31 -04:00
Steven Michaud
1b9bdee85d Bug 1016200 - Single click stop working in web content, require double click. r=spohl 2014-06-30 12:28:45 -05:00
Chris Peterson
5ca0b3c938 Bug 1028021 - Fix -Wdelete-non-virtual-dtor warning in widget/cocoa/nsAppShell.mm. r=smichaud 2014-06-19 23:03:54 -07:00
Lucas GOLVEN
356949aa3d Bug 772347 - Add WakeLockListener on MacOSX. r=smichaud
Disables the screensaver on Mac while a video is playing.
2014-06-13 19:58:00 +02:00
Steven Michaud
6b447e78bc Bug 1013852 - Clicking doesn't focus the window sometimes. r=mstange 2014-06-02 16:43:31 -05:00
Victor Porof
9ce7e9c089 Bug 1007203 - Always add categories when pushing to the pseudostack, r=djvj 2014-05-23 17:12:29 -04:00
Steven Michaud
3836ce17c9 Bug 996848 - Rewrite Mac nsAppShell native event handling. r=spohl 2014-05-10 11:58:07 -05:00
Ed Morley
567c128d78 Backed out changeset 4341602f99b0 (bug 996848) for reftest failures on OS X 2014-05-07 18:44:01 +01:00
Steven Michaud
ffd68891ee Bug 996848 - Rewrite Mac nsAppShell native event handling. r=spohl 2014-05-07 11:13:27 -05:00
Steven Michaud
9de812d9a7 Bug 959281 - http://paperjs.org/examples/voronoi/ drawing performance has regressed badly. r=spohl 2014-04-16 09:59:15 -05:00
Olli Pettay
e84a8e90a5 Backout Bug 953435 to fix bug 959281, a=backout 2014-02-02 20:12:27 +02:00
Bill McCloskey
fb9e065975 Bug 951908 - Ensure child processes shut down propertly on Macs (r=bent,smichaud) 2014-01-15 13:09:41 -08:00
Olli Pettay
5cdea8d914 Bug 953435 - Browser hang on Mac if an AfterProcessNextEvent callback tries to spin the event loop, r=nfroyd+smichaud
--HG--
extra : rebase_source : e999d852f5f73b18f37ff6a5488cc171c95d9e61
2014-01-09 00:10:06 +02:00
Ben Turner
4d2b15f34c Bug 939182 - Add 'eventWasProcessed' argument to nsIThreadObserver::afterProcessNextEvent(), r=bsmedberg.
--HG--
extra : transplant_source : %5E%80p%D6%C6A%23%0AZ%06%23%16%155%DB%CE%F5%5CEx
2013-10-23 05:01:20 -07:00
Neil Deakin
f3270a29d5 Bug 596723, Don't consume clicks outside of arrow panels by default, always consume the clicks on anchors of all popups, r=dao,neil 2013-11-04 11:22:24 -05:00
Joshua Cranmer
b82a7849fb Bug 884061 - Part 4: Remove nsAtomicRefcnt.h, r=jlebar
--HG--
extra : rebase_source : ce24ab345baa48104328e3c101b7266a31e81870
2013-07-11 15:21:45 -05:00
Benoit Girard
042e2c83ad Bug 851611 - Part 3: Rename headers. r=jrmuizel
--HG--
rename : tools/profiler/sampler.h => tools/profiler/GeckoProfiler.h
rename : tools/profiler/sps_sampler.h => tools/profiler/GeckoProfilerImpl.h
extra : rebase_source : 6ea7c660764a4390cdd8dd91561fff1d7bad6035
2013-03-18 15:25:50 +01:00
Benoit Girard
c47f308258 Bug 851611 - Part 2: Update profiler calls. r=jrmuizel
--HG--
extra : rebase_source : f76accc3d3dd86c75cb3e9750734f23ec9c29941
2013-03-16 00:47:02 -04:00