Closed Bug 905325 Opened 11 years ago Closed 11 years ago

about:networking - make refreshing feature only request data for active tab

Categories

(Core :: Networking, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: robertbindar, Assigned: robertbindar)

References

Details

(Whiteboard: [engineering-friend])

Attachments

(1 file, 3 obsolete files)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0 (Beta/Release)
Build ID: 20130627161625

Steps to reproduce:

We should refresh data only for the active tab. Now refreshing feature requests data for all the tabs, not just for the active one causing a lack of performance.
Attached patch refresh_active_tab.patch (obsolete) — Splinter Review
Attachment #791738 - Flags: review?(valentin.gosu)
As we discussed today, maybe it's better if the Refresh button refreshes all of the tabs, while the auto-refresh checkbox only refreshes the current tab.
The reason being that when you use the refresh button, you might probably want to get a "snapshot" of the current state.
Attached patch independent refresh v2 (obsolete) — Splinter Review
Refresh button produces an overall refresh and auto-refresh checkbox only refresh the active tab.
Attachment #791738 - Attachment is obsolete: true
Attachment #791738 - Flags: review?(valentin.gosu)
Attachment #793588 - Flags: review?(ttaubert)
Comment on attachment 793588 [details] [diff] [review]
independent refresh v2

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

::: toolkit/content/aboutNetworking.js
@@ +131,5 @@
>      document.getElementById("confpref").addEventListener("click", confirm);
>    }
>  
> +  for (let id in gRequestNetworkingData)
> +    requestNetworkingData(id);

This is used in the click handler as well and could be moved to a separate function like refreshAllNetworkingData() or the like. Maybe you could also name it requestAllNetworkingData() and rename the existing function to requestNetworkingDataForTab().

@@ +151,5 @@
>    let refr = document.getElementById("refreshButton");
> +  refr.addEventListener("click", function() {
> +    for (let id in gRequestNetworkingData)
> +      requestNetworkingData(id);
> +  });

refr.addEventListener("click", requestAllNetworkingData);

@@ +187,5 @@
> +  if (autoRefresh.checked) {
> +    clearInterval(autoRefresh.interval);
> +    autoRefresh.interval = setInterval(function() {
> +      requestNetworkingData(button.value);
> +    }, REFRESH_INTERVAL_MS);

This too should be moved to a separate function as it just repeats the code from above.
Attachment #793588 - Flags: review?(ttaubert) → feedback+
Assignee: nobody → robertbindar
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
OS: Linux → All
Hardware: x86_64 → All
Version: 22 Branch → Trunk
Attached patch independent refresh v3 (obsolete) — Splinter Review
Attachment #793588 - Attachment is obsolete: true
Attachment #793966 - Flags: review?(ttaubert)
Blocks: 905178
Depends on: 898237
Blocks: 898237
No longer depends on: 898237
Blocks: 907050
Whiteboard: [engineering-friend]
Comment on attachment 793966 [details] [diff] [review]
independent refresh v3

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

r=me with the two minor issues addressed.

::: toolkit/content/aboutNetworking.js
@@ +140,2 @@
>  
>    document.getElementById("autorefcheck").addEventListener("click", function() {

When initializing, we should check for checkbox.checked. When reloading the page with F5 after clicking the checkbox, it will actually stay checked on the next page load and we should set the interval right at the start.

@@ +191,5 @@
> +function setAutoRefreshInterval(checkBox) {
> +    let active_tab = document.querySelector(".active");
> +    checkBox.interval = setInterval(function() {
> +      requestNetworkingDataForTab(active_tab.id);
> +    }, REFRESH_INTERVAL_MS);

Indentation is a little off here.
Attachment #793966 - Flags: review?(ttaubert) → review+
Attachment #793966 - Attachment is obsolete: true
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/dac79403a822
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
No longer blocks: 905178
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: