Bug 1317597. Stop using LegacyIsCallerChromeOrNativeCode use in nsObjectLoadingContent. r=qdot
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 15 Nov 2016 12:46:32 -0500
changeset 439409 b26a22e74be42ef795aaddc925e9791e872e0c3b
parent 439408 683874fa09afc9c61f0e754d9ea36043e38f6441
child 439410 e7eecb6dbcc5ea93786bd514069fd85d01888947
push id36000
push userbmo:gasolin@mozilla.com
push dateWed, 16 Nov 2016 01:30:27 +0000
reviewersqdot
bugs1317597
milestone53.0a1
Bug 1317597. Stop using LegacyIsCallerChromeOrNativeCode use in nsObjectLoadingContent. r=qdot These checks date back to when we didn't have webidl bindings and could end up exposing random XPCOM methods to the web. That doesn't happen anymore.
dom/base/nsObjectLoadingContent.cpp
--- a/dom/base/nsObjectLoadingContent.cpp
+++ b/dom/base/nsObjectLoadingContent.cpp
@@ -1180,18 +1180,16 @@ nsObjectLoadingContent::OnStopRequest(ns
   if (aStatusCode == NS_ERROR_TRACKING_URI) {
     nsCOMPtr<nsIContent> thisNode =
       do_QueryInterface(static_cast<nsIObjectLoadingContent*>(this));
     if (thisNode && thisNode->IsInComposedDoc()) {
       thisNode->GetComposedDoc()->AddBlockedTrackingNode(thisNode);
     }
   }
 
-  NS_ENSURE_TRUE(nsContentUtils::LegacyIsCallerChromeOrNativeCode(), NS_ERROR_NOT_AVAILABLE);
-
   if (aRequest != mChannel) {
     return NS_BINDING_ABORTED;
   }
 
   mChannel = nullptr;
 
   if (mFinalListener) {
     // This may re-enter in the case of plugin listeners
@@ -1207,18 +1205,16 @@ nsObjectLoadingContent::OnStopRequest(ns
 
 // nsIStreamListener
 NS_IMETHODIMP
 nsObjectLoadingContent::OnDataAvailable(nsIRequest *aRequest,
                                         nsISupports *aContext,
                                         nsIInputStream *aInputStream,
                                         uint64_t aOffset, uint32_t aCount)
 {
-  NS_ENSURE_TRUE(nsContentUtils::LegacyIsCallerChromeOrNativeCode(), NS_ERROR_NOT_AVAILABLE);
-
   if (aRequest != mChannel) {
     return NS_BINDING_ABORTED;
   }
 
   if (mFinalListener) {
     // This may re-enter in the case of plugin listeners
     nsCOMPtr<nsIStreamListener> listenerGrip(mFinalListener);
     return listenerGrip->OnDataAvailable(aRequest, aContext, aInputStream,