Bug 1299390 - part 3: Remove BrowserElement methods required by BrowserElementAudioChannel only. r=alwu,baku

MozReview-Commit-ID: LAyGMvmmZpz

--HG--
extra : rebase_source : 29d72475fcc809a3e5d1f6f74a8fc3d703987457
This commit is contained in:
btian 2017-05-18 09:31:00 +08:00
parent eb73e59657
commit 03466ff5ab
6 changed files with 0 additions and 174 deletions

View File

@ -292,11 +292,6 @@ BrowserElementChild.prototype = {
"send-touch-event": this._recvSendTouchEvent,
"get-can-go-back": this._recvCanGoBack,
"get-can-go-forward": this._recvCanGoForward,
"mute": this._recvMute,
"unmute": this._recvUnmute,
"get-muted": this._recvGetMuted,
"set-volume": this._recvSetVolume,
"get-volume": this._recvGetVolume,
"go-back": this._recvGoBack,
"go-forward": this._recvGoForward,
"reload": this._recvReload,
@ -1310,32 +1305,6 @@ BrowserElementChild.prototype = {
});
},
_recvMute: function(data) {
this._windowUtils.audioMuted = true;
},
_recvUnmute: function(data) {
this._windowUtils.audioMuted = false;
},
_recvGetMuted: function(data) {
sendAsyncMsg('got-muted', {
id: data.json.id,
successRv: this._windowUtils.audioMuted
});
},
_recvSetVolume: function(data) {
this._windowUtils.audioVolume = data.json.volume;
},
_recvGetVolume: function(data) {
sendAsyncMsg('got-volume', {
id: data.json.id,
successRv: this._windowUtils.audioVolume
});
},
_recvGoBack: function(data) {
try {
docShell.QueryInterface(Ci.nsIWebNavigation).goBack();

View File

@ -168,8 +168,6 @@ BrowserElementParent.prototype = {
"got-contentdimensions": this._gotDOMRequestResult,
"got-can-go-back": this._gotDOMRequestResult,
"got-can-go-forward": this._gotDOMRequestResult,
"got-muted": this._gotDOMRequestResult,
"got-volume": this._gotDOMRequestResult,
"requested-dom-fullscreen": this._requestedDOMFullscreen,
"fullscreen-origin-change": this._fullscreenOriginChange,
"exit-dom-fullscreen": this._exitDomFullscreen,
@ -624,22 +622,6 @@ BrowserElementParent.prototype = {
return this._sendAsyncMsg('clear-match');
}),
mute: defineNoReturnMethod(function() {
this._sendAsyncMsg('mute');
}),
unmute: defineNoReturnMethod(function() {
this._sendAsyncMsg('unmute');
}),
getMuted: defineDOMRequestMethod('get-muted'),
getVolume: defineDOMRequestMethod('get-volume'),
setVolume: defineNoReturnMethod(function(volume) {
this._sendAsyncMsg('set-volume', {volume});
}),
goBack: defineNoReturnMethod(function() {
this._sendAsyncMsg('go-back');
}),

View File

@ -82,13 +82,6 @@ interface nsIBrowserElementAPI : nsISupports
void findNext(in long direction);
void clearMatch();
void mute();
void unmute();
nsIDOMDOMRequest getMuted();
void setVolume(in float volume);
nsIDOMDOMRequest getVolume();
void addNextPaintListener(in nsIBrowserElementNextPaintListener listener);
void removeNextPaintListener(in nsIBrowserElementNextPaintListener listener);

View File

@ -454,74 +454,6 @@ nsBrowserElement::RemoveNextPaintListener(BrowserElementNextPaintEventCallback&
}
}
already_AddRefed<DOMRequest>
nsBrowserElement::GetMuted(ErrorResult& aRv)
{
NS_ENSURE_TRUE(IsBrowserElementOrThrow(aRv), nullptr);
nsCOMPtr<nsIDOMDOMRequest> req;
nsresult rv = mBrowserElementAPI->GetMuted(getter_AddRefs(req));
if (NS_WARN_IF(NS_FAILED(rv))) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return nullptr;
}
return req.forget().downcast<DOMRequest>();
}
void
nsBrowserElement::Mute(ErrorResult& aRv)
{
NS_ENSURE_TRUE_VOID(IsBrowserElementOrThrow(aRv));
nsresult rv = mBrowserElementAPI->Mute();
if (NS_WARN_IF(NS_FAILED(rv))) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
}
}
void
nsBrowserElement::Unmute(ErrorResult& aRv)
{
NS_ENSURE_TRUE_VOID(IsBrowserElementOrThrow(aRv));
nsresult rv = mBrowserElementAPI->Unmute();
if (NS_WARN_IF(NS_FAILED(rv))) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
}
}
already_AddRefed<DOMRequest>
nsBrowserElement::GetVolume(ErrorResult& aRv)
{
NS_ENSURE_TRUE(IsBrowserElementOrThrow(aRv), nullptr);
nsCOMPtr<nsIDOMDOMRequest> req;
nsresult rv = mBrowserElementAPI->GetVolume(getter_AddRefs(req));
if (NS_WARN_IF(NS_FAILED(rv))) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return nullptr;
}
return req.forget().downcast<DOMRequest>();
}
void
nsBrowserElement::SetVolume(float aVolume, ErrorResult& aRv)
{
NS_ENSURE_TRUE_VOID(IsBrowserElementOrThrow(aRv));
nsresult rv = mBrowserElementAPI->SetVolume(aVolume);
if (NS_WARN_IF(NS_FAILED(rv))) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
}
}
already_AddRefed<DOMRequest>
nsBrowserElement::ExecuteScript(const nsAString& aScript,
const BrowserElementExecuteScriptOptions& aOptions,

View File

@ -71,13 +71,6 @@ public:
already_AddRefed<dom::DOMRequest> PurgeHistory(ErrorResult& aRv);
void Mute(ErrorResult& aRv);
void Unmute(ErrorResult& aRv);
already_AddRefed<dom::DOMRequest> GetMuted(ErrorResult& aRv);
void SetVolume(float aVolume , ErrorResult& aRv);
already_AddRefed<dom::DOMRequest> GetVolume(ErrorResult& aRv);
already_AddRefed<dom::DOMRequest>
GetScreenshot(uint32_t aWidth,
uint32_t aHeight,

View File

@ -171,46 +171,3 @@ interface BrowserElementPrivileged {
DOMRequest getWebManifest();
};
// Bits needed for BrowserElementAudioChannel.
partial interface BrowserElementPrivileged {
/**
* Mutes all audio in this browser.
*/
[Throws,
Pref="dom.mozBrowserFramesEnabled",
ChromeOnly]
void mute();
/**
* Unmutes all audio in this browser.
*/
[Throws,
Pref="dom.mozBrowserFramesEnabled",
ChromeOnly]
void unmute();
/**
* Obtains whether or not the browser is muted.
*/
[Throws,
Pref="dom.mozBrowserFramesEnabled",
ChromeOnly]
DOMRequest getMuted();
/**
* Sets the volume for the browser.
*/
[Throws,
Pref="dom.mozBrowserFramesEnabled",
ChromeOnly]
void setVolume(float volume);
/**
* Gets the volume for the browser.
*/
[Throws,
Pref="dom.mozBrowserFramesEnabled",
ChromeOnly]
DOMRequest getVolume();
};