зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1718279 - [devtools] Rename Descriptor::reloadBrowsingContext to reloadDescriptor r=ochameau,devtools-backward-compat-reviewers
Depends on D118851 The initial name no longer represents accurately what happens for webextension descriptors Differential Revision: https://phabricator.services.mozilla.com/D118852
This commit is contained in:
Родитель
281bb4cb1c
Коммит
d0004a2390
|
@ -164,18 +164,20 @@ const ProcessDescriptorActor = ActorClassWithSpec(processDescriptorSpec, {
|
|||
// Supports the Watcher actor. Can be removed as part of Bug 1680280.
|
||||
watcher: true,
|
||||
// ParentProcessTargetActor can be reloaded.
|
||||
supportsReloadBrowsingContext: this.isParent,
|
||||
supportsReloadDescriptor: this.isParent,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
async reloadBrowsingContext({ bypassCache }) {
|
||||
async reloadDescriptor({ bypassCache }) {
|
||||
if (!this.isParent) {
|
||||
throw new Error(
|
||||
"reloadBrowsingContext is not available for content process descriptors"
|
||||
"reloadDescriptor is not available for content process descriptors"
|
||||
);
|
||||
}
|
||||
|
||||
// For parent process debugging, we only reload the current top level
|
||||
// browser window.
|
||||
this._browsingContextTargetActor.browsingContext.reload(
|
||||
bypassCache
|
||||
? Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE
|
||||
|
|
|
@ -63,7 +63,7 @@ const TabDescriptorActor = ActorClassWithSpec(tabDescriptorSpec, {
|
|||
traits: {
|
||||
// Supports the Watcher actor. Can be removed as part of Bug 1680280.
|
||||
watcher: true,
|
||||
supportsReloadBrowsingContext: true,
|
||||
supportsReloadDescriptor: true,
|
||||
},
|
||||
url: this._getUrl(),
|
||||
};
|
||||
|
@ -216,7 +216,7 @@ const TabDescriptorActor = ActorClassWithSpec(tabDescriptorSpec, {
|
|||
return tab?.hasAttribute && tab.hasAttribute("pending");
|
||||
},
|
||||
|
||||
reloadBrowsingContext({ bypassCache }) {
|
||||
reloadDescriptor({ bypassCache }) {
|
||||
if (!this._browser || !this._browser.browsingContext) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ const WebExtensionDescriptorActor = protocol.ActorClassWithSpec(
|
|||
name: this.addon.name,
|
||||
temporarilyInstalled: this.addon.temporarilyInstalled,
|
||||
traits: {
|
||||
supportsReloadBrowsingContext: true,
|
||||
supportsReloadDescriptor: true,
|
||||
},
|
||||
url: this.addon.sourceURI ? this.addon.sourceURI.spec : undefined,
|
||||
warnings: ExtensionParent.DebugUtils.getExtensionManifestWarnings(
|
||||
|
@ -144,13 +144,13 @@ const WebExtensionDescriptorActor = protocol.ActorClassWithSpec(
|
|||
},
|
||||
|
||||
/**
|
||||
* Note that reloadBrowsingContext is the common API name for descriptors
|
||||
* Note that reloadDescriptor is the common API name for descriptors
|
||||
* which support to be reloaded, while WebExtensionDescriptorActor::reload
|
||||
* is a legacy API which is for instance used from web-ext.
|
||||
*
|
||||
* bypassCache has no impact for addon reloads.
|
||||
*/
|
||||
reloadBrowsingContext({ bypassCache }) {
|
||||
reloadDescriptor({ bypassCache }) {
|
||||
return this.reload();
|
||||
},
|
||||
|
||||
|
|
|
@ -1158,7 +1158,7 @@ const browsingContextTargetPrototype = {
|
|||
*
|
||||
* @backward-compat { legacy }
|
||||
* reload is preserved for third party tools. See Bug 1717837.
|
||||
* DevTools should use Descriptor::reloadBrowsingContext instead.
|
||||
* DevTools should use Descriptor::reloadDescriptor instead.
|
||||
*/
|
||||
reload(request) {
|
||||
const force = request?.options?.force;
|
||||
|
|
|
@ -765,7 +765,7 @@ class TargetCommand extends EventEmitter {
|
|||
// @backward-compat { version 91 }
|
||||
// BrowsingContextTargetActor.reload was moved to descriptors.
|
||||
// After release 91 is on the release channel, we can check
|
||||
// this.descriptorFront.traits.supportsReloadBrowsingContext
|
||||
// this.descriptorFront.traits.supportsReloadDescriptor
|
||||
// instead.
|
||||
if (!this.targetFront.isBrowsingContext) {
|
||||
throw new Error(
|
||||
|
@ -791,8 +791,8 @@ class TargetCommand extends EventEmitter {
|
|||
|
||||
// @backward-compat { version 91 }
|
||||
// BrowsingContextTargetActor.reload was moved to descriptors.
|
||||
if (this.descriptorFront.traits.supportsReloadBrowsingContext) {
|
||||
await this.descriptorFront.reloadBrowsingContext({ bypassCache });
|
||||
if (this.descriptorFront.traits.supportsReloadDescriptor) {
|
||||
await this.descriptorFront.reloadDescriptor({ bypassCache });
|
||||
} else {
|
||||
await this._legacyTargetActorReload(bypassCache);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ const processDescriptorSpec = generateActorSpec({
|
|||
request: {},
|
||||
response: RetVal("watcher"),
|
||||
},
|
||||
reloadBrowsingContext: {
|
||||
reloadDescriptor: {
|
||||
request: {
|
||||
bypassCache: Option(0, "boolean"),
|
||||
},
|
||||
|
|
|
@ -29,7 +29,7 @@ const tabDescriptorSpec = generateActorSpec({
|
|||
request: {},
|
||||
response: RetVal("watcher"),
|
||||
},
|
||||
reloadBrowsingContext: {
|
||||
reloadDescriptor: {
|
||||
request: {
|
||||
bypassCache: Option(0, "boolean"),
|
||||
},
|
||||
|
|
|
@ -29,7 +29,7 @@ const webExtensionDescriptorSpec = generateActorSpec({
|
|||
response: { form: RetVal("json") },
|
||||
},
|
||||
|
||||
reloadBrowsingContext: {
|
||||
reloadDescriptor: {
|
||||
request: {
|
||||
bypassCache: Option(0, "boolean"),
|
||||
},
|
||||
|
|
|
@ -42,7 +42,7 @@ types.addDictType("browsingContextTarget.workers", {
|
|||
// DevTools. Remove this comment when version 91 hits release.
|
||||
// @backward-compat { legacy }
|
||||
// reload is preserved for third party tools. See Bug 1717837.
|
||||
// DevTools should use Descriptor::reloadBrowsingContext instead.
|
||||
// DevTools should use Descriptor::reloadDescriptor instead.
|
||||
types.addDictType("browsingContextTarget.reload", {
|
||||
force: "boolean",
|
||||
});
|
||||
|
@ -90,7 +90,7 @@ const browsingContextTargetSpecPrototype = {
|
|||
// DevTools. Remove this comment when version 91 hits release.
|
||||
// @backward-compat { legacy }
|
||||
// reload is preserved for third party tools. See Bug 1717837.
|
||||
// DevTools should use Descriptor::reloadBrowsingContext instead.
|
||||
// DevTools should use Descriptor::reloadDescriptor instead.
|
||||
|
||||
reload: {
|
||||
request: {
|
||||
|
|
Загрузка…
Ссылка в новой задаче