Bug 1210302 - Part 2: Rename NS_ParseContentType to NS_ParseResponseContentType; r=mcmanus,sicking
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 01 Oct 2015 12:51:50 -0400
changeset 289563 71966c03aef5
parent 289562 82cc6b6e6eaa
child 289564 c1cd30406136
push id5189
push usereakhgari@mozilla.com
push date2015-10-15 19:05 +0000
treeherdermozilla-beta@c1cd30406136 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus, sicking
bugs1210302
milestone42.0
Bug 1210302 - Part 2: Rename NS_ParseContentType to NS_ParseResponseContentType; r=mcmanus,sicking
dom/base/nsObjectLoadingContent.cpp
modules/libjar/nsJARChannel.cpp
netwerk/base/nsNetUtil.cpp
netwerk/base/nsNetUtil.h
--- a/dom/base/nsObjectLoadingContent.cpp
+++ b/dom/base/nsObjectLoadingContent.cpp
@@ -1844,17 +1844,17 @@ nsObjectLoadingContent::UpdateObjectPara
       overrideChannelType = true;
     }
 
     if (overrideChannelType) {
       // Set the type we'll use for dispatch on the channel.  Otherwise we could
       // end up trying to dispatch to a nsFrameLoader, which will complain that
       // it couldn't find a way to handle application/octet-stream
       nsAutoCString parsedMime, dummy;
-      NS_ParseContentType(newMime, parsedMime, dummy);
+      NS_ParseResponseContentType(newMime, parsedMime, dummy);
       if (!parsedMime.IsEmpty()) {
         mChannel->SetContentType(parsedMime);
       }
     } else {
       newMime = channelType;
       if (IsJavaMIME(newMime)) {
         // Java does not load with a channel, and being java retroactively
         // changes how we may have interpreted the codebase to construct this
--- a/modules/libjar/nsJARChannel.cpp
+++ b/modules/libjar/nsJARChannel.cpp
@@ -743,17 +743,17 @@ nsJARChannel::GetContentType(nsACString 
 
 NS_IMETHODIMP
 nsJARChannel::SetContentType(const nsACString &aContentType)
 {
     // If someone gives us a type hint we should just use that type instead of
     // doing our guessing.  So we don't care when this is being called.
 
     // mContentCharset is unchanged if not parsed
-    NS_ParseContentType(aContentType, mContentType, mContentCharset);
+    NS_ParseResponseContentType(aContentType, mContentType, mContentCharset);
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsJARChannel::GetContentCharset(nsACString &aContentCharset)
 {
     // If someone gives us a charset hint we should just use that charset.
     // So we don't care when this is being called.
@@ -1171,17 +1171,17 @@ nsJARChannel::OnDownloadComplete(MemoryD
             // We only want to run scripts if the server really intended to
             // send us a JAR file.  Check the server-supplied content type for
             // a JAR type.
             nsAutoCString header;
             httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("Content-Type"),
                                            header);
             nsAutoCString contentType;
             nsAutoCString charset;
-            NS_ParseContentType(header, contentType, charset);
+            NS_ParseResponseContentType(header, contentType, charset);
             nsAutoCString channelContentType;
             channel->GetContentType(channelContentType);
             mIsUnsafe = !(contentType.Equals(channelContentType) &&
                           (contentType.EqualsLiteral("application/java-archive") ||
                            contentType.EqualsLiteral("application/x-jar")));
         } else {
             nsCOMPtr<nsIJARChannel> innerJARChannel(do_QueryInterface(channel));
             if (innerJARChannel) {
--- a/netwerk/base/nsNetUtil.cpp
+++ b/netwerk/base/nsNetUtil.cpp
@@ -909,19 +909,19 @@ NS_GetReferrerFromChannel(nsIChannel *ch
         if (NS_FAILED(rv))
           *referrer = nullptr;
       }
     }
     return rv;
 }
 
 nsresult
-NS_ParseContentType(const nsACString &rawContentType,
-                    nsCString        &contentType,
-                    nsCString        &contentCharset)
+NS_ParseResponseContentType(const nsACString &rawContentType,
+                            nsCString        &contentType,
+                            nsCString        &contentCharset)
 {
     // contentCharset is left untouched if not present in rawContentType
     nsresult rv;
     nsCOMPtr<nsINetUtil> util = do_GetNetUtil(&rv);
     NS_ENSURE_SUCCESS(rv, rv);
     nsCString charset;
     bool hadCharset;
     rv = util->ParseResponseContentType(rawContentType, charset, &hadCharset,
--- a/netwerk/base/nsNetUtil.h
+++ b/netwerk/base/nsNetUtil.h
@@ -484,19 +484,19 @@ nsresult NS_GetURLSpecFromDir(nsIFile   
  * referrer from the property docshell.internalReferrer, and if that doesn't
  * work and the channel is an nsIHTTPChannel, we check it's referrer property.
  *
  * @returns NS_ERROR_NOT_AVAILABLE if no referrer is available.
  */
 nsresult NS_GetReferrerFromChannel(nsIChannel *channel,
                                    nsIURI **referrer);
 
-nsresult NS_ParseContentType(const nsACString &rawContentType,
-                             nsCString        &contentType,
-                             nsCString        &contentCharset);
+nsresult NS_ParseResponseContentType(const nsACString &rawContentType,
+                                     nsCString        &contentType,
+                                     nsCString        &contentCharset);
 
 nsresult NS_ExtractCharsetFromContentType(const nsACString &rawContentType,
                                           nsCString        &contentCharset,
                                           bool             *hadCharset,
                                           int32_t          *charsetStart,
                                           int32_t          *charsetEnd);
 
 nsresult NS_NewLocalFileInputStream(nsIInputStream **result,