resolvePDFFile(file, callback) {
    // Expand drive:-URLs to filesystem URLs (Chrome OS)
    file = file.replace(
      /^drive:/i,
      "filesystem:" + location.origin + "/external/"
    );

    if (/^https?:/.test(file)) {
      // Assumption: The file being opened is the file that was requested.
      // There is no UI to input a different URL, so this assumption will hold
      // for now.
      setReferer(file, function () {
        callback(file);
      });
      return;
    }
    if (/^file?:/.test(file)) {
      getEmbedderOrigin(function (origin) {
        // If the origin cannot be determined, let Chrome decide whether to
        // allow embedding files. Otherwise, only allow local files to be
        // embedded from local files or Chrome extensions.
        // Even without this check, the file load in frames is still blocked,
        // but this may change in the future (https://crbug.com/550151).
        if (origin && !/^file:|^chrome-extension:/.test(origin)) {
          viewerApp._documentError(null, {
            message:
              `Blocked ${origin} from loading ${file}. Refused to load ` +
              "a local file in a non-local page for security reasons.",
          });
          return;
        }
        isAllowedFileSchemeAccess(function (isAllowedAccess) {
          if (isAllowedAccess) {
            callback(file);
          } else {
            requestAccessToLocalFile(file, viewerApp.overlayManager, callback);
          }
        });
      });
      return;
    }
    callback(file);
  }
Resolves a PDF file path and attempts to detects length.

@param {string} file - Absolute URL of PDF file.
@param {Function} callback - A callback with resolved URL and file length.