Bug 1349903 - Remove the code section of getting originAttributes from loadInfo in HttpChannelParent::DoAsyncOpen() and add a null check for loadInfo. r?mayhemer draft
authorTim Huang <tihuang@mozilla.com>
Fri, 24 Mar 2017 23:44:57 +0100
changeset 550598 5767db7a6943019baede6255b9b3b0d9af12e22d
parent 504632 4c987b7ed54a630a7de76adcc2eb00dab49d5dfd
child 550757 128cede8f312a302aabc22351bd4332f9ee9159f
push id50979
push userbmo:tihuang@mozilla.com
push dateFri, 24 Mar 2017 23:20:30 +0000
reviewersmayhemer
bugs1349903
milestone55.0a1
Bug 1349903 - Remove the code section of getting originAttributes from loadInfo in HttpChannelParent::DoAsyncOpen() and add a null check for loadInfo. r?mayhemer The code section of getting originAttributes from loadInfo in HttpChannelParent ::DoAsyncOpen() is no longer needed since AppId is gone and the originAttributes here is for AppId. And we also need a null check for loadInfo that every channel should have a loadInfo. MozReview-Commit-ID: CQe8wlEo0GP
netwerk/protocol/http/HttpChannelParent.cpp
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -356,20 +356,18 @@ HttpChannelParent::DoAsyncOpen(  const U
 
   nsCOMPtr<nsILoadInfo> loadInfo;
   rv = mozilla::ipc::LoadInfoArgsToLoadInfo(aLoadInfoArgs,
                                             getter_AddRefs(loadInfo));
   if (NS_FAILED(rv)) {
     return SendFailedAsyncOpen(rv);
   }
 
-  OriginAttributes attrs;
-  rv = loadInfo->GetOriginAttributes(&attrs);
-  if (NS_FAILED(rv)) {
-    return SendFailedAsyncOpen(rv);
+  if (!loadInfo) {
+    return SendFailedAsyncOpen(NS_ERROR_UNEXPECTED);
   }
 
   nsCOMPtr<nsIChannel> channel;
   rv = NS_NewChannelInternal(getter_AddRefs(channel), uri, loadInfo,
                              nullptr, nullptr, aLoadFlags, ios);
   if (NS_FAILED(rv)) {
     return SendFailedAsyncOpen(rv);
   }