Closed
Bug 795136
Opened 12 years ago
Closed 12 years ago
DOM API glue for the network indication API
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
People
(Reporter: mounir, Assigned: mounir)
References
Details
(Keywords: feature, Whiteboard: [LOE:S][WebAPI:])
Attachments
(3 files, 1 obsolete file)
2.78 KB,
patch
|
sicking
:
review+
|
Details | Diff | Splinter Review |
21.18 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
145 bytes,
patch
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #777445 +++
This bug will take care of writing the DOM glue on top of bug 777445.
Assignee | ||
Updated•12 years ago
|
Whiteboard: [LOE:L][WebAPI:P] → [LOE:L][WebAPI:]
Assignee | ||
Updated•12 years ago
|
Whiteboard: [LOE:L][WebAPI:] → [LOE:S][WebAPI:]
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #665893 -
Flags: superreview?(jonas)
Attachment #665893 -
Flags: review?(bugs)
Assignee | ||
Comment 2•12 years ago
|
||
More work will have to be done when bug 758269 will land.
Attachment #665898 -
Flags: review?(jonas)
Assignee | ||
Updated•12 years ago
|
Whiteboard: [LOE:S][WebAPI:] → [LOE:S][WebAPI:][needs review]
Comment on attachment 665893 [details] [diff] [review]
Part 1 - New API without permission checks
Review of attachment 665893 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/base/nsGlobalWindow.cpp
@@ +9049,5 @@
> + bool dummy;
> + return DispatchEvent(event, &dummy);
> + }
> +
> + if (!nsCRT::strcmp(aTopic, NS_NETWORK_ACTIVITY_BLIP_DOWNLOAD_TOPIC)) {
Nit: I would probably have merged these two if-branches and branched the first InitEvent argument. Up to you though.
Attachment #665893 -
Flags: superreview?(jonas) → superreview+
Attachment #665898 -
Flags: review?(jonas) → review+
Comment 4•12 years ago
|
||
Comment on attachment 665893 [details] [diff] [review]
Part 1 - New API without permission checks
All the code should be inside some
#ifdef B2G.
We must not expose these onfoo handlers on desktop FF.
(I wonder if you need a new interface to add onfoo handlers to window)
>+void
>+nsGlobalWindow::EnableNetworkEvent(uint32_t aType)
>+{
>+ nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
>+ if (!os) {
>+ NS_ERROR("ObserverService should be available!");
>+ return;
>+ }
>+
>+ switch (aType) {
>+ case NS_NETWORK_UPLOAD_EVENT:
>+ os->AddObserver(mObserver, NS_NETWORK_ACTIVITY_BLIP_UPLOAD_TOPIC, false);
>+ break;
>+ case NS_NETWORK_DOWNLOAD_EVENT:
>+ os->AddObserver(mObserver, NS_NETWORK_ACTIVITY_BLIP_DOWNLOAD_TOPIC, false);
>+ break;
>+ }
>+}
I think you want to pass true here in both cases as the last parameter, so that observer service doesn't
end up keeping window alive.
Attachment #665893 -
Flags: review?(bugs) → review+
Actually, given that bug 758269 has landed now. Can you add the new permission to PermissionsTable.jsm rather than just permissions.txt. The permission should be ALLOW_ACTION for certified and DENY_ACTION for everything else.
Comment 6•12 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #4)
Ah, mObserver is passed to AddObserver. Then one needs to call RemoveObserver
Assignee | ||
Comment 7•12 years ago
|
||
Updated patch that prevent an assert (see bug 795703) and run-time leak.
Attachment #665893 -
Attachment is obsolete: true
Attachment #666317 -
Flags: review?(bugs)
Updated•12 years ago
|
Attachment #666317 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 8•12 years ago
|
||
Unfortunately, because of bug 795711, tests can't work. I forgot about that because I had a workaround locally to be able to work on the patch.
Attachment #666325 -
Flags: review?(bzbarsky)
Assignee | ||
Updated•12 years ago
|
Attachment #666325 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 9•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/37a2a580d614
https://hg.mozilla.org/integration/mozilla-inbound/rev/789babb33800
https://hg.mozilla.org/integration/mozilla-inbound/rev/1b627472f76c
Flags: in-testsuite+
Whiteboard: [LOE:S][WebAPI:][needs review] → [LOE:S][WebAPI:]
Target Milestone: --- → mozilla18
Comment 10•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/37a2a580d614
https://hg.mozilla.org/mozilla-central/rev/789babb33800
https://hg.mozilla.org/mozilla-central/rev/1b627472f76c
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
Updated•11 months ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•