<commit_before>/* 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/. */
"use strict";

const {utils: Cu} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");

XPCOMUtils.defineLazyModuleGetter(this, "LogManager",
  "resource://shield-recipe-client/lib/LogManager.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ShieldRecipeClient",
  "resource://shield-recipe-client/lib/ShieldRecipeClient.jsm");

this.install = function() {};

this.startup = async function() {
  await ShieldRecipeClient.startup();
};

this.shutdown = function(data, reason) {
  ShieldRecipeClient.shutdown(reason);

  // Unload add-on modules. We don't do this in ShieldRecipeClient so that
  // modules are not unloaded accidentally during tests.
  const log = LogManager.getLogger("bootstrap");
  const modules = [
    "content/AboutPages.jsm",
    "lib/ActionSandboxManager.jsm",
    "lib/CleanupManager.jsm",
    "lib/ClientEnvironment.jsm",
    "lib/FilterExpressions.jsm",
    "lib/EventEmitter.jsm",
    "lib/Heartbeat.jsm",
    "lib/LogManager.jsm",
    "lib/NormandyApi.jsm",
    "lib/NormandyDriver.jsm",
    "lib/PreferenceExperiments.jsm",
    "lib/RecipeRunner.jsm",
    "lib/Sampling.jsm",
    "lib/SandboxManager.jsm",
    "lib/ShieldRecipeClient.jsm",
    "lib/Storage.jsm",
    "lib/StudyStorage.jsm",
    "lib/Uptake.jsm",
    "lib/Utils.jsm",
    "vendor/mozjexl.js",
  ];
  for (const module of modules) {
    log.debug(`Unloading ${module}`);
    Cu.unload(`resource://shield-recipe-client/${module}`);
  }
};

this.uninstall = function() {};<commit_msg>Fix module paths in unloading code in bootstrap.js.<commit_after>/* 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/. */
"use strict";

const {utils: Cu} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");

XPCOMUtils.defineLazyModuleGetter(this, "LogManager",
  "resource://shield-recipe-client/lib/LogManager.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ShieldRecipeClient",
  "resource://shield-recipe-client/lib/ShieldRecipeClient.jsm");

this.install = function() {};

this.startup = async function() {
  await ShieldRecipeClient.startup();
};

this.shutdown = function(data, reason) {
  ShieldRecipeClient.shutdown(reason);

  // Unload add-on modules. We don't do this in ShieldRecipeClient so that
  // modules are not unloaded accidentally during tests.
  const log = LogManager.getLogger("bootstrap");
  let modules = [
    "lib/ActionSandboxManager.jsm",
    "lib/CleanupManager.jsm",
    "lib/ClientEnvironment.jsm",
    "lib/FilterExpressions.jsm",
    "lib/EventEmitter.jsm",
    "lib/Heartbeat.jsm",
    "lib/LogManager.jsm",
    "lib/NormandyApi.jsm",
    "lib/NormandyDriver.jsm",
    "lib/PreferenceExperiments.jsm",
    "lib/RecipeRunner.jsm",
    "lib/Sampling.jsm",
    "lib/SandboxManager.jsm",
    "lib/ShieldRecipeClient.jsm",
    "lib/Storage.jsm",
    "lib/StudyStorage.jsm",
    "lib/Uptake.jsm",
    "lib/Utils.jsm",
    "vendor/mozjexl.js",
  ].map(m => `resource://shield-recipe-client/${m}`);
  modules = modules.concat([
    "AboutPages.jsm",
  ].map(m => `resource://shield-recipe-client-content/${m}`));

  for (const module of modules) {
    log.debug(`Unloading ${module}`);
    Cu.unload(module);
  }
};

this.uninstall = function() {};
{'fraction_non_alphanumeric': 0.15684062059238363, 'fraction_numerical': 0.002256699576868829, 'mean_word_length': 3.87757909215956, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1057674', 'n_tokens_mistral': 1261, 'n_tokens_neox': 1241, 'n_words': 237}