author | Cykesiopka <cykesiopka@hotmail.com> |
Fri, 08 Mar 2013 08:30:13 -0500 | |
changeset 124216 | f3a0fe13a11aa5a01cf20f679f4e1d39440446a4 |
parent 124215 | 014407deab515edb413dd3929d4804ae444cd6cf |
child 124217 | 31b28458cee6efbed5ec48d5dbf6f513af88e6af |
push id | 24295 |
push user | ryanvm@gmail.com |
push date | Fri, 08 Mar 2013 13:29:46 +0000 |
treeherder | mozilla-inbound@2c4a8bdb41eb [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | biesi |
bugs | 92979 |
milestone | 22.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -556,18 +556,17 @@ SendPing(void *closure, nsIContent *cont if (!uploadChan) return; // To avoid sending an unnecessary Content-Type header, we encode the // closing portion of the headers in the POST body. NS_NAMED_LITERAL_CSTRING(uploadData, "Content-Length: 0\r\n\r\n"); nsCOMPtr<nsIInputStream> uploadStream; - NS_NewPostDataStream(getter_AddRefs(uploadStream), false, - uploadData, 0); + NS_NewPostDataStream(getter_AddRefs(uploadStream), false, uploadData); if (!uploadStream) return; uploadChan->SetUploadStream(uploadStream, EmptyCString(), -1); // The channel needs to have a loadgroup associated with it, so that we can // cancel the channel and any redirected channels it may create. nsCOMPtr<nsILoadGroup> loadGroup =
--- a/netwerk/base/public/nsNetUtil.h +++ b/netwerk/base/public/nsNetUtil.h @@ -279,18 +279,17 @@ NS_OpenURI(nsIStreamListener *listen if (NS_SUCCEEDED(rv)) rv = channel->AsyncOpen(listener, context); return rv; } inline nsresult NS_MakeAbsoluteURI(nsACString &result, const nsACString &spec, - nsIURI *baseURI, - nsIIOService *unused = nullptr) + nsIURI *baseURI) { nsresult rv; if (!baseURI) { NS_WARNING("It doesn't make sense to not supply a base URI"); result = spec; rv = NS_OK; } else if (spec.IsEmpty()) @@ -298,35 +297,33 @@ NS_MakeAbsoluteURI(nsACString &res else rv = baseURI->Resolve(spec, result); return rv; } inline nsresult NS_MakeAbsoluteURI(char **result, const char *spec, - nsIURI *baseURI, - nsIIOService *unused = nullptr) + nsIURI *baseURI) { nsresult rv; nsAutoCString resultBuf; rv = NS_MakeAbsoluteURI(resultBuf, nsDependentCString(spec), baseURI); if (NS_SUCCEEDED(rv)) { *result = ToNewCString(resultBuf); if (!*result) rv = NS_ERROR_OUT_OF_MEMORY; } return rv; } inline nsresult NS_MakeAbsoluteURI(nsAString &result, const nsAString &spec, - nsIURI *baseURI, - nsIIOService *unused = nullptr) + nsIURI *baseURI) { nsresult rv; if (!baseURI) { NS_WARNING("It doesn't make sense to not supply a base URI"); result = spec; rv = NS_OK; } else { @@ -382,18 +379,17 @@ NS_StringToACE(const nsACString &idn, ns } /** * This function is a helper function to get a protocol's default port if the * URI does not specify a port explicitly. Returns -1 if this protocol has no * concept of ports or if there was an error getting the port. */ inline int32_t -NS_GetRealPort(nsIURI* aURI, - nsIIOService* ioService = nullptr) // pass in nsIIOService to optimize callers +NS_GetRealPort(nsIURI* aURI) { int32_t port; nsresult rv = aURI->GetPort(&port); if (NS_FAILED(rv)) return -1; if (port != -1) return port; // explicitly specified @@ -1096,19 +1092,17 @@ NS_BufferOutputStream(nsIOutputStream *a NS_ADDREF(aOutputStream); return aOutputStream; } // returns an input stream compatible with nsIUploadChannel::SetUploadStream() inline nsresult NS_NewPostDataStream(nsIInputStream **result, bool isFile, - const nsACString &data, - uint32_t encodeFlags, - nsIIOService *unused = nullptr) + const nsACString &data) { nsresult rv; if (isFile) { nsCOMPtr<nsIFile> file; nsCOMPtr<nsIInputStream> fileStream; rv = NS_NewNativeLocalFile(data, false, getter_AddRefs(file));
--- a/netwerk/test/TestUpload.cpp +++ b/netwerk/test/TestUpload.cpp @@ -115,26 +115,26 @@ main(int argc, char* argv[]) #if defined(PR_LOGGING) gTestLog = PR_NewLogModule("Test"); #endif { nsCOMPtr<nsIServiceManager> servMan; NS_InitXPCOM2(getter_AddRefs(servMan), nullptr, nullptr); - nsCOMPtr<nsIIOService> ioService(do_GetService(kIOServiceCID, &rv)); // first thing to do is create ourselves a stream that // is to be uploaded. nsCOMPtr<nsIInputStream> uploadStream; rv = NS_NewPostDataStream(getter_AddRefs(uploadStream), true, - nsDependentCString(fileName), // XXX UTF-8 - 0, ioService); + nsDependentCString(fileName)); // XXX UTF-8 if (NS_FAILED(rv)) return -1; + nsCOMPtr<nsIIOService> ioService(do_GetService(kIOServiceCID, &rv)); + // create our url. nsCOMPtr<nsIURI> uri; rv = NS_NewURI(getter_AddRefs(uri), uriSpec); if (NS_FAILED(rv)) return -1; nsCOMPtr<nsIChannel> channel; rv = ioService->NewChannelFromURI(uri, getter_AddRefs(channel)); if (NS_FAILED(rv)) return -1;
--- a/security/manager/ssl/src/nsNSSCallbacks.cpp +++ b/security/manager/ssl/src/nsNSSCallbacks.cpp @@ -88,18 +88,17 @@ nsHTTPDownloadEvent::Run() nsCOMPtr<nsILoadGroup> lg = do_CreateInstance(NS_LOADGROUP_CONTRACTID); chan->SetLoadGroup(lg); if (mRequestSession->mHasPostData) { nsCOMPtr<nsIInputStream> uploadStream; rv = NS_NewPostDataStream(getter_AddRefs(uploadStream), false, - mRequestSession->mPostData, - 0, ios); + mRequestSession->mPostData); NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr<nsIUploadChannel> uploadChannel(do_QueryInterface(chan)); NS_ENSURE_STATE(uploadChannel); rv = uploadChannel->SetUploadStream(uploadStream, mRequestSession->mPostContentType, -1);