Closed Bug 379819 Opened 18 years ago Closed 17 years ago

Use protocol flags as a replacement for the accepted protocol list in bug 181860

Categories

(Core :: Networking, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: sciguyryan, Assigned: sciguyryan)

References

Details

Attachments

(1 file, 4 obsolete files)

According to Boris we should really use a protocol flag instead of an accepted protocol list as it allows extension authors to set their protocols with the flag also.
Attached patch Like so? (obsolete) — Splinter Review
Patch v1 - Like so?
Attachment #263856 - Flags: review?(bzbarsky)
Blocks: 379804
Comment on attachment 263856 [details] [diff] [review] Like so? >Index: content/base/src/nsNoDataProtocolContentPolicy.cpp >- if (scheme.EqualsLiteral("http") || >- scheme.EqualsLiteral("https") || I think you do want to leave this list, as an optimization... But add a comment to that effect? > nsIIOService* ios = nsContentUtils::GetIOService(); Is this still used? If not, why is it here? >Index: netwerk/base/public/nsIProtocolHandler.idl >+ * Channels from this protocol should not be loaded >+ * without user interaction from content such as web pages. Uh... no. I think we want a comment more like "channels for this protocol never call OnDataAvailable on the listener passed to AsyncOpen" or something like that... Check with biesi? >+ const unsigned long URI_NO_RETURN_DATA = (1<<11); I might prefer URI_DOES_NOT_RETURN_DATA, but again check with biesi. The rest looks ok.
Attachment #263856 - Flags: review?(bzbarsky) → review-
Attached patch Patch v1.1 (obsolete) — Splinter Review
Lets try this again; Patch v1.1 (In reply to comment #2) > I think you do want to leave this list, as an optimization... But add a > comment to that effect? Done. > Is this still used? If not, why is it here? It seems it's no longer needed. Removed. > Uh... no. I think we want a comment more like "channels for this protocol > never call OnDataAvailable on the listener passed to AsyncOpen" or something > like that... Check with biesi? > Fixed. > I might prefer URI_DOES_NOT_RETURN_DATA, but again check with biesi. > Fixed.
Attachment #263856 - Attachment is obsolete: true
Attachment #263937 - Flags: superreview?(cbiesinger)
Attachment #263937 - Flags: review?(bzbarsky)
Comment on attachment 263937 [details] [diff] [review] Patch v1.1 >Index: content/base/src/nsNoDataProtocolContentPolicy.cpp > + nsIProtocolHandler::URI_NO_RETURN_DATA, That's not going to compile now... >+ if (NS_FAILED(rv)) { >+ shouldBlock = PR_FALSE; > } >+ if (shouldBlock) { > *aDecision = nsIContentPolicy::REJECT_REQUEST; > } Just do if (NS_SUCCEEDED(rv) && shouldBlock) instead, ok? With those fixed, r=bzbarsky
Attachment #263937 - Flags: review?(bzbarsky) → review+
Attached patch Patch v1.2 (obsolete) — Splinter Review
Fixed the errors pointed to by bz above. Could have sworn I changes |nsIProtocolHandler::URI_NO_RETURN_DATA| too |nsIProtocolHandler::URI_DOES_NOT_RETURN_DATA| in nsNoDataProtocolContentPolicy.cpp
Attachment #263937 - Attachment is obsolete: true
Attachment #263943 - Flags: superreview?(cbiesinger)
Attachment #263937 - Flags: superreview?(cbiesinger)
Attached patch Patch v1.3 (obsolete) — Splinter Review
Patch v1.3 Updated to latest trunk.
Attachment #263943 - Attachment is obsolete: true
Attachment #268685 - Flags: superreview?(cbiesinger)
Attachment #263943 - Flags: superreview?(cbiesinger)
Comment on attachment 268685 [details] [diff] [review] Patch v1.3 What about irc:?
Attachment #268685 - Flags: superreview?(cbiesinger) → superreview+
Attached patch Patch v1.4Splinter Review
Patch v1.4 (Now with IRC added) Unless there any others I'm going to request checkin on this patch. Thanks for the review!
Attachment #268685 - Attachment is obsolete: true
Attachment #273785 - Flags: review?(bzbarsky)
Comment on attachment 273785 [details] [diff] [review] Patch v1.4 r=bzbarsky.
Attachment #273785 - Flags: review?(bzbarsky) → review+
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Blocks: 167475
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: