Closed Bug 1078365 Opened 10 years ago Closed 10 years ago

"Feedback:LastUrl" should use JS-Java callbacks

Categories

(Firefox for Android Graveyard :: General, defect)

35 Branch
All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 36

People

(Reporter: wesj, Assigned: vivek, Mentored)

References

Details

(Whiteboard: [lang=js][lang=java])

Attachments

(1 file, 1 obsolete file)

"Feedback:LastUrl" in BrowserApp.java is using the old way of sending callbacks. We should upgrade them to the new Messaging.jsm style.
OS: Linux → Android
Hardware: x86_64 → All
See Also: → 1078353
Summary: "Feedback:LastUrl" should use java-js callbacks → "Feedback:LastUrl" should use JS-Java callbacks
Mentor: wjohnston
Whiteboard: [lang=js][lang=java]
vivek, you might be interested in this bug. No pressure, just wanted to let you know this is here :)
Sure, I'll take it
Assignee: nobody → vivekb.balakrishnan
Attached patch 1078365.patch (obsolete) — Splinter Review
A new patch that uses Messaging.jsm callbacks to retrieve LastUrl for feedback form
Attachment #8506289 - Flags: review?(wjohnston)
Comment on attachment 8506289 [details] [diff] [review]
1078365.patch

I can take this review, I'll get to this later today.
Attachment #8506289 - Flags: review?(wjohnston) → review?(margaret.leibovic)
Comment on attachment 8506289 [details] [diff] [review]
1078365.patch

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

Looks good. r+ with one small change to always call sendSuccess in getLastUrl.

::: mobile/android/base/BrowserApp.java
@@ +3147,5 @@
>              @Override
>              public void onPostExecute(String url) {
>                  // Don't bother sending a message if there is no URL.
>                  if (url.length() > 0)
> +                    callback.sendSuccess(url);

If we don't call sendSuccess or sendError, the promise on the other side will never be fulfilled, and under the hood it looks like we'll have an observer in Messaging.jsm that never gets removed. To work around this, I think we should call sendSuccess no matter what. We already check the length of the URL in JS, so we shouldn't need to change the logic there.
Attachment #8506289 - Flags: review?(margaret.leibovic) → review+
Attached patch 1078365.patchSplinter Review
Review nit corrected. Rebased with latest tree
Attachment #8506289 - Attachment is obsolete: true
Attachment #8515235 - Flags: review?(wjohnston)
Comment on attachment 8515235 [details] [diff] [review]
1078365.patch

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

Looks good, thanks!
Attachment #8515235 - Flags: review?(wjohnston) → review+
Keywords: checkin-needed
https://hg.mozilla.org/integration/fx-team/rev/556fa6395bd2
Keywords: checkin-needed
Whiteboard: [lang=js][lang=java] → [lang=js][lang=java][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/556fa6395bd2
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [lang=js][lang=java][fixed-in-fx-team] → [lang=js][lang=java]
Target Milestone: --- → Firefox 36
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: