Closed Bug 999572 Opened 10 years ago Closed 10 years ago

Fix settingsService usage in NetworkGeolocationProvider.js

Categories

(Core :: DOM: Geolocation, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
1.4 S6 (25apr)
blocking-b2g 1.4+
Tracking Status
firefox29 --- wontfix
firefox30 --- wontfix
firefox31 --- fixed
b2g-v1.4 --- fixed
b2g-v2.0 --- fixed

People

(Reporter: gwagner, Assigned: gwagner)

References

Details

(Whiteboard: [systemsfe][qa-])

Attachments

(3 files, 1 obsolete file)

      No description provided.
We are getting
E/GeckoConsole( 1463): [JavaScript Error: "NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISettingsServiceCallback.handle]" {file: "jar:file:///system/b2g/omni.ja!/components/SettingsService.js" line: 121}]
E/GeckoConsole( 1463): [JavaScript Error: "NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED: JavaScript component does not have a method named: "handle"'JavaScript component does not have a method named: "handle"' when calling method: [nsISettingsServiceCallback::handle]" {file: "jar:file:///system/b2g/omni.ja!/components/SettingsService.js" line: 121}]
E/GeckoConsole( 1463): [JavaScript Error: "NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISettingsServiceCallback.handle]" {file: "jar:file:///system/b2g/omni.ja!/components/SettingsService.js" line: 121}]
Assignee: nobody → anygregor
Whiteboard: [systemsfe]
Attached patch 999572.diff (obsolete) — Splinter Review
Target Milestone: --- → 1.4 S6 (25apr)
Blocks: 989692
Attached patch patchSplinter Review
Attachment #8410598 - Attachment is obsolete: true
Attachment #8410646 - Flags: review?(bent.mozilla)
Comment on attachment 8410646 [details] [diff] [review]
patch

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

::: dom/settings/SettingsService.js
@@ +42,5 @@
> +    dump("CaLLHandle with: " + aName + ", " + aValue + "\n");
> +    try {
> +      aCallback ? aCallback.handle(aName, aValue) : null;
> +    } catch (e) {
> +      throw e;

This will just rethrow the exception... I think you want to just ignore it?

::: dom/system/NetworkGeolocationProvider.js
@@ +103,5 @@
>        return;
>  
>      this.started = true;
> +    let settingsCallback = {
> +      handle: function(name, result) {

You probably want a handleError too.

@@ +111,5 @@
>  
>      try {
>        Services.obs.addObserver(this, SETTING_CHANGED_TOPIC, false);
>        let settings = Cc["@mozilla.org/settingsService;1"].getService(Ci.nsISettingsService);
> +      settings.createLock().get(SETTING_DEBUG_ENABLED, settingsCallback);

I probably would have just added a 'handle' and 'handleError' function to this object rather than make a new one, but it doesn't really change anything.
Attachment #8410646 - Flags: review?(bent.mozilla) → review+
Attached file gaia
Attachment #8411187 - Flags: review?(bent.mozilla)
Attachment #8411187 - Flags: review?(bent.mozilla) → review+
Blocks: 1012214
We need this to fix bug 1012214
blocking-b2g: --- → 1.4+
Attached patch patch14Splinter Review
Whiteboard: [systemsfe] → [systemsfe][qa-]
You need to log in before you can comment on or make changes to this bug.