Closed
Bug 797410
Opened 14 years ago
Closed 13 years ago
Use Components.results instead of hardcoding nsresult values.
Categories
(SeaMonkey :: General, defect)
SeaMonkey
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: philip.chee, Assigned: ewong)
References
()
Details
(Whiteboard: [good first bug][lang=js][mentor=Philip.Chee(Ratty)][level=easy])
Attachments
(1 file, 1 obsolete file)
|
5.72 KB,
patch
|
iannbugzilla
:
review+
|
Details | Diff | Splinter Review |
References: FX Bug 454360 Use Components.results.NS_BINDING_ABORTED instead of hardcoding the value.
From Bug 454360 Comment 0:
> Since bug 418406 was nice enough to expose network error constants in
> Components.results, we really ought to make use of them rather than hardcoding
> 0x804b0002 all over the place in JS. (Well, okay, there's one NET_TIMEOUT in
> here, too, but it's mostly about the BINDING_ABORTED.)
From Bug 794067 Comment 2:
>> Bug 783738 Use Components.results.NS_BINDING_ABORTED instead of hardcoding
>> the value.
> Should this not cover changes to nsBrowserContentHandler.js,
> nsBrowserStatusHandler.js and uploadProgress.js too? There is EdLinkChecker.js
> too but that is in shared code (with TB) and is wider than just
> NS_BINDING_ABORTED so warrants a separate bug.
| Reporter | ||
Comment 1•14 years ago
|
||
| Assignee | ||
Comment 2•14 years ago
|
||
| Reporter | ||
Comment 3•14 years ago
|
||
> - const kErrorBindingAborted = 0x804B0002;
> const kErrorNetTimeout = 0x804B000E;
FYI: Components.results.NS_ERROR_NET_TIMEOUT is 0x804B000E (2152398862)
Comment on attachment 668723 [details] [diff] [review]
Use Components.results.NS_BINDING_ABORTED instead of hardcoding the value.
Would be good to get kErrorNetTimeout = 0x804B000E done too, preferably as one patch on this bug (bug title might have to be tweaked).
Attachment #668723 -
Flags: review?(iann_bugzilla) → review+
| Assignee | ||
Comment 5•13 years ago
|
||
(In reply to Philip Chee from comment #3)
> > - const kErrorBindingAborted = 0x804B0002;
> > const kErrorNetTimeout = 0x804B000E;
>
> FYI: Components.results.NS_ERROR_NET_TIMEOUT is 0x804B000E (2152398862)
yeah I did put that in my patch, but since it was 'offtopic' for this bug,
I removed it. Maybe I'll tweak this bug's description to include this?
| Reporter | ||
Updated•13 years ago
|
Summary: Use Components.results.NS_BINDING_ABORTED instead of hardcoding the value. → Use Components.results.NS_BINDING_ABORTED (and NS_ERROR_NET_TIMEOUT) instead of hardcoding the value.
Comment 6•13 years ago
|
||
I found the following constants used in suite. If you update the patch for kErrorNetTimeout then perhaps you could throw in NS_ERROR_FILE_NOT_FOUND too? I don't think the others appear in Components.results (yet).
/suite/browser/nsBrowserContentHandler.js
line 30 -- const NS_BINDING_ABORTED = 0x804b0002;
line 31 -- const NS_ERROR_WONT_HANDLE_CONTENT = 0x805d0001;
/suite/browser/nsBrowserStatusHandler.js
line 228 -- const kErrorBindingAborted = 0x804B0002;
line 229 -- const kErrorNetTimeout = 0x804B000E;
/suite/common/downloads/uploadProgress.js
line 54 -- const NS_BINDING_ABORTED = 0x804b0002;
/suite/common/sidebar/sidebarOverlay.js
line 821 -- const NS_ERROR_FILE_NOT_FOUND = 0x80520012;
/suite/common/nsContextMenu.js
line 909 -- const NS_ERROR_SAVE_LINK_AS_TIMEOUT = 0x805d0020;
/suite/feeds/src/WebContentConverter.js
line 27 -- const NS_ERROR_MODULE_DOM = 0x80530000;
line 28 -- const NS_ERROR_DOM_SYNTAX_ERR = NS_ERROR_MODULE_DOM + 12;
/suite/mailnews/mail3PaneWindowCommands.js
line 903 -- const NS_MSG_ERROR_COPY_FOLDER_ABORTED = 0x8055001a;
/suite/mailnews/messengerdnd.js
line 159 -- const NS_MSG_FOLDER_EXISTS = 0x80550013;
line 160 -- const NS_MSG_ERROR_COPY_FOLDER_ABORTED = 0x8055001a;
Summary: Use Components.results.NS_BINDING_ABORTED (and NS_ERROR_NET_TIMEOUT) instead of hardcoding the value. → Use Components.results instead of hardcoding nsresult values.
| Assignee | ||
Comment 7•13 years ago
|
||
Attachment #668723 -
Attachment is obsolete: true
Attachment #669396 -
Flags: review?(iann_bugzilla)
Attachment #669396 -
Flags: review?(iann_bugzilla) → review+
| Assignee | ||
Comment 8•13 years ago
|
||
Pushed to comm-central:
http://hg.mozilla.org/comm-central/rev/fd290549d8ea
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•