Closed Bug 459893 Opened 17 years ago Closed 17 years ago

Geolocation prompt stops working if initializer window is closed

Categories

(Core :: DOM: Geolocation, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: kairo, Assigned: dougt)

References

Details

(Keywords: fixed1.9.1)

Attachments

(3 files, 1 obsolete file)

The geolocation prompt stops working if the window that initialized it is being closed. STR: 1) Call up http://people.mozilla.org/~dougt/geo.html in a current Minefield nightly 2) Acknowledge the notification bar with either exact location or neighborhood and see the test working fine. 3) Open a new window 4) Close the first window 5) Load http://people.mozilla.org/~dougt/geo.html in the new window With those steps, you don't get another notification bar. This is probably related to bug 459413 comment #2, setting a service callback to a window object might just be a bad idea.
the worry here: http://mxr.mozilla.org/mozilla-central/source/browser/base/content/browser.js#915 is that the browser will close, and the service callback that is set on geolocationService.prompt will be gone.
Assignee: nobody → doug.turner
Flags: blocking-firefox3.1?
We should probably set the callback in browserglue somewhere, I guess? We don't want to init the geolocation service earlier than it's needed, though... it would probably cleaner to have the geolocation service get a contract ID via the category manager and instantiate its nsIGeolocationPrompt directly when needed, or something like that. Alternatively we could have it send out a notification when it wants to prompt, and have observers return the nsIGeolocationPrompt via aSubject, though that's hackier.
Neil has hacked up something that loads it on ui startup in bug 459413 (nsSuiteGlue is our version of nsBrowserGlue), but your proposal of only loading it when needed sounds even better to me...
Component: General → Geolocation
Flags: blocking-firefox3.1?
Product: Firefox → Core
QA Contact: general → geolocation
Flags: blocking1.9.1?
Attached patch patch v.1Splinter Review
Attachment #344129 - Flags: superreview?
Attachment #344129 - Flags: review?
Attachment #344129 - Flags: superreview?
Attachment #344129 - Flags: review?(gavin.sharp)
Attachment #344129 - Flags: review?(Olli.Pettay)
Attachment #344129 - Flags: review?
geolocation will just look up a contract id for the nsIGeolocationPrompt and use that.
Blocks: 459413
I just tested the patch (needed some manual help to apply, might also work with higher fuzz settings), and it works fine for the case described in comment #0. I also did test the core changes with a new SeaMonkey patch in bug 459413 and it also works fine there.
Comment on attachment 344129 [details] [diff] [review] patch v.1 You need to fix dom/tests/mochitest/geolocation/geolocation_common.js as well, right? Is there any reason to keep NS_GEOLOCATION_SERVICE_CONTRACTID? It would be nice if you could address Neil's second comment from bug 459413 comment 2.
Attachment #344129 - Flags: review?(gavin.sharp) → review+
gavin, right. I do not need the service contract id now. I was thinking about using it for the extension developers, but for now I can remove it. I will also fix up the mochitest (and figure out why they all pass despite this changeset!)
Attachment #344129 - Flags: review?(Olli.Pettay) → review+
Please add some some documentation that nsIGeolocationPrompt must be implemented, otherwise geolocation API doesn't really work. This is especially needed for embedders. Or file a new bug to make geolocation API somehow useable without prompts. Either way.
pushed 3b47c0e2f6d9.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
reopened due to possible leak.
that last patch included my merge. sorry.
Attached patch without mergeSplinter Review
Attachment #344548 - Attachment is obsolete: true
Comment on attachment 344549 [details] [diff] [review] without merge i am thinking that the way we leak is caused by the way we change the prompt.
This fixes the leak on linux
thanks smaug. wfm. pushed 89c97fd8a881. Lets see how it goes.
removing blocking1.9.1 flag. bz -- this actually landed on 1.9.1 either before we created the 1.9.1 branch or sometime there after. in either case, 1.9.1 _has_ this fix.
Flags: blocking1.9.1?
That doesn't affect the blocking status. If it would block if it were to regress tomorrow, it should be marked blocking. This was discussed at the Gecko meeting on Tuesday.
(restoring flag)
Flags: blocking1.9.1+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: