Bug 1469824 - Remove AppCacheUtils.jsm. r=jryans draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Wed, 20 Jun 2018 04:50:19 -0700
changeset 808704 e033aa95cbfb0a1a7401ef155b275353afed17f6
parent 808703 76a4a96da17c8ffa1bd57b84af81652a3b12870e
push id113463
push userbmo:poirot.alex@gmail.com
push dateWed, 20 Jun 2018 12:06:36 +0000
reviewersjryans
bugs1469824
milestone62.0a1
Bug 1469824 - Remove AppCacheUtils.jsm. r=jryans MozReview-Commit-ID: 7ZtVj55k11U
devtools/.eslintrc.js
devtools/client/locales/en-US/appcacheutils.properties
devtools/client/shared/AppCacheUtils.jsm
devtools/client/shared/moz.build
--- a/devtools/.eslintrc.js
+++ b/devtools/.eslintrc.js
@@ -38,17 +38,16 @@ module.exports = {
     ],
     "rules": {
       "consistent-return": "off",
     }
   }, {
     "files": [
       "client/framework/**",
       "client/scratchpad/**",
-      "client/shared/AppCacheUtils.jsm",
       "client/webide/**",
     ],
     "rules": {
       "max-nested-callbacks": "off",
     }
   }, {
     "files": [
       "client/framework/**",
deleted file mode 100644
--- a/devtools/client/locales/en-US/appcacheutils.properties
+++ /dev/null
@@ -1,121 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-# LOCALIZATION NOTE These strings are used inside the Web Console
-# command line which is available from the Web Developer sub-menu
-# -> 'Web Console'.
-# These messages are displayed when an attempt is made to validate a
-# page or a cache manifest using AppCacheUtils.jsm
-
-# The correct localization of this file might be to keep it in
-# English, or another language commonly spoken among web developers.
-# You want to make that choice consistent across the developer tools.
-# A good criteria is the language in which you'd find the best
-# documentation on web development on the web.
-
-# LOCALIZATION NOTE (noManifest): the specified page has no cache manifest.
-noManifest=The specified page has no manifest.
-
-# LOCALIZATION NOTE (notUTF8): the associated cache manifest has a character
-# encoding that is not UTF-8. Parameters: %S is the current encoding.
-notUTF8=Manifest has a character encoding of %S. Manifests must have the utf-8 character encoding.
-
-# LOCALIZATION NOTE (badMimeType): the associated cache manifest has a
-# mimetype that is not text/cache-manifest. Parameters: %S is the current
-# mimetype.
-badMimeType=Manifest has a mimetype of %S. Manifests must have a mimetype of text/cache-manifest.
-
-# LOCALIZATION NOTE (duplicateURI): the associated cache manifest references
-# the same URI from multiple locations. Parameters: %1$S is the URI, %2$S is a
-# list of references to this URI.
-duplicateURI=URI %1$S is referenced in multiple locations. This is not allowed: %2$S.
-
-# LOCALIZATION NOTE (networkBlocksURI, fallbackBlocksURI): the associated
-# cache manifest references the same URI in the NETWORK (or FALLBACK) section
-# as it does in other sections. Parameters: %1$S is the line number, %2$S is
-# the resource name, %3$S is the line number, %4$S is the resource name, %5$S
-# is the section name.
-networkBlocksURI=NETWORK section line %1$S (%2$S) prevents caching of line %3$S (%4$S) in the %5$S section.
-fallbackBlocksURI=FALLBACK section line %1$S (%2$S) prevents caching of line %3$S (%4$S) in the %5$S section.
-
-# LOCALIZATION NOTE (fileChangedButNotManifest): the associated cache manifest
-# references a URI that has a file modified after the cache manifest.
-# Parameters: %1$S is the resource name, %2$S is the cache manifest, %3$S is
-# the line number.
-fileChangedButNotManifest=The file %1$S was modified after %2$S. Unless the text in the manifest file is changed the cached version will be used instead at line %3$S.
-
-# LOCALIZATION NOTE (cacheControlNoStore): the specified page has a header
-# preventing caching or storing information. Parameters: %1$S is the resource
-# name, %2$S is the line number.
-cacheControlNoStore=%1$S has cache-control set to no-store. This will prevent the application cache from storing the file at line %2$S.
-
-# LOCALIZATION NOTE (notAvailable): the specified resource is not available.
-# Parameters: %1$S is the resource name, %2$S is the line number.
-notAvailable=%1$S points to a resource that is not available at line %2$S.
-
-# LOCALIZATION NOTE (invalidURI): it's used when an invalid URI is passed to
-# the appcache.
-invalidURI=The URI passed to AppCacheUtils is invalid.
-
-# LOCALIZATION NOTE (noResults): it's used when a search returns no results.
-noResults=Your search returned no results.
-
-# LOCALIZATION NOTE (cacheDisabled): it's used when the cache is disabled and
-# an attempt is made to view offline data.
-cacheDisabled=Your disk cache is disabled. Please set browser.cache.disk.enable to true in about:config and try again.
-
-# LOCALIZATION NOTE (firstLineMustBeCacheManifest): the associated cache
-# manifest has a first line that is not "CACHE MANIFEST". Parameters: %S is
-# the line number.
-firstLineMustBeCacheManifest=The first line of the manifest must be “CACHE MANIFEST” at line %S.
-
-# LOCALIZATION NOTE (cacheManifestOnlyFirstLine2): the associated cache
-# manifest has "CACHE MANIFEST" on a line other than the first line.
-# Parameters: %S is the line number where "CACHE MANIFEST" appears.
-cacheManifestOnlyFirstLine2=“CACHE MANIFEST” is only valid on the first line but was found at line %S.
-
-# LOCALIZATION NOTE (asteriskInWrongSection2): the associated cache manifest
-# has an asterisk (*) in a section other than the NETWORK section. Parameters:
-# %1$S is the section name, %2$S is the line number.
-asteriskInWrongSection2=Asterisk (*) incorrectly used in the %1$S section at line %2$S. If a line in the NETWORK section contains only a single asterisk character, then any URI not listed in the manifest will be treated as if the URI was listed in the NETWORK section. Otherwise such URIs will be treated as unavailable. Other uses of the * character are prohibited.
-
-# LOCALIZATION NOTE (escapeSpaces1): the associated cache manifest has a space
-# in a URI. Spaces must be replaced with %20. Parameters: %S is the line
-# number where this error occurs.
-# %% will be displayed as a single % character (% is commonly used to define
-# format specifiers, so it needs to be escaped).
-escapeSpaces1=Spaces in URIs need to be replaced with %%20 at line %S.
-
-# LOCALIZATION NOTE (slashDotDotSlashBad): the associated cache manifest has a
-# URI containing /../, which is invalid. Parameters: %S is the line number
-# where this error occurs.
-slashDotDotSlashBad=/../ is not a valid URI prefix at line %S.
-
-# LOCALIZATION NOTE (tooManyDotDotSlashes): the associated cache manifest has
-# a URI containing too many ../ operators. Too many of these operators mean
-# that the file would be below the root of the site, which is not possible.
-# Parameters: %S is the line number where this error occurs.
-tooManyDotDotSlashes=Too many dot dot slash operators (../) at line %S.
-
-# LOCALIZATION NOTE (fallbackUseSpaces): the associated cache manifest has a
-# FALLBACK section containing more or less than the standard two URIs
-# separated by a single space. Parameters: %S is the line number where this
-# error occurs.
-fallbackUseSpaces=Only two URIs separated by spaces are allowed in the FALLBACK section at line %S.
-
-# LOCALIZATION NOTE (fallbackAsterisk2): the associated cache manifest has a
-# FALLBACK section that attempts to use an asterisk (*) as a wildcard. In this
-# section the URI is simply a path prefix. Parameters: %S is the line number
-# where this error occurs.
-fallbackAsterisk2=Asterisk (*) incorrectly used in the FALLBACK section at line %S. URIs in the FALLBACK section simply need to match a prefix of the request URI.
-
-# LOCALIZATION NOTE (settingsBadValue): the associated cache manifest has a
-# SETTINGS section containing something other than the valid "prefer-online"
-# or "fast". Parameters: %S is the line number where this error occurs.
-settingsBadValue=The SETTINGS section may only contain a single value, “prefer-online” or “fast” at line %S.
-
-# LOCALIZATION NOTE (invalidSectionName): the associated cache manifest
-# contains an invalid section name. Parameters: %1$S is the section name, %2$S
-# is the line number.
-invalidSectionName=Invalid section name (%1$S) at line %2$S.
deleted file mode 100644
--- a/devtools/client/shared/AppCacheUtils.jsm
+++ /dev/null
@@ -1,617 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * validateManifest() warns of the following errors:
- *  - No manifest specified in page
- *  - Manifest is not utf-8
- *  - Manifest mimetype not text/cache-manifest
- *  - Manifest does not begin with "CACHE MANIFEST"
- *  - Page modified since appcache last changed
- *  - Duplicate entries
- *  - Conflicting entries e.g. in both CACHE and NETWORK sections or in cache
- *    but blocked by FALLBACK namespace
- *  - Detect referenced files that are not available
- *  - Detect referenced files that have cache-control set to no-store
- *  - Wildcards used in a section other than NETWORK
- *  - Spaces in URI not replaced with %20
- *  - Completely invalid URIs
- *  - Too many dot dot slash operators
- *  - SETTINGS section is valid
- *  - Invalid section name
- *  - etc.
- */
-
-"use strict";
-
-var { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm", {});
-var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm", {});
-var { require } = ChromeUtils.import("resource://devtools/shared/Loader.jsm", {});
-
-var { gDevTools } = require("devtools/client/framework/devtools");
-var Services = require("Services");
-var { globals } = require("devtools/shared/builtin-modules");
-
-this.EXPORTED_SYMBOLS = ["AppCacheUtils"];
-
-function AppCacheUtils(documentOrUri) {
-  this._parseManifest = this._parseManifest.bind(this);
-
-  if (documentOrUri) {
-    if (typeof documentOrUri == "string") {
-      this.uri = documentOrUri;
-    }
-    if (/HTMLDocument/.test(documentOrUri.toString())) {
-      this.doc = documentOrUri;
-    }
-  }
-}
-
-AppCacheUtils.prototype = {
-  get cachePath() {
-    return "";
-  },
-
-  validateManifest: function ACU_validateManifest() {
-    return new Promise((resolve, reject) => {
-      this.errors = [];
-      // Check for missing manifest.
-      this._getManifestURI().then(manifestURI => {
-        this.manifestURI = manifestURI;
-
-        if (!this.manifestURI) {
-          this._addError(0, "noManifest");
-          resolve(this.errors);
-        }
-
-        this._getURIInfo(this.manifestURI).then(uriInfo => {
-          this._parseManifest(uriInfo).then(() => {
-            // Sort errors by line number.
-            this.errors.sort(function(a, b) {
-              return a.line - b.line;
-            });
-            resolve(this.errors);
-          });
-        });
-      });
-    });
-  },
-
-  _parseManifest: function ACU__parseManifest(uriInfo) {
-    return new Promise((resolve, reject) => {
-      const manifestName = uriInfo.name;
-      const manifestLastModified = new Date(uriInfo.responseHeaders["last-modified"]);
-
-      if (uriInfo.charset.toLowerCase() != "utf-8") {
-        this._addError(0, "notUTF8", uriInfo.charset);
-      }
-
-      if (uriInfo.mimeType != "text/cache-manifest") {
-        this._addError(0, "badMimeType", uriInfo.mimeType);
-      }
-
-      const parser = new ManifestParser(uriInfo.text, this.manifestURI);
-      const parsed = parser.parse();
-
-      if (parsed.errors.length > 0) {
-        this.errors.push.apply(this.errors, parsed.errors);
-      }
-
-      // Check for duplicate entries.
-      const dupes = {};
-      for (const parsedUri of parsed.uris) {
-        dupes[parsedUri.uri] = dupes[parsedUri.uri] || [];
-        dupes[parsedUri.uri].push({
-          line: parsedUri.line,
-          section: parsedUri.section,
-          original: parsedUri.original
-        });
-      }
-      for (const [uri, value] of Object.entries(dupes)) {
-        if (value.length > 1) {
-          this._addError(0, "duplicateURI", uri, JSON.stringify(value));
-        }
-      }
-
-      // Loop through network entries making sure that fallback and cache don't
-      // contain uris starting with the network uri.
-      for (const neturi of parsed.uris) {
-        if (neturi.section == "NETWORK") {
-          for (const parsedUri of parsed.uris) {
-            if (parsedUri.section !== "NETWORK" &&
-                parsedUri.uri.startsWith(neturi.uri)) {
-              this._addError(neturi.line, "networkBlocksURI", neturi.line,
-                             neturi.original, parsedUri.line, parsedUri.original,
-                             parsedUri.section);
-            }
-          }
-        }
-      }
-
-      // Loop through fallback entries making sure that fallback and cache don't
-      // contain uris starting with the network uri.
-      for (const fb of parsed.fallbacks) {
-        for (const parsedUri of parsed.uris) {
-          if (parsedUri.uri.startsWith(fb.namespace)) {
-            this._addError(fb.line, "fallbackBlocksURI", fb.line,
-                           fb.original, parsedUri.line, parsedUri.original,
-                           parsedUri.section);
-          }
-        }
-      }
-
-      // Check that all resources exist and that their cach-control headers are
-      // not set to no-store.
-      let current = -1;
-      for (let i = 0, len = parsed.uris.length; i < len; i++) {
-        const parsedUri = parsed.uris[i];
-        this._getURIInfo(parsedUri.uri).then(uriInfo => {
-          current++;
-
-          if (uriInfo.success) {
-            // Check that the resource was not modified after the manifest was last
-            // modified. If it was then the manifest file should be refreshed.
-            const resourceLastModified =
-              new Date(uriInfo.responseHeaders["last-modified"]);
-
-            if (manifestLastModified < resourceLastModified) {
-              this._addError(parsedUri.line, "fileChangedButNotManifest",
-                             uriInfo.name, manifestName, parsedUri.line);
-            }
-
-            // If cache-control: no-store the file will not be added to the
-            // appCache.
-            if (uriInfo.nocache) {
-              this._addError(parsedUri.line, "cacheControlNoStore",
-                             parsedUri.original, parsedUri.line);
-            }
-          } else if (parsedUri.original !== "*") {
-            this._addError(parsedUri.line, "notAvailable",
-                           parsedUri.original, parsedUri.line);
-          }
-
-          if (current == len - 1) {
-            resolve();
-          }
-        });
-      }
-    });
-  },
-
-  _getURIInfo: function ACU__getURIInfo(uri) {
-    return new Promise((resolve, reject) => {
-      const inputStream = Cc["@mozilla.org/scriptableinputstream;1"]
-                          .createInstance(Ci.nsIScriptableInputStream);
-      let buffer = "";
-      const channel = NetUtil.newChannel({
-        uri: uri,
-        loadUsingSystemPrincipal: true,
-        securityFlags: Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL
-      });
-
-      // Avoid the cache:
-      channel.loadFlags |= Ci.nsIRequest.LOAD_BYPASS_CACHE;
-      channel.loadFlags |= Ci.nsIRequest.INHIBIT_CACHING;
-
-      channel.asyncOpen2({
-        onStartRequest: function(request, context) {
-          // This empty method is needed in order for onDataAvailable to be
-          // called.
-        },
-
-        onDataAvailable: function(request, context, stream, offset, count) {
-          request.QueryInterface(Ci.nsIHttpChannel);
-          inputStream.init(stream);
-          buffer = buffer.concat(inputStream.read(count));
-        },
-
-        onStopRequest: function onStartRequest(request, context, statusCode) {
-          if (statusCode === 0) {
-            request.QueryInterface(Ci.nsIHttpChannel);
-
-            const result = {
-              name: request.name,
-              success: request.requestSucceeded,
-              status: request.responseStatus + " - " + request.responseStatusText,
-              charset: request.contentCharset || "utf-8",
-              mimeType: request.contentType,
-              contentLength: request.contentLength,
-              nocache: request.isNoCacheResponse() || request.isNoStoreResponse(),
-              prePath: request.URI.prePath + "/",
-              text: buffer
-            };
-
-            result.requestHeaders = {};
-            request.visitRequestHeaders(function(header, value) {
-              result.requestHeaders[header.toLowerCase()] = value;
-            });
-
-            result.responseHeaders = {};
-            request.visitResponseHeaders(function(header, value) {
-              result.responseHeaders[header.toLowerCase()] = value;
-            });
-
-            resolve(result);
-          } else {
-            resolve({
-              name: request.name,
-              success: false
-            });
-          }
-        }
-      });
-    });
-  },
-
-  listEntries: function ACU_show(searchTerm) {
-    if (!Services.prefs.getBoolPref("browser.cache.disk.enable")) {
-      throw new Error(l10n.GetStringFromName("cacheDisabled"));
-    }
-
-    const entries = [];
-
-    const appCacheStorage = Services.cache2.appCacheStorage(Services.loadContextInfo.default, null);
-    appCacheStorage.asyncVisitStorage({
-      onCacheStorageInfo: function() {},
-
-      onCacheEntryInfo: function(aURI, aIdEnhance, aDataSize, aFetchCount, aLastModifiedTime, aExpirationTime) {
-        const lowerKey = aURI.asciiSpec.toLowerCase();
-
-        if (searchTerm && !lowerKey.includes(searchTerm.toLowerCase())) {
-          return;
-        }
-
-        if (aIdEnhance) {
-          aIdEnhance += ":";
-        }
-
-        const entry = {
-          "deviceID": "offline",
-          "key": aIdEnhance + aURI.asciiSpec,
-          "fetchCount": aFetchCount,
-          "lastFetched": null,
-          "lastModified": new Date(aLastModifiedTime * 1000),
-          "expirationTime": new Date(aExpirationTime * 1000),
-          "dataSize": aDataSize
-        };
-
-        entries.push(entry);
-        return true;
-      }
-    }, true);
-
-    if (entries.length === 0) {
-      throw new Error(l10n.GetStringFromName("noResults"));
-    }
-    return entries;
-  },
-
-  viewEntry: function ACU_viewEntry(key) {
-    const win = Services.wm.getMostRecentWindow(gDevTools.chromeWindowType);
-    const url = "about:cache-entry?storage=appcache&context=&eid=&uri=" + key;
-    win.openTrustedLinkIn(url, "tab");
-  },
-
-  clearAll: function ACU_clearAll() {
-    if (!Services.prefs.getBoolPref("browser.cache.disk.enable")) {
-      throw new Error(l10n.GetStringFromName("cacheDisabled"));
-    }
-
-    const appCacheStorage = Services.cache2.appCacheStorage(Services.loadContextInfo.default, null);
-    appCacheStorage.asyncEvictStorage({
-      onCacheEntryDoomed: function(result) {}
-    });
-  },
-
-  _getManifestURI: function ACU__getManifestURI() {
-    return new Promise((resolve, reject) => {
-      const getURI = () => {
-        const htmlNode = this.doc.querySelector("html[manifest]");
-        if (htmlNode) {
-          const pageUri = this.doc.location ? this.doc.location.href : this.uri;
-          const manifestURI = htmlNode.getAttribute("manifest");
-
-          const originRegExp = new RegExp(/([a-z]*:\/\/[^/]*\/)/);
-          if (originRegExp.test(manifestURI)) {
-            return manifestURI;
-          } else if (manifestURI.startsWith("/")) {
-            return pageUri.match(originRegExp)[0] + manifestURI.substring(1);
-          }
-
-          return pageUri.substring(0, pageUri.lastIndexOf("/") + 1) + manifestURI;
-        }
-      };
-
-      if (this.doc) {
-        const uri = getURI();
-        return resolve(uri);
-      }
-      this._getURIInfo(this.uri).then(uriInfo => {
-        if (uriInfo.success) {
-          const html = uriInfo.text;
-          const parser = _DOMParser;
-          this.doc = parser.parseFromString(html, "text/html");
-          const uri = getURI();
-          resolve(uri);
-        } else {
-          this.errors.push({
-              line: 0,
-              msg: l10n.GetStringFromName("invalidURI")
-          });
-        }
-      });
-    });
-  },
-
-  _addError: function ACU__addError(line, l10nString, ...params) {
-    let msg;
-
-    if (params) {
-      msg = l10n.formatStringFromName(l10nString, params, params.length);
-    } else {
-      msg = l10n.GetStringFromName(l10nString);
-    }
-
-    this.errors.push({
-      line: line,
-      msg: msg
-    });
-  },
-};
-
-/**
- * We use our own custom parser because we need far more detailed information
- * than the system manifest parser provides.
- *
- * @param {String} manifestText
- *        The text content of the manifest file.
- * @param {String} manifestURI
- *        The URI of the manifest file. This is used in calculating the path of
- *        relative URIs.
- */
-function ManifestParser(manifestText, manifestURI) {
-  this.manifestText = manifestText;
-  this.origin = manifestURI.substr(0, manifestURI.lastIndexOf("/") + 1)
-                           .replace(" ", "%20");
-}
-
-ManifestParser.prototype = {
-  parse: function OCIMP_parse() {
-    const lines = this.manifestText.split(/\r?\n/);
-    const fallbacks = this.fallbacks = [];
-    const settings = this.settings = [];
-    const errors = this.errors = [];
-    const uris = this.uris = [];
-
-    this.currSection = "CACHE";
-
-    for (let i = 0; i < lines.length; i++) {
-      const text = this.text = lines[i].trim();
-      this.currentLine = i + 1;
-
-      if (i === 0 && text !== "CACHE MANIFEST") {
-        this._addError(1, "firstLineMustBeCacheManifest", 1);
-      }
-
-      // Ignore comments
-      if (/^#/.test(text) || !text.length) {
-        continue;
-      }
-
-      if (text == "CACHE MANIFEST") {
-        if (this.currentLine != 1) {
-          this._addError(this.currentLine, "cacheManifestOnlyFirstLine2",
-                         this.currentLine);
-        }
-        continue;
-      }
-
-      if (this._maybeUpdateSectionName()) {
-        continue;
-      }
-
-      switch (this.currSection) {
-        case "CACHE":
-        case "NETWORK":
-          this.parseLine();
-          break;
-        case "FALLBACK":
-          this.parseFallbackLine();
-          break;
-        case "SETTINGS":
-          this.parseSettingsLine();
-          break;
-      }
-    }
-
-    return {
-      uris: uris,
-      fallbacks: fallbacks,
-      settings: settings,
-      errors: errors
-    };
-  },
-
-  parseLine: function OCIMP_parseLine() {
-    let text = this.text;
-
-    if (text.includes("*")) {
-      if (this.currSection != "NETWORK" || text.length != 1) {
-        this._addError(this.currentLine, "asteriskInWrongSection2",
-                       this.currSection, this.currentLine);
-        return;
-      }
-    }
-
-    if (/\s/.test(text)) {
-      this._addError(this.currentLine, "escapeSpaces1", this.currentLine);
-      text = text.replace(/\s/g, "%20");
-    }
-
-    if (text[0] == "/") {
-      if (text.substr(0, 4) == "/../") {
-        this._addError(this.currentLine, "slashDotDotSlashBad", this.currentLine);
-      } else {
-        this.uris.push(this._wrapURI(this.origin + text.substring(1)));
-      }
-    } else if (text.substr(0, 2) == "./") {
-      this.uris.push(this._wrapURI(this.origin + text.substring(2)));
-    } else if (text.substr(0, 4) == "http") {
-      this.uris.push(this._wrapURI(text));
-    } else {
-      let origin = this.origin;
-      let path = text;
-
-      while (path.substr(0, 3) == "../" && /^https?:\/\/.*?\/.*?\//.test(origin)) {
-        const trimIdx = origin.substr(0, origin.length - 1).lastIndexOf("/") + 1;
-        origin = origin.substr(0, trimIdx);
-        path = path.substr(3);
-      }
-
-      if (path.substr(0, 3) == "../") {
-        this._addError(this.currentLine, "tooManyDotDotSlashes", this.currentLine);
-        return;
-      }
-
-      if (/^https?:\/\//.test(path)) {
-        this.uris.push(this._wrapURI(path));
-        return;
-      }
-      this.uris.push(this._wrapURI(origin + path));
-    }
-  },
-
-  parseFallbackLine: function OCIMP_parseFallbackLine() {
-    const split = this.text.split(/\s+/);
-    const origURI = this.text;
-
-    if (split.length != 2) {
-      this._addError(this.currentLine, "fallbackUseSpaces", this.currentLine);
-      return;
-    }
-
-    let [ namespace, fallback ] = split;
-
-    if (namespace.includes("*")) {
-      this._addError(this.currentLine, "fallbackAsterisk2", this.currentLine);
-    }
-
-    if (/\s/.test(namespace)) {
-      this._addError(this.currentLine, "escapeSpaces1", this.currentLine);
-      namespace = namespace.replace(/\s/g, "%20");
-    }
-
-    if (namespace.substr(0, 4) == "/../") {
-      this._addError(this.currentLine, "slashDotDotSlashBad", this.currentLine);
-    }
-
-    if (namespace.substr(0, 2) == "./") {
-      namespace = this.origin + namespace.substring(2);
-    }
-
-    if (namespace.substr(0, 4) != "http") {
-      let origin = this.origin;
-      let path = namespace;
-
-      while (path.substr(0, 3) == "../" && /^https?:\/\/.*?\/.*?\//.test(origin)) {
-        const trimIdx = origin.substr(0, origin.length - 1).lastIndexOf("/") + 1;
-        origin = origin.substr(0, trimIdx);
-        path = path.substr(3);
-      }
-
-      if (path.substr(0, 3) == "../") {
-        this._addError(this.currentLine, "tooManyDotDotSlashes", this.currentLine);
-      }
-
-      if (/^https?:\/\//.test(path)) {
-        namespace = path;
-      } else {
-        if (path[0] == "/") {
-          path = path.substring(1);
-        }
-        namespace = origin + path;
-      }
-    }
-
-    this.text = fallback;
-    this.parseLine();
-
-    this.fallbacks.push({
-      line: this.currentLine,
-      original: origURI,
-      namespace: namespace,
-      fallback: fallback
-    });
-  },
-
-  parseSettingsLine: function OCIMP_parseSettingsLine() {
-    const text = this.text;
-
-    if (this.settings.length == 1 || !/prefer-online|fast/.test(text)) {
-      this._addError(this.currentLine, "settingsBadValue", this.currentLine);
-      return;
-    }
-
-    switch (text) {
-      case "prefer-online":
-        this.settings.push(this._wrapURI(text));
-        break;
-      case "fast":
-        this.settings.push(this._wrapURI(text));
-        break;
-    }
-  },
-
-  _wrapURI: function OCIMP__wrapURI(uri) {
-    return {
-      section: this.currSection,
-      line: this.currentLine,
-      uri: uri,
-      original: this.text
-    };
-  },
-
-  _addError: function OCIMP__addError(line, l10nString, ...params) {
-    let msg;
-
-    if (params) {
-      msg = l10n.formatStringFromName(l10nString, params, params.length);
-    } else {
-      msg = l10n.GetStringFromName(l10nString);
-    }
-
-    this.errors.push({
-      line: line,
-      msg: msg
-    });
-  },
-
-  _maybeUpdateSectionName: function OCIMP__maybeUpdateSectionName() {
-    let text = this.text;
-
-    if (text == text.toUpperCase() && text.charAt(text.length - 1) == ":") {
-      text = text.substr(0, text.length - 1);
-
-      switch (text) {
-        case "CACHE":
-        case "NETWORK":
-        case "FALLBACK":
-        case "SETTINGS":
-          this.currSection = text;
-          return true;
-        default:
-          this._addError(this.currentLine,
-                         "invalidSectionName", text, this.currentLine);
-          return false;
-      }
-    }
-  },
-};
-
-XPCOMUtils.defineLazyGetter(this, "l10n", () => Services.strings
-  .createBundle("chrome://devtools/locale/appcacheutils.properties"));
-
-XPCOMUtils.defineLazyGetter(this, "_DOMParser", function() {
-  return globals.DOMParser();
-});
--- a/devtools/client/shared/moz.build
+++ b/devtools/client/shared/moz.build
@@ -15,17 +15,16 @@ DIRS += [
     'redux',
     'source-map',
     'vendor',
     'webpack',
     'widgets',
 ]
 
 DevToolsModules(
-    'AppCacheUtils.jsm',
     'autocomplete-popup.js',
     'browser-loader.js',
     'css-angle.js',
     'curl.js',
     'demangle.js',
     'developer-toolbar.js',
     'devices.js',
     'DOMHelpers.jsm',