Skip to content

Commit

Permalink
Bug 1539948, part 2 - Make nsIWebNavigation and nsIWindowlessBrowser …
Browse files Browse the repository at this point in the history
…builtinclass. r=nika,Gijs

These two interfaces contain nostdcall methods, so they should be marked
builtinclass.

There is a JS implementation of nsIWebNavigation in RemoteWebNavigation,
but it appears to never be passed into C++, so it doesn't need to be
made into a "real" implementation of nsIWebNavigation that can be passed
through XPConnect.

Differential Revision: https://phabricator.services.mozilla.com/D98862
  • Loading branch information
amccreight committed Dec 8, 2020
1 parent a072fd3 commit a7c2999
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 5 additions & 1 deletion docshell/base/nsIWebNavigation.idl
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ struct LoadURIOptions;
* It provides methods and attributes to direct an object to navigate to a new
* location, stop or restart an in process load, or determine where the object
* has previously gone.
*
* Even though this is builtinclass, most of the interface is also implemented
* in RemoteWebNavigation, so if this interface changes, the implementation
* there may also need to change.
*/
[scriptable, uuid(3ade79d4-8cb9-4952-b18d-4f9b63ca0d31)]
[scriptable, builtinclass, uuid(3ade79d4-8cb9-4952-b18d-4f9b63ca0d31)]
interface nsIWebNavigation : nsISupports
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ChromeUtils.defineModuleGetter(
"resource://gre/modules/PrivateBrowsingUtils.jsm"
);

// This object implements the JS parts of nsIWebNavigation.
class RemoteWebNavigation {
constructor(aBrowser) {
this._browser = aBrowser;
Expand All @@ -22,7 +23,6 @@ class RemoteWebNavigation {
this._canGoBack = false;
this._canGoForward = false;
this.referringURI = null;
this.wrappedJSObject = this;
}

swapBrowser(aBrowser) {
Expand Down Expand Up @@ -179,8 +179,4 @@ class RemoteWebNavigation {
}
}

RemoteWebNavigation.prototype.QueryInterface = ChromeUtils.generateQI([
"nsIWebNavigation",
]);

var EXPORTED_SYMBOLS = ["RemoteWebNavigation"];
2 changes: 1 addition & 1 deletion xpfe/appshell/nsIWindowlessBrowser.idl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ webidl BrowsingContext;
* A strong reference to this object must be held until the window is
* ready to be destroyed.
*/
[scriptable, uuid(abb46f48-abfc-41bf-aa9a-7feccefcf977)]
[scriptable, builtinclass, uuid(abb46f48-abfc-41bf-aa9a-7feccefcf977)]
interface nsIWindowlessBrowser : nsIWebNavigation
{
/**
Expand Down

0 comments on commit a7c2999

Please sign in to comment.