Closed Bug 1543943 Opened 5 years ago Closed 5 years ago

Port Bug 1543564 part 3. Remove use of nsPIDOMWindowOuter::GetOuterWindow()

Categories

(MailNews Core :: General, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jorgk-bmo, Assigned: jorgk-bmo)

Details

Attachments

(1 file)

This should do it.

Attachment #9057825 - Flags: review?(bzbarsky)
Summary: Port Bug 1543564 part 3. Get rid of pointless nsPIDOMWindowOuter::GetOuterWindow method → Port Bug 1543564 part 3. Remove use of nsPIDOMWindowOuter::GetOuterWindow()

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/cd367a28aeb9
Port bug 1543564, part 3: Remove use of nsPIDOMWindowOuter::GetOuterWindow(). rs=bustage-fix DONTBUILD

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Comment on attachment 9057825 [details] [diff] [review]
1543943-GetOuterWindow.patch

r=me, but this is leaving some unneeded NS_ENSURE_ARG_POINTER bits around, right?
Attachment #9057825 - Flags: review?(bzbarsky) → review+

I asked myself that question. The code pattern is this:

1    nsCOMPtr<nsPIDOMWindowOuter> parentWindow = nsPIDOMWindowOuter::From(domWindow);
2 -  parentWindow = parentWindow->GetOuterWindow();
3    NS_ENSURE_ARG_POINTER(parentWindow);

So surely, after line 1 `parentWindow` was never null, otherwise line 2 would have crashed. If the behaviour of line 1 hasn't changed, then line 3 can go after line 2 is gone. I left them in for now, since they don't hurt.

I'm not really familiar with what's going on here, so if your suggestion is to remove the checks, I'll remove them. Please let me know.
Flags: needinfo?(bzbarsky)

So surely, after line 1 parentWindow was never null

Correct.

then line 3 can go after line 2 is gone

Yep. Removing them makes the code clearer and a tiny bit faster...

Flags: needinfo?(bzbarsky)
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/e1c03b7fdd86
Follow-up: Remove needless null checks as suggested by :bz. r=me
Type: defect → task
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: