nsITaskbarProgress.setProgressState() method throw 0x80070057 (NS_ERROR_ILLEGAL_VALUE) error when add multiple download items to nsIDownloadManager in Windows 7

UNCONFIRMED
Unassigned

Status

()

Toolkit
Downloads API
P3
normal
UNCONFIRMED
5 years ago
5 years ago

People

(Reporter: Wesley, Unassigned)

Tracking

Trunk
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22

Steps to reproduce:

I am a Firefox addon developer. 
I used the nsIDownloadManager.addDownload() method to add multiple download items. 
The following are the codes:
  var dm = Cc["@mozilla.org/download-manager;1"].getService(Ci.nsIDownloadManager);
  for (var i=0; i<3; i++){
        var nsIWBP = Ci.nsIWebBrowserPersist;
        var persist = Cc["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"].createInstance(nsIWBP);
        persist.persistFlags = nsIWBP.PERSIST_FLAGS_REPLACE_EXISTING_FILES | nsIWBP.PERSIST_FLAGS_FROM_CACHE| nsIWBP.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION;

        // Start download
        var dl = dm.addDownload(dm.DOWNLOAD_TYPE_DOWNLOAD, fromURI, toURI, toFile.leafName, mime, Math.round(Date.now() * 1000), null, persist, false);
        persist.progressListener = dl;
        persist.saveURI(fromURI, cacheKey, null, null, null, toURI, privacyContext);
  }


Actual results:

The following error is present in Error Console
---------------------------------------------------
Error: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsITaskbarProgress.setProgressState]
Source file: resource://gre/modules/DownloadTaskbarProgress.jsm
Line: 238
---------------------------------------------------
This bug only happen in Windows 7.  It don't break any Firefox addon function.



Expected results:

The nsITaskbarProgress.setProgressState() method should support add multiple download items to Download Manager and don't throw 0x80070057 (NS_ERROR_ILLEGAL_VALUE) error.
(Reporter)

Updated

5 years ago
Priority: -- → P3
Wesley, can you add a small testcase so we can see this error?
Assignee: nobody → general
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
This has nothing to do with the JS engine.  In fact, it has nothing to do with core code, as filed...
Assignee: general → nobody
Component: JavaScript Engine → Download Manager
Product: Core → Toolkit
(Reporter)

Comment 3

5 years ago
Hi 

You could install the ImagePicker v1.3 or v1.2 to reproduce this bug by download multiple images.

ImagePicker v1.3 or v1.2 could be found here:
https://addons.mozilla.org/zh-CN/firefox/addon/image-picker/versions/

Thanks,
Wesley
You need to log in before you can comment on or make changes to this bug.