Closed Bug 1360603 Opened 7 years ago Closed 7 years ago

Mark Save as... channels used for download as throttleable

Categories

(Toolkit :: Downloads API, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox57 --- fixed
firefox58 --- fixed

People

(Reporter: mayhemer, Assigned: amchung)

References

Details

Attachments

(2 files, 5 obsolete files)

(In reply to :Paolo Amadini from comment #12)
> It seems to me that downloads started via nsIWebBrowserPersist are still not
> throttled. These may include downloads started by "Save Page As" or "Save
> Link As".
Blocks: 1362071
No longer blocks: CDP
Fairly easy and is a win.
Priority: P2 → P1
Assignee: nobody → amchung
Hi Nick,
I had set the class flags as throttleable when using save channel.
Would you help me to review my patch?

Thanks!
Attachment #8904930 - Flags: review?(hurley)
Comment on attachment 8904930 [details] [diff] [review]
implementation -- Marked the save channel as throttleable.

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

This looks generally reasonable to me, but I don't know nsWebBrowserPersist at all. You need to have a dom peer review this.

::: dom/webbrowserpersist/nsWebBrowserPersist.cpp
@@ +1526,5 @@
>      // Add the output transport to the output map with the channel as the key
>      nsCOMPtr<nsISupports> keyPtr = do_QueryInterface(aChannel);
>      mOutputMap.Put(keyPtr, new OutputData(aFile, mURI, aCalcFileExt));
>  
> +    // Remove throttleable when save channel which finishs the saving work.

"Remove throttleable flag when the save channel finishes"
Attachment #8904930 - Flags: review?(hurley) → feedback+
Hi Nathan,
I had set the class flags as throttleable when using save channel.
Would you help me to review my patch?

Thanks!
Attachment #8904930 - Attachment is obsolete: true
Attachment #8906934 - Flags: review?(nfroyd)
Comment on attachment 8906934 [details] [diff] [review]
implementation -- Marked the save channel as throttleable.

Hi Ehsan,
I had set the class flags as throttleable when using save channel.
Would you help me to review my patch?

Thanks!
Attachment #8906934 - Flags: review?(nfroyd) → review?(ehsan)
Comment on attachment 8906934 [details] [diff] [review]
implementation -- Marked the save channel as throttleable.

Hi Bobby,
I had set the class flags as throttleable when using save channel.
Would you help me to review my patch?

Thanks!
Attachment #8906934 - Flags: review?(ehsan) → review?(bobbyholley)
Comment on attachment 8906934 [details] [diff] [review]
implementation -- Marked the save channel as throttleable.

I don't know this code and don't have cycles to dig into it right now - sorry about that.
Attachment #8906934 - Flags: review?(bobbyholley)
Comment on attachment 8906934 [details] [diff] [review]
implementation -- Marked the save channel as throttleable.

Hi Baku,
I had set the class flags as throttleable when using save channel.
Would you help me to review my patch?

Thanks!
Attachment #8906934 - Flags: review?(amarchesini)
Attachment #8906934 - Flags: review?(amarchesini) → review+
Comment on attachment 8906934 [details] [diff] [review]
implementation -- Marked the save channel as throttleable.

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

mayhemer do you have time to take a look at this ClearClassFlags()?

::: dom/webbrowserpersist/nsWebBrowserPersist.cpp
@@ +1498,5 @@
>          return StartUpload(bufferedInputStream, aFile, contentType);
>      }
>  
> +    // Mark save channel as throttleable.
> +    nsCOMPtr<nsIClassOfService> cos(do_QueryInterface(aChannel));

if (cos) { ...

@@ +1527,5 @@
>      nsCOMPtr<nsISupports> keyPtr = do_QueryInterface(aChannel);
>      mOutputMap.Put(keyPtr, new OutputData(aFile, mURI, aCalcFileExt));
>  
> +    // Remove throttleable flag when the save channel finishes.
> +    cos->ClearClassFlags(nsIClassOfService::Throttleable);

Why clearing this flag here? The operation is async.
Attachment #8906934 - Flags: review+ → review-
Hi Baku,
I have modified the patch as below:
1. Added a confirmation for verifying cos is null or not.
2. Removed the removing throttleable flag.

Would you help me to review this patch?
Thanks!
Attachment #8906934 - Attachment is obsolete: true
Attachment #8908467 - Flags: review?(amarchesini)
Target Milestone: --- → mozilla57
Status: NEW → ASSIGNED
Attachment #8908467 - Flags: review?(amarchesini) → review+
Comment on attachment 8908467 [details] [diff] [review]
implementation -- Marked the save channel as throttleable.

This patch looks fine, thanks!
Hi Baku,
I have finished the test case, and I found browser_saveImageURL.js which is the better test case to confirm throttleable flag.
Would you help me to review my patch?

Thanks!
Attachment #8909932 - Flags: review?(amarchesini)
Attachment #8909932 - Flags: review?(amarchesini) → review+
This seems ready to land, please also request 57 approval (beta), thanks!
Attachment #8908467 - Attachment is obsolete: true
Attachment #8911490 - Flags: review+
Attachment #8911490 - Attachment is obsolete: true
Attachment #8911497 - Flags: review+
Comment on attachment 8911497 [details] [diff] [review]
implementation -- Marked the save channel as throttleable.

Approval Request Comment
[Feature/Bug causing the regression]:unknown
[User impact if declined]:unknown
[Is this code covered by automated tests?]:no
[Has the fix been verified in Nightly?]:no
[Needs manual test from QE? If yes, steps to reproduce]:unknown
[List of other uplifts needed for the feature/fix]:none
[Is the change risky?]:no
[Why is the change risky/not risky?]:Added a throttleable flags in saving channel.
[String changes made/needed]:none
Attachment #8911497 - Flags: approval-mozilla-beta?
Comment on attachment 8911498 [details] [diff] [review]
test case -- Confirmed the Throttleable flag on browser_saveImageURL.js

Approval Request Comment
[Feature/Bug causing the regression]:unknown
[User impact if declined]:unknown
[Is this code covered by automated tests?]:no
[Has the fix been verified in Nightly?]:no
[Needs manual test from QE? If yes, steps to reproduce]: unknown
[List of other uplifts needed for the feature/fix]:none
[Is the change risky?]:no
[Why is the change risky/not risky?]: Modified the test case for confirming throttleable flag on browser_saveImageURL.js
[String changes made/needed]:none
Attachment #8911498 - Flags: approval-mozilla-beta?
Target Milestone: mozilla57 → ---
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d409c2ac7d88
Mark the save channel as throttleable. r=baku
https://hg.mozilla.org/integration/mozilla-inbound/rev/6d7610f4d26d
Confirm the Throttleable flag on browser_saveImageURL.js. r=baku
Keywords: checkin-needed
> [Feature/Bug causing the regression]:unknown
> [User impact if declined]:unknown
> [Needs manual test from QE? If yes, steps to reproduce]:unknown

Could you please be a bit more explicit here?
We need these information to make a call if it is worth taking the risk to uplift that to beta.
Thanks
Flags: needinfo?(amchung)
Hi,
(In reply to Sylvestre Ledru [:sylvestre] from comment #23)
> > [Feature/Bug causing the regression]:none
This bug is similar to Bug 1348062, the patches of bug 1348062 seems not to occur the regression bugs.
> > [User impact if declined]:none
> > [Needs manual test from QE? If yes, steps to reproduce]:none
The behavior of this patch is set throttleable flags when user uses "save as.." function, can't use manual test to verify the effect.
> Could you please be a bit more explicit here?
> We need these information to make a call if it is worth taking the risk to
> uplift that to beta.
> Thanks
Flags: needinfo?(amchung)
Comment on attachment 8911498 [details] [diff] [review]
test case -- Confirmed the Throttleable flag on browser_saveImageURL.js

OK, thanks. Let's take it then!
Should be in 57b4 (gtb tomorrow Thursday)
Attachment #8911498 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #8911497 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: