author | Amy Chung <amchung@mozilla.com> |
Sun, 24 Sep 2017 00:38:32 +0800 | |
changeset 382632 | d409c2ac7d88b7193e8369aa3359a9368e1135b3 |
parent 382631 | 03dda89f9c5b5a74c4ea78978ca59631a10f438d |
child 382633 | 6d7610f4d26d76878b83b1f2489a96116c2bdf15 |
push id | 95371 |
push user | ryanvm@gmail.com |
push date | Sun, 24 Sep 2017 20:55:14 +0000 |
treeherder | mozilla-inbound@6d7610f4d26d [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | baku |
bugs | 1360603 |
milestone | 58.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/webbrowserpersist/nsWebBrowserPersist.cpp +++ b/dom/webbrowserpersist/nsWebBrowserPersist.cpp @@ -8,16 +8,17 @@ #include "nspr.h" #include "nsIFileStreams.h" // New Necko file streams #include <algorithm> #include "nsAutoPtr.h" #include "nsNetCID.h" #include "nsNetUtil.h" +#include "nsIClassOfService.h" #include "nsIInterfaceRequestorUtils.h" #include "nsILoadContext.h" #include "nsIPrivateBrowsingChannel.h" #include "nsComponentManagerUtils.h" #include "nsIComponentRegistrar.h" #include "nsIStorageStream.h" #include "nsISeekableStream.h" #include "nsIHttpChannel.h" @@ -1492,16 +1493,22 @@ nsresult nsWebBrowserPersist::SaveChanne rv = NS_NewBufferedInputStream(getter_AddRefs(bufferedInputStream), fileInputStream, BUFFERED_OUTPUT_SIZE); NS_ENSURE_SUCCESS(rv, rv); nsAutoCString contentType; aChannel->GetContentType(contentType); return StartUpload(bufferedInputStream, aFile, contentType); } + // Mark save channel as throttleable. + nsCOMPtr<nsIClassOfService> cos(do_QueryInterface(aChannel)); + if (cos) { + cos->AddClassFlags(nsIClassOfService::Throttleable); + } + // Read from the input channel nsresult rv = NS_MaybeOpenChannelUsingAsyncOpen2(aChannel, this); if (rv == NS_ERROR_NO_CONTENT) { // Assume this is a protocol such as mailto: which does not feed out // data and just ignore it. return NS_SUCCESS_DONT_FIXUP; }