Closed Bug 1431846 Opened 6 years ago Closed 6 years ago

Remove nsIDOMNavigator

Categories

(Core :: DOM: Core & HTML, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

Attachments

(4 files, 1 obsolete file)

It's not needed.
MozReview-Commit-ID: HUUYPLSjWpG
Attachment #8944119 - Flags: review?(nika)
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Also have it return a dom::Navigator.

MozReview-Commit-ID: 5thGopGWIk9
Attachment #8944120 - Flags: review?(nika)
MozReview-Commit-ID: DgZWMcSg0PT
Attachment #8944121 - Flags: review?(nika)
MozReview-Commit-ID: HUUYPLSjWpG
Attachment #8944122 - Flags: review?(nika)
Attachment #8944119 - Attachment is obsolete: true
Attachment #8944119 - Flags: review?(nika)
MozReview-Commit-ID: LSgeY2dM6gv
Attachment #8944146 - Flags: review?(nika)
Priority: -- → P2
Attachment #8944122 - Flags: review?(nika) → review+
Comment on attachment 8944120 [details] [diff] [review]
part 2.  Rename nsPIDOMWindowInner::GetNavigator() to Navigator(), since it never returns null

Review of attachment 8944120 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/base/nsMimeTypeArray.cpp
@@ +176,2 @@
>  
> +  IgnoredErrorResult rv;

Should we explicitly handle this rv value somehow? I would think we should .SuppressException() on it.

::: dom/base/nsPIDOMWindow.h
@@ +589,5 @@
>      return mMarkedCCGeneration;
>    }
>  
>    virtual nsIDOMScreen* GetScreen() = 0;
> +  virtual mozilla::dom::Navigator* Navigator() = 0;

Why not move Navigator() onto the nsPIDOMWindowInner, and avoid the virtual function call alltogether?
Attachment #8944120 - Flags: review?(nika) → review+
Comment on attachment 8944121 [details] [diff] [review]
part 3.  Make nsPIDOMWindowOuter::GetNavigator return dom::Navigator*

Review of attachment 8944121 [details] [diff] [review]:
-----------------------------------------------------------------

::: netwerk/protocol/http/nsHttpHandler.cpp
@@ +2654,5 @@
>      if (!piWindow)
>          return;
>  
> +    RefPtr<dom::Navigator> navigator = piWindow->GetNavigator();
> +    if (!navigator)

maybe add { } blocks around the return statements while you're in here?
Attachment #8944121 - Flags: review?(nika) → review+
Comment on attachment 8944146 [details] [diff] [review]
part 4.  Remove nsIDOMNavigator and nsIMozNavigatorNetwork

Review of attachment 8944146 [details] [diff] [review]:
-----------------------------------------------------------------

beautiful
Attachment #8944146 - Flags: review?(nika) → review+
> Should we explicitly handle this rv value somehow? I would think we should .SuppressException() on it.

IgnoredErrorResult does just that in its destructor.  That's why I'm using it here.

> Why not move Navigator() onto the nsPIDOMWindowInner, and avoid the virtual function call alltogether?

Just didn't think about it.  Done.  ;)

> maybe add { } blocks around the return statements while you're in here?

Necko style doesn't have them...
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9436dd9a1265
part 1.  Kill off unused attributes from nsIDOMNavigator.  r=mystor
https://hg.mozilla.org/integration/mozilla-inbound/rev/0fdeaf0b28ae
part 2.  Rename nsPIDOMWindowInner::GetNavigator() to Navigator(), since it never returns null.  r=mystor
https://hg.mozilla.org/integration/mozilla-inbound/rev/1df5dfc75ebf
part 3.  Make nsPIDOMWindowOuter::GetNavigator return dom::Navigator*.  r=mystor
https://hg.mozilla.org/integration/mozilla-inbound/rev/4ba341846e22
part 4.  Remove nsIDOMNavigator and nsIMozNavigatorNetwork.  r=mystor
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: