Closed
Bug 845051
Opened 11 years ago
Closed 11 years ago
Clean up the BrowserApp/BrowserToolbar onTabChanged handlers
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 22
People
(Reporter: Margaret, Assigned: Margaret)
Details
Attachments
(2 files)
3.72 KB,
patch
|
mfinkle
:
review+
|
Details | Diff | Splinter Review |
6.53 KB,
patch
|
mfinkle
:
review+
|
Details | Diff | Splinter Review |
This first patch gets rid of calls to mMainHandler.post from inside onTabChanged. We don't need these, since onTabChanged is always called from a Runnable passed to mActivity.runOnUiThread. Getting rid of this also gets rid of the need for some helper methods.
Attachment #718084 -
Flags: review?(bnicholson)
Assignee | ||
Comment 1•11 years ago
|
||
This patch gets rid of some indirection and lets us make some BrowserToolbar methods private (also we can get rid of mMainHandler.post calls for the same reason I mentioned above).
Attachment #718086 -
Flags: review?(bnicholson)
Comment 2•11 years ago
|
||
Comment on attachment 718084 [details] [diff] [review] (Part 1) Don't post Runnables to the main thread from onTabChanged, since it's always called on the main thread Add a comment here stating this is called on the main thread: http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/BrowserApp.java#90
Attachment #718084 -
Flags: review?(bnicholson) → review+
Updated•11 years ago
|
Attachment #718086 -
Flags: review?(bnicholson) → review+
Comment 3•11 years ago
|
||
In patch 1, the mMainHandler cannot be removed, for showTabs(). https://bugzilla.mozilla.org/show_bug.cgi?id=834399#c14
Comment 4•11 years ago
|
||
Comment on attachment 718084 [details] [diff] [review] (Part 1) Don't post Runnables to the main thread from onTabChanged, since it's always called on the main thread Review of attachment 718084 [details] [diff] [review]: ----------------------------------------------------------------- ::: mobile/android/base/BrowserApp.java @@ -109,5 @@ > - : TabsPanel.Panel.NORMAL_TABS; > - mMainHandler.post(new Runnable() { > - public void run() { > - if (areTabsShown() && mTabsPanel.getCurrentPanel() != panel) > - showTabs(panel); This is used not to run something on a particular thread, but to delay it so that it does not modify the mTabsChangedListeners array while we are still iterating through the array. For details see bug 834399 comment 14. (If we decide to keep this runnable, we should add a comment explaining it -- sorry for not doing that in my original patch.)
Assignee | ||
Comment 5•11 years ago
|
||
Thanks Sriram and Matt. I updated the patch to keep the mMainHandler code and add a comment above that line. https://hg.mozilla.org/integration/mozilla-inbound/rev/dc4f4e042b3f https://hg.mozilla.org/integration/mozilla-inbound/rev/956f5c456463
Comment 6•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/dc4f4e042b3f https://hg.mozilla.org/mozilla-central/rev/956f5c456463
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 22
Updated•3 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•