Bug 1479524 - Remove unused appId filter. r=jdescottes draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Thu, 02 Aug 2018 11:41:48 -0700
changeset 828963 720e2d5dc1a63776c2890d65909c72d1b81004f2
parent 828962 5d6e043af66874e2dc4ba9626f9daf357e958078
child 828964 0ff9a32425870a1e7e21bc933a0052cb53617459
push id118734
push userbmo:poirot.alex@gmail.com
push dateTue, 14 Aug 2018 14:53:41 +0000
reviewersjdescottes
bugs1479524
milestone63.0a1
Bug 1479524 - Remove unused appId filter. r=jdescottes MozReview-Commit-ID: FwIX9dQ4c83
devtools/shared/webconsole/network-helper.js
devtools/shared/webconsole/network-monitor.js
--- a/devtools/shared/webconsole/network-helper.js
+++ b/devtools/shared/webconsole/network-helper.js
@@ -194,32 +194,16 @@ var NetworkHelper = {
 
         return this.readAndConvertFromStream(descriptor, charset);
       }
     }
     return null;
   },
 
   /**
-   * Gets the web appId that is associated with request.
-   *
-   * @param nsIHttpChannel request
-   * @returns number|null
-   *          The appId for the given request, if available.
-   */
-  getAppIdForRequest: function(request) {
-    try {
-      return this.getRequestLoadContext(request).appId;
-    } catch (ex) {
-      // request loadContent is not always available.
-    }
-    return null;
-  },
-
-  /**
    * Gets the topFrameElement that is associated with request. This
    * works in single-process and multiprocess contexts. It may cross
    * the content/chrome boundary.
    *
    * @param nsIHttpChannel request
    * @returns Element|null
    *          The top frame element for the given request.
    */
--- a/devtools/shared/webconsole/network-monitor.js
+++ b/devtools/shared/webconsole/network-monitor.js
@@ -42,17 +42,17 @@ const HTTP_TEMPORARY_REDIRECT = 307;
  *        Request to check.
  * @param filters
  *        NetworkMonitor filters to match against.
  * @return boolean
  *         True if the network request should be logged, false otherwise.
  */
 function matchRequest(channel, filters) {
   // Log everything if no filter is specified
-  if (!filters.outerWindowID && !filters.window && !filters.appId) {
+  if (!filters.outerWindowID && !filters.window) {
     return true;
   }
 
   // Ignore requests from chrome or add-on code when we are monitoring
   // content.
   // TODO: one particular test (browser_styleeditor_fetch-from-cache.js) needs
   // the flags.testing check. We will move to a better way to serve
   // its needs in bug 1167188, where this check should be removed.
@@ -88,23 +88,16 @@ function matchRequest(channel, filters) 
         }
       } catch (e) {
         // outerWindowID getter from browser.xml (non-remote <xul:browser>) may
         // throw when closing a tab while resources are still loading.
       }
     }
   }
 
-  if (filters.appId) {
-    const appId = NetworkHelper.getAppIdForRequest(channel);
-    if (appId && appId == filters.appId) {
-      return true;
-    }
-  }
-
   return false;
 }
 
 /**
  * This is a nsIChannelEventSink implementation that monitors channel redirects and
  * informs the registered StackTraceCollector about the old and new channels.
  */
 const SINK_CLASS_DESCRIPTION = "NetworkMonitor Channel Event Sink";
@@ -765,17 +758,16 @@ NetworkResponseListener.prototype = {
  * http-on-examine-response notifications. All network request information is
  * routed to the remote Web Console.
  *
  * @constructor
  * @param object filters
  *        Object with the filters to use for network requests:
  *        - window (nsIDOMWindow): filter network requests by the associated
  *          window object.
- *        - appId (number): filter requests by the appId.
  *        - outerWindowID (number): filter requests by their top frame's outerWindowID.
  *        Filters are optional. If any of these filters match the request is
  *        logged (OR is applied). If no filter is provided then all requests are
  *        logged.
  * @param object owner
  *        The network monitor owner. This object needs to hold:
  *        - onNetworkEvent(requestInfo)
  *          This method is invoked once for every new network request and it is