Closed Bug 843910 Opened 8 years ago Closed 7 years ago

window observer notifications

Categories

(Add-on SDK Graveyard :: General, defect, P2)

x86
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED
mozilla28

People

(Reporter: irakli, Assigned: irakli)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

At the moment nsIWindowWatcher can be used to observe windows being opened /
closed via "domwindowopened" / "domwindowclosed" notifications. 

https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIWindowWatcher#registerNotification%28%29

This is used by everything in SDK to register further event handlers for things that happen in those windows. It would be much better if those notifications were just dispatched on observer service itself.
As a matter of fact it looks like "domwindowopened" and "domwindowclosed" notifications are actually dispatched.
No longer depends on: 843901
I have to say that we still need something for focus events.
So we need observer notifications for:

- focus
- DOMContentLoaded
- load

For all this events we currently just register event listeners.
Assignee: nobody → rFobic
Blake, it turned out that oranges in try were caused by my inexperience with HG.
My last try push is pretty green: https://tbpl.mozilla.org/?tree=Try&rev=58e485f3d9e7
only few known intermediate oranges showed up.
Attached patch Implement tab.browser (obsolete) — Splinter Review
Attachment #8341270 - Flags: review?(dao)
Comment on attachment 8341270 [details] [diff] [review]
Implement tab.browser

Oops wrong bug.
Attachment #8341270 - Attachment is obsolete: true
Attachment #8341270 - Flags: review?(dao)
Comment on attachment 8339180 [details] [diff] [review]
bug-843910.patch

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

I'm fine with this for now. We should probably file a followup for figuring out how to do this correctly for and e10s world, though.

::: content/base/src/nsDocument.cpp
@@ +4653,5 @@
>    }
>  
> +  // Dispatch observer notification to notify observers document is interactive.
> +  nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
> +  nsCOMPtr<nsIPrincipal> principal = GetPrincipal();

Here and below: no need for a nsCOMPtr, you can just do:

nsIPrincipal *principal = GetPrincipal();
Attachment #8339180 - Flags: review?(mrbkap) → review+
Landed & submitted Bug 946971 to figure out how to e10s-ify this.
https://hg.mozilla.org/mozilla-central/rev/c0a30d9af35c
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Depends on: 999341
Depends on: 1261012
You need to log in before you can comment on or make changes to this bug.