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

125 Коммитов

Автор SHA1 Сообщение Дата
Alastor Wu b8547c32fd Bug 1577890 - part10 : remove unused function 'ShouldBlockMedia()'. r=baku
No one is using these function, so we can remove it.

Differential Revision: https://phabricator.services.mozilla.com/D65266

--HG--
extra : moz-landing-system : lando
2020-03-05 06:18:00 +00:00
Alastor Wu 1aded2bb3d Bug 1577890 - part9 : remove unused suspend types. r=baku
We won't need these suspend states anymore which were used for media control and audio focus on Fennec.

Differential Revision: https://phabricator.services.mozilla.com/D65265

--HG--
extra : moz-landing-system : lando
2020-03-05 06:17:41 +00:00
Gabriele Svelto ace6d1063f Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442

--HG--
extra : moz-landing-system : lando
2019-12-06 09:24:56 +00:00
Dorel Luca a381d5c96d Backed out changeset f6e53d1c6518 (bug 1600545) for Android build bustage. CLOSED TREE 2019-12-04 17:32:27 +02:00
Gabriele Svelto bc9290f767 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442

--HG--
extra : moz-landing-system : lando
2019-12-04 15:01:19 +00:00
Gabriele Svelto 10d41866a5 Bug 1585156 - Remove useless inclusions of nsIDOMWindow.h and nsIDOMWindowUtils.h r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D47678

--HG--
extra : moz-landing-system : lando
2019-09-30 22:06:47 +00:00
alwu 6b7faa2225 Bug 1580659 - part7 : make AudioChannelAgent's 'WindowVolumeChanged()' consistent with other 'WindowXXXChanged()'. r=Ehsan
Now other `WindowXXXChanged()` would receive the change directly from their input parameter, we should make `WindowVolumeChanged()` consistent with them, instead of asking `AudioChannelService` again.

Differential Revision: https://phabricator.services.mozilla.com/D45754

--HG--
extra : moz-landing-system : lando
2019-09-24 06:55:35 +00:00
alwu e3fa191af4 Bug 1580659 - part6 : remove input config parameter from 'NotifyStartedPlaying()'. r=Ehsan
After applying patch4, now we would pull the change from `AudioChannelService` everytime after starting the agent, so we don't need to rely on letting `NotifyStartedPlaying()` to modify the config and use it to update our state.

Differential Revision: https://phabricator.services.mozilla.com/D45753

--HG--
extra : moz-landing-system : lando
2019-09-24 21:18:07 +00:00
Alastor Wu 330adf4d9e Bug 1580659 - part5 : stop audio capturing explicitly. r=chunmin,karlt
As we start audio capturing explicitly, we should also take responsibility to stop audio capturing when we don't need it.

We were hiding too many details on `AudioChannelAgent` before, which allow us hard to know who and where we handle audio capturing.

Differential Revision: https://phabricator.services.mozilla.com/D45752

--HG--
extra : moz-landing-system : lando
2019-09-24 06:55:39 +00:00
alwu d158e0c4b2 Bug 1580659 - part4 : pulling the intial update after starting AudioChannelAgent. r=chunmin
Instead of calling those callback functions seperately, we could provide a function to pull those changes at once after starting the agent.

In addition, `WindowXXXChanged` are callback functions of `nsIAudioChannelAgentCallback`, so they should only be called by `AudioChannelAgent`, to indicate receiving the change from `AudioChannelService`. We should not call them directly.

Differential Revision: https://phabricator.services.mozilla.com/D45751

--HG--
extra : moz-landing-system : lando
2019-09-24 21:17:59 +00:00
Alastor Wu 5d31bee21f Bug 1580659 - part3 : call 'WindowAudioCaptureChanged()' explicitly. r=chunmin,karlt
Previously `AudioChannelService` called `WindowAudioCaptureChanged()` implicitly whenever we added the agent to the service [1], which made the audio capturing callback happen before finishing registration.

There are two drawbacks,
(1) it's hard to be aware of that the audio capturing callback would be called before finishing `AudioChannelAgent::NotifyStartedPlaying()` [2], which causes unclear call flow.

(2) If someone checks `AudioChannelAgent::IsPlayingStarted()` [3] inside audio capturing callback, then we would find that the `mIsRegToService` is false even if we have registered the agent to `AudioChannelService` because `mIsRegToService` is updated in the last line in the `AudioChannelAgent::NotifyStartedPlaying()`, but the audio capturing callback could be executed before that.

[1] https://searchfox.org/mozilla-central/rev/a777ff11b6d700a698c61e5bd17e73b044304494/dom/audiochannel/AudioChannelService.cpp#723
[2] https://searchfox.org/mozilla-central/rev/a777ff11b6d700a698c61e5bd17e73b044304494/dom/audiochannel/AudioChannelAgent.cpp#144
[3] https://searchfox.org/mozilla-central/rev/a777ff11b6d700a698c61e5bd17e73b044304494/dom/audiochannel/AudioChannelAgent.cpp#285

Differential Revision: https://phabricator.services.mozilla.com/D45750

--HG--
extra : moz-landing-system : lando
2019-09-24 06:55:43 +00:00
shindli bfa22f415b Backed out 9 changesets (bug 1580659) for causing linting failure in /builds/worker/checkouts/gecko/dom/plugins/base/nsNPAPIPluginInstance.cpp CLOSED TREE
Backed out changeset b8c46aaec410 (bug 1580659)
Backed out changeset fd31977767d5 (bug 1580659)
Backed out changeset 8b9f61694270 (bug 1580659)
Backed out changeset 276827f54c71 (bug 1580659)
Backed out changeset ecb2bf9fb452 (bug 1580659)
Backed out changeset b712f15af619 (bug 1580659)
Backed out changeset c25bfc8b31b1 (bug 1580659)
Backed out changeset 20cfcd96a40e (bug 1580659)
Backed out changeset e92ff4ac7f43 (bug 1580659)
2019-09-24 09:50:42 +03:00
alwu 3aa62361f8 Bug 1580659 - part7 : make AudioChannelAgent's 'WindowVolumeChanged()' consistent with other 'WindowXXXChanged()'. r=Ehsan
Now other `WindowXXXChanged()` would receive the change directly from their input parameter, we should make `WindowVolumeChanged()` consistent with them, instead of asking `AudioChannelService` again.

Differential Revision: https://phabricator.services.mozilla.com/D45754

--HG--
extra : moz-landing-system : lando
2019-09-17 18:59:27 +00:00
Alastor Wu b3e82e167d Bug 1580659 - part6 : remove input config parameter from 'NotifyStartedPlaying()'. r=Ehsan
After applying patch4, now we would pull the change from `AudioChannelService` everytime after starting the agent, so we don't need to rely on letting `NotifyStartedPlaying()` to modify the config and use it to update our state.

Differential Revision: https://phabricator.services.mozilla.com/D45753

--HG--
extra : moz-landing-system : lando
2019-09-18 00:03:14 +00:00
Alastor Wu eaf6b8ef6e Bug 1580659 - part5 : stop audio capturing explicitly. r=chunmin,karlt
As we start audio capturing explicitly, we should also take responsibility to stop audio capturing when we don't need it.

We were hiding too many details on `AudioChannelAgent` before, which allow us hard to know who and where we handle audio capturing.

Differential Revision: https://phabricator.services.mozilla.com/D45752

--HG--
extra : moz-landing-system : lando
2019-09-21 02:21:58 +00:00
Alastor Wu 17d1e17425 Bug 1580659 - part4 : pulling the intial update after starting AudioChannelAgent. r=chunmin
Instead of calling those callback functions seperately, we could provide a function to pull those changes at once after starting the agent.

In addition, `WindowXXXChanged` are callback functions of `nsIAudioChannelAgentCallback`, so they should only be called by `AudioChannelAgent`, to indicate receiving the change from `AudioChannelService`. We should not call them directly.

Differential Revision: https://phabricator.services.mozilla.com/D45751

--HG--
extra : moz-landing-system : lando
2019-09-23 17:44:21 +00:00
Alastor Wu f74da16941 Bug 1580659 - part3 : call 'WindowAudioCaptureChanged()' explicitly. r=chunmin,karlt
Previously `AudioChannelService` called `WindowAudioCaptureChanged()` implicitly whenever we added the agent to the service [1], which made the audio capturing callback happen before finishing registration.

There are two drawbacks,
(1) it's hard to be aware of that the audio capturing callback would be called before finishing `AudioChannelAgent::NotifyStartedPlaying()` [2], which causes unclear call flow.

(2) If someone checks `AudioChannelAgent::IsPlayingStarted()` [3] inside audio capturing callback, then we would find that the `mIsRegToService` is false even if we have registered the agent to `AudioChannelService` because `mIsRegToService` is updated in the last line in the `AudioChannelAgent::NotifyStartedPlaying()`, but the audio capturing callback could be executed before that.

[1] https://searchfox.org/mozilla-central/rev/a777ff11b6d700a698c61e5bd17e73b044304494/dom/audiochannel/AudioChannelService.cpp#723
[2] https://searchfox.org/mozilla-central/rev/a777ff11b6d700a698c61e5bd17e73b044304494/dom/audiochannel/AudioChannelAgent.cpp#144
[3] https://searchfox.org/mozilla-central/rev/a777ff11b6d700a698c61e5bd17e73b044304494/dom/audiochannel/AudioChannelAgent.cpp#285

Differential Revision: https://phabricator.services.mozilla.com/D45750

--HG--
extra : moz-landing-system : lando
2019-09-18 21:59:32 +00:00
Kannan Vijayan 3fb6190ec6 Bug 1559414 - Rename unaudited pre-fission methods with SameProcess for future audit burndown. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D39378

--HG--
extra : moz-landing-system : lando
2019-07-26 16:48:31 +00:00
pet_flipper e6f56104fb Bug 1445923 - Removed references of systemAppUrl along with meaningless code. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D26503

--HG--
extra : moz-landing-system : lando
2019-04-09 09:41:19 +00:00
Emilio Cobos Álvarez d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Nika Layzell f1ac9bf744 Bug 1419597 - Part 18: Remove IsInnerWindow and IsOuterWindow methods, r=smaug
MozReview-Commit-ID: DAAm6tLubhJ
2017-11-23 13:12:13 -05:00
Matthew Gregan 526a07e856 Bug 1388236 - Remove B2G-only AudioChannel code from dom/audiochannel. r=alwu 2017-08-10 13:00:09 +12:00
Nicholas Nethercote 72c884bf74 Bug 1384835 (part 3, attempt 2) - Remove the Preferences::Get*CString() variants that return nsAdoptingCString. r=froydnj.
--HG--
extra : rebase_source : d317b25be2ec21d1a60d25da3689e46cdce0b649
2017-07-31 14:28:48 +10:00
Alastor Wu 5ea418e1fe Bug 1347791 - part2 : the tab would always be resumed when it goes to foreground first time. r=baku
Since now we move the block/resume logic to front-end side, we can remove
the changing from bug1319771 and other related bugs which are used to ensure the
pinned tab should be blocked successfully after session restore.

MozReview-Commit-ID: Ixe7tOvCEhv

--HG--
extra : rebase_source : 4214c68b4c95df5c33bf1a68c9ffb84ee4c4d5aa
2017-06-29 04:52:02 -07:00
Carsten "Tomcat" Book b5eb8a2a1b Backed out changeset be04f96bf78b (bug 1347791) 2017-05-17 08:11:09 +02:00
Alastor Wu aae22221f8 Bug 1347791 - part2 : the tab would always be resumed when it goes to foreground first time. r=baku
Since now we move the block/resume logic to front-end side, we can remove
the changing from bug1319771 and other related bugs which are used to ensure the
pinned tab should be blocked successfully after session restore.

MozReview-Commit-ID: Ixe7tOvCEhv

--HG--
extra : rebase_source : 190e63b5df53c85f7282b5c2144ae7e7830d7ad3
2017-05-17 11:56:03 +08:00
Alastor Wu d8197f5d08 Bug 1347758 - part4 : add audio channel log. r=Ehsan
MozReview-Commit-ID: 3zVYtD86O82

--HG--
extra : rebase_source : 3a7726760d6e4941cdbe2e6c9ee7132420482bb4
2017-03-24 14:44:18 +08:00
Iris Hsiao 26a234de5d Backed out 6 changesets (bug 1347758) for eslint failure
Backed out changeset 9becd55242c1 (bug 1347758)
Backed out changeset 2abce19f5001 (bug 1347758)
Backed out changeset 80232d4c85d5 (bug 1347758)
Backed out changeset 1fd084ec34d4 (bug 1347758)
Backed out changeset cafb3c12027b (bug 1347758)
Backed out changeset 85846edfe957 (bug 1347758)
2017-03-24 16:58:08 +08:00
Alastor Wu e81c17d1b2 Bug 1347758 - part4 : add audio channel log. r=Ehsan
MozReview-Commit-ID: LNXzRZx2rC2

--HG--
extra : rebase_source : eef0ad3d65161c422d3cab57e6e081796452bdd1
2017-03-24 12:04:15 +08:00
Alastor Wu b55cdff3c1 Bug 1319771 - part2 : resume foreground window if it was still be blocked. r=baku
In previous patch, we modify the behavior of nsDocument, now it would only resume
window when document has active media components.

However, it causes another issue. If the tab really goes to foreground, but
there is no active media component, the tab would still be blocked and it won't
be resumed anymore.

Therefore, we need to resume it by ourself if the tab is on the foreground but
doesn't be resumed yet.

MozReview-Commit-ID: EdnQ7sRkSJK

--HG--
extra : rebase_source : c2ab932cc3134531e5c49581c5e63b4aabef6ca4
2017-02-03 10:50:07 +08:00
Alastor Wu 9e4d1c7549 Bug 1319771 - part1 : only resume the window when there has active media components. r=baku
For the first pinned tab, it would be set to visible first and then set to
invisible if there exists other tabs after restarting the whole browser.

If the tab is set to visible, we would activate the media component (set the
|mMediaSuspended| in outer window to none-suspend). In this case, the first
pinned tab would be set to visible briefly, but it doesn't mean the tab is in
the foreground, it's just how DOM manage the tab's visibility.

In that moment, none of the media component has been created yet. Therefore, we
would only activate the media component after the audio channel service exists.

MozReview-Commit-ID: 1FgdMq84yWX

--HG--
extra : rebase_source : d5d7568b9f4bfddf2abd0b2c2a4e9391a856882b
2017-02-03 10:48:38 +08:00
Alastor Wu ce4c37a7ff Bug 1320005 - don't show the 'play tab' icon for the media element without audio track. r=baku
MozReview-Commit-ID: K42I0yWaI7N

--HG--
extra : rebase_source : 6b2cd50bb327a644f9092c1e018203854d3d899f
2016-12-13 22:47:13 +08:00
Alastor Wu ace1d4d71b Bug 1315551 - part1 : should pass valid window for agent's initialization. r=baku
MozReview-Commit-ID: 4uh4nU8YVsS

--HG--
extra : rebase_source : 35a7e41e16c0206c773bc67004d2080bb5533b4c
2016-11-08 11:06:04 +08:00
Alastor Wu 45cac62c4c Bug 1302350 - part3 : provide a method to know the media-block-state before connecting to the AudioChannelService r=baku
In order to refactor the blocking mechanism, we want to know the blocking state
before calling notifyStartedPlaying().

MozReview-Commit-ID: 3wa2M7qwUAm

--HG--
extra : rebase_source : d128463b7fd892b966d80d5b5f76537819f35bcf
2016-11-01 17:46:11 +08:00
Alastor Wu c2f555c0fd Bug 1302350 - part2 : provide a method to check whether the agent was started. r=baku
Since the agent is created in beginning in patch1, we need another way to know
whether we have already called notifyStartedPlaying().

MozReview-Commit-ID: 5YNhwEl5Xfp

--HG--
extra : rebase_source : 6a2913e5d81591faf1a7383d9fcb9db2cf3f83d3
2016-11-01 17:46:09 +08:00
Gabriele Svelto 4dfafe74a7 Bug 1284535 - Remove dependencies to the mozApps-related APIs from the audio channel code r=gsvelto
MozReview-Commit-ID: 9XKMKBkvlfR

--HG--
extra : rebase_source : f08a164c052e996c0aad2cd770ff0ba786596d14
2016-04-14 15:19:41 +02:00
Alastor Wu 67612fd54d Bug 1240423 - part7 : add attributes for AudioChannelLog. r=baku
MozReview-Commit-ID: KryRjeqBUDE

--HG--
extra : rebase_source : a8a6bbfdc3314b259e7364405de9842832cc12ec
2016-06-01 10:26:29 +08:00
Alastor Wu 4e4bd18cc6 Bug 1240423 - part2 : introduce audible changing reasons. r=baku
MozReview-Commit-ID: 6V69hOCpyG3

--HG--
extra : rebase_source : 4606710b4b7b72da873a3fb37fec85db89f2e4c0
2016-06-01 10:26:04 +08:00
Alastor Wu 12d3b72c2e Bug 1235612 - Part 2: Notify audible state in NotifyStartedPlaying. r=baku
MozReview-Commit-ID: B1u8FYaX5wd

--HG--
extra : rebase_source : 73db1d40298be67945aa630412b46d49710f7502
2016-05-03 17:59:27 +08:00
Alastor Wu 56716374de Bug 1235612 - Part 1: Implement notify media-playback. r=baku
MozReview-Commit-ID: HAd9FKWcHtl

--HG--
extra : rebase_source : 9ccc4e69c67113785857ec1b8cfc3054ef6c487c
2016-05-03 10:03:02 +08:00
Alastor Wu c8fae1998b Bug 1242874 - part4 : wrap the volume/mute/suspend for notifyStartedPlaying. r=baku
MozReview-Commit-ID: 2FMfEVuODmu

--HG--
extra : rebase_source : 96e49e6e8d074a9bd5d9a7e6a60e7ec01cc88402
2016-05-03 09:52:44 +08:00
Alastor Wu 30466d68e1 Bug 1242874 - part3 : implement different suspended methods. r=baku, r=jwwang
MozReview-Commit-ID: HHYX29gbLwk

--HG--
extra : rebase_source : d774e1338c6e0cd2ce8b4329b28ad9650011a7e5
2016-05-03 09:52:38 +08:00
Carsten "Tomcat" Book b4a55fdcfc Backed out changeset d09b20eeb382 (bug 1242874) 2016-04-28 13:59:04 +02:00
Carsten "Tomcat" Book 0a62793b79 Backed out changeset df13b449ffcc (bug 1242874) 2016-04-28 13:59:02 +02:00
Alastor Wu 4e7da2f687 Bug 1242874 - part4 : wrap the volume/mute/suspend for notifyStartedPlaying. r=baku
MozReview-Commit-ID: GRjxz1E0C9r

--HG--
extra : transplant_source : %88%D7%C7q%3C%8A%98%C0%84k%AF%90%F7%5D%83%CC%BEa%B1%F2
2016-04-28 00:23:48 +08:00
Alastor Wu daaa9802c9 Bug 1242874 - part3 : implement different suspended methods. r=baku, r=jwwang
MozReview-Commit-ID: Co4avRLWGRK

--HG--
extra : transplant_source : b%17%81%60%94_%F1%C2%5D%B1%B3%D5%F3%5C%7D4p%7F%03%EB
2016-04-28 00:23:42 +08:00
Kyle Huey 91efc5a86c Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug 2016-01-30 09:05:36 -08:00
Alastor Wu f0d62419f0 Bug 1228564 - part 2 : check audio capturing when the agent is registered/unregistered. r=baku. 2015-12-24 17:28:45 +08:00
Alastor Wu 6a38526a4d Bug 1228564 - part 1 : revert the changeset of bug 1190040. r=baku. 2015-12-24 17:17:30 +08:00