Closed
Bug 1332568
Opened 7 years ago
Closed 3 years ago
Make nsContentTypeParser use nsMIMEHeaderParamImpl::DoGetParameter directly
Categories
(Core :: Networking, defect, P5)
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: mozbugz, Assigned: mozbugz)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-would-take])
Attachments
(3 files, 3 obsolete files)
2.31 KB,
patch
|
mayhemer
:
review+
|
Details | Diff | Splinter Review |
3.76 KB,
patch
|
mayhemer
:
review+
|
Details | Diff | Splinter Review |
1.39 KB,
patch
|
mayhemer
:
review+
|
Details | Diff | Splinter Review |
Currently nsContentTypeParser uses the nsIMIMEHeaderParam/"@mozilla.org/network/mime-hdrparam;1" service, meaning it can only be called on the main thread. To make nsContentTypeParser thread-safe, it could use the (one and only) implementation directly, which is nsMIMEHeaderParamImpl. (Is this controversial?) My main reason for this is that I'd like to use the parser in other threads, e.g. when reading metadata asynchronously and extracting a MIME type. It would also probably save a few cycles, as it won't have to fetch (and possibly create) the service every time it is needed.
Assignee | ||
Comment 2•7 years ago
|
||
Thank you for volunteering to review. :-) (But please feel free to forward to someone else, as appropriate...)
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Updated•7 years ago
|
Attachment #8829327 -
Flags: review?(mcmanus) → review?(honzab.moz)
Updated•7 years ago
|
Attachment #8829326 -
Flags: review?(mcmanus) → review?(honzab.moz)
Updated•7 years ago
|
Attachment #8829325 -
Flags: review?(mcmanus) → review?(honzab.moz)
Comment 6•7 years ago
|
||
Please fix the patches in rb or please reupload as normal patches so I can review them in splitner. thanks.
Flags: needinfo?(gsquelart)
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Attachment #8829325 -
Flags: review?(mcmanus)
Attachment #8829326 -
Flags: review?(mcmanus)
Attachment #8829327 -
Flags: review?(mcmanus)
Assignee | ||
Comment 10•7 years ago
|
||
p1. Expose nsMIMEHeaderParamImpl.h and make DoGetParameter static and public
Attachment #8829325 -
Attachment is obsolete: true
Attachment #8831823 -
Flags: review?(honzab.moz)
Assignee | ||
Comment 11•7 years ago
|
||
p2. Make nsContentTypeParser use nsMIMEHeaderParamImpl::DoGetParameter
Attachment #8829326 -
Attachment is obsolete: true
Attachment #8831824 -
Flags: review?(honzab.moz)
Assignee | ||
Comment 12•7 years ago
|
||
p3. MediaMIMETypes can use thread-safe nsContentTypeParser
Attachment #8829327 -
Attachment is obsolete: true
Flags: needinfo?(gsquelart)
Attachment #8831825 -
Flags: review?(honzab.moz)
Comment 13•7 years ago
|
||
Comment on attachment 8831823 [details] [diff] [review] p1. Expose nsMIMEHeaderParamImpl.h and make DoGetParameter static and public Review of attachment 8831823 [details] [diff] [review]: ----------------------------------------------------------------- ::: netwerk/mime/nsMIMEHeaderParamImpl.h @@ +19,5 @@ > MIME_FIELD_ENCODING = 1, > HTTP_FIELD_ENCODING > + }; > + static > + nsresult DoGetParameter(const nsACString& aHeaderVal, in the cpp file, please mark these two methods with // static comment, and please double check that none of them (including the callees) writes to any global memory
Attachment #8831823 -
Flags: review?(honzab.moz) → review+
Comment 14•7 years ago
|
||
Comment on attachment 8831824 [details] [diff] [review] p2. Make nsContentTypeParser use nsMIMEHeaderParamImpl::DoGetParameter Review of attachment 8831824 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/base/nsContentUtils.cpp @@ +6134,5 @@ > > return NS_SUCCEEDED(aPrincipal->CheckMayLoad(channelURI, false, aAllowIfInheritsPrincipal)); > } > > nsContentTypeParser::nsContentTypeParser(const nsAString& aString) please make sure that this class is not accessing any globals so it can be safely used on more than one thread.
Attachment #8831824 -
Flags: review?(honzab.moz) → review+
Updated•7 years ago
|
Attachment #8831825 -
Flags: review?(honzab.moz) → review+
Comment 15•7 years ago
|
||
Bulk change to priority: https://bugzilla.mozilla.org/show_bug.cgi?id=1399258
Priority: -- → P5
Assignee | ||
Comment 16•3 years ago
|
||
Abandonning this old bug I haven't touched for years! I don't think it's worth keeping around, patches are probably very bit-rotten, and if there was a need for this, someone else could probably do it better than me now, and open a bug for their own work.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•