Bug 1763364 - [devtools] Remove getTab unused option tabId. r=ochameau,devtools-backward-compat-reviewers,bomsy.

Depends on D143027

Differential Revision: https://phabricator.services.mozilla.com/D143028
This commit is contained in:
Nicolas Chevobbe 2022-04-12 11:59:31 +00:00
parent a07f538d61
commit 51289b0c0b
3 changed files with 6 additions and 23 deletions

View File

@ -290,7 +290,7 @@ exports.RootActor = protocol.ActorClassWithSpec(rootSpec, {
*
* See BrowserTabList.prototype.getTab for the definition of these IDs.
*/
getTab: async function({ browserId, tabId }) {
getTab: async function({ browserId }) {
const tabList = this._parameters.tabList;
if (!tabList) {
throw {
@ -309,7 +309,6 @@ exports.RootActor = protocol.ActorClassWithSpec(rootSpec, {
try {
descriptorActor = await tabList.getTab({
browserId,
tabId,
});
} catch (error) {
if (error.error) {

View File

@ -322,13 +322,13 @@ BrowserTabList.prototype._getActorForBrowser = async function(browser) {
};
/**
* Return the tab descriptor for the tab identified by one of the IDs
* passed as argument.
* Return the tab descriptor :
* - for the tab matching a browserId if one is passed
* - OR the currently selected tab if no browserId is passed.
*
* @param {Number} browserId: use to match any tab (should become the new way to identify any remote tab)
* @param {Number} tabId: used to match tabs in child processes (obsolete, use browserId)
* @param {Number} browserId: use to match any tab
*/
BrowserTabList.prototype.getTab = function({ browserId, tabId }) {
BrowserTabList.prototype.getTab = function({ browserId }) {
if (typeof browserId == "number") {
const browsingContext = BrowsingContext.getCurrentTopByBrowserId(browserId);
if (!browsingContext) {
@ -346,21 +346,6 @@ BrowserTabList.prototype.getTab = function({ browserId, tabId }) {
}
return this._getActorForBrowser(browser);
}
if (typeof tabId == "number") {
// Tabs OOP
for (const browser of this._getBrowsers()) {
if (
browser.frameLoader?.remoteTab &&
browser.frameLoader.remoteTab.tabId === tabId
) {
return this._getActorForBrowser(browser);
}
}
return Promise.reject({
error: "noTab",
message: "Unable to find tab with tabId '" + tabId + "'",
});
}
const topAppWindow = Services.wm.getMostRecentWindow(
DevToolsServer.chromeWindowType

View File

@ -37,7 +37,6 @@ const rootSpecPrototype = {
getTab: {
request: {
browserId: Option(0, "number"),
tabId: Option(0, "number"),
},
response: {
tab: RetVal("tabDescriptor"),