Closed Bug 868727 Opened 7 years ago Closed 7 years ago

Pass an nsAString to nsGlobalWindow::GetChildWindow

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: Ms2ger, Assigned: Ms2ger)

References

Details

Attachments

(1 file)

Attached patch Patch v1Splinter Review
I don't think we should be using jsids here.
Attachment #745510 - Flags: review?(bzbarsky)
Comment on attachment 745510 [details] [diff] [review]
Patch v1

Could you file a followup bug to make the nsDependentJSString constructor take a Handle<jsid>, perhaps?  Bonus points for fixing it.  ;)

r=me
Attachment #745510 - Flags: review?(bzbarsky) → review+
Depends on: 868765
Comment on attachment 745510 [details] [diff] [review]
Patch v1

>+nsGlobalWindow::GetChildWindow(const nsAString& aName)
>+{
>   nsCOMPtr<nsIDocShellTreeNode> dsn(do_QueryInterface(GetDocShell()));
>   NS_ENSURE_TRUE(dsn, nullptr);
> 
>   nsCOMPtr<nsIDocShellTreeItem> child;
>-  dsn->FindChildWithName(reinterpret_cast<const PRUnichar*>(chars),
>+  dsn->FindChildWithName(PromiseFlatString(aName).get(),
All the callers pass an nsString of some sort, so if you make aName const nsString& you can just call .get() directly.
https://hg.mozilla.org/mozilla-central/rev/c2df00e9434f
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.