Bug 1507709 - Move WebExtensions geckoProfiler API to toolkit. r=kmag

Differential Revision: https://phabricator.services.mozilla.com/D12100

--HG--
rename : browser/components/extensions/ProfilerGetSymbols-worker.js => toolkit/components/extensions/ProfilerGetSymbols-worker.js
rename : browser/components/extensions/ProfilerGetSymbols.jsm => toolkit/components/extensions/ProfilerGetSymbols.jsm
rename : browser/components/extensions/parent/ext-geckoProfiler.js => toolkit/components/extensions/parent/ext-geckoProfiler.js
rename : browser/components/extensions/profiler_get_symbols.js => toolkit/components/extensions/profiler_get_symbols.js
rename : browser/components/extensions/schemas/geckoProfiler.json => toolkit/components/extensions/schemas/geckoProfiler.json
rename : browser/components/extensions/test/xpcshell/test_ext_geckoProfiler_control.js => toolkit/components/extensions/test/xpcshell/test_ext_geckoProfiler_control.js
rename : browser/components/extensions/test/xpcshell/test_ext_geckoProfiler_schema.js => toolkit/components/extensions/test/xpcshell/test_ext_geckoProfiler_schema.js
extra : moz-landing-system : lando
This commit is contained in:
Philipp Kewisch 2019-03-22 13:18:01 +00:00
parent ef4fa82ab2
commit 52aa5b978e
21 changed files with 27 additions and 16 deletions

View file

@ -57,8 +57,6 @@ browser/components/sessionstore/test/unit/data/sessionstore_invalid.js
# for documentation purposes (policies.json) but to be accessed by the
# code as a .jsm (schema.jsm)
browser/components/enterprisepolicies/schemas/schema.jsm
# Ignore generated code from wasm-bindgen
browser/components/extensions/profiler_get_symbols.js
# generated & special files in cld2
browser/components/translation/cld2/**
# Screenshots is imported as a system add-on and has
@ -362,3 +360,6 @@ tools/tryselect/selectors/chooser/templates/chooser.html
# Third party
toolkit/modules/third_party/**
third_party/**
# Ignore generated code from wasm-bindgen
toolkit/components/extensions/profiler_get_symbols.js

View file

@ -140,8 +140,8 @@
]
},
"geckoProfiler": {
"url": "chrome://browser/content/parent/ext-geckoProfiler.js",
"schema": "chrome://browser/content/schemas/geckoProfiler.json",
"url": "chrome://extensions/content/parent/ext-geckoProfiler.js",
"schema": "chrome://extensions/content/schemas/geckoProfiler.json",
"scopes": ["addon_parent"],
"paths": [
["geckoProfiler"]

View file

@ -24,7 +24,6 @@ browser.jar:
content/browser/parent/ext-devtools-network.js (parent/ext-devtools-network.js)
content/browser/parent/ext-devtools-panels.js (parent/ext-devtools-panels.js)
content/browser/parent/ext-find.js (parent/ext-find.js)
content/browser/parent/ext-geckoProfiler.js (parent/ext-geckoProfiler.js)
content/browser/parent/ext-history.js (parent/ext-history.js)
content/browser/parent/ext-menus.js (parent/ext-menus.js)
content/browser/parent/ext-omnibox.js (parent/ext-omnibox.js)

View file

@ -16,9 +16,6 @@ EXTRA_COMPONENTS += [
EXTRA_JS_MODULES += [
'ExtensionControlledPopup.jsm',
'ExtensionPopups.jsm',
'profiler_get_symbols.js',
'ProfilerGetSymbols-worker.js',
'ProfilerGetSymbols.jsm',
]
DIRS += ['schemas']

View file

@ -13,7 +13,6 @@ browser.jar:
content/browser/schemas/devtools_network.json
content/browser/schemas/devtools_panels.json
content/browser/schemas/find.json
content/browser/schemas/geckoProfiler.json
content/browser/schemas/history.json
content/browser/schemas/menus.json
content/browser/schemas/menus_child.json

View file

@ -6,7 +6,6 @@
[test_ext_browsingData_settings.js]
[test_ext_chrome_settings_overrides_update.js]
[test_ext_distribution_popup.js]
[test_ext_geckoProfiler_control.js]
[test_ext_history.js]
[test_ext_settings_overrides_search.js]
[test_ext_settings_overrides_search_mozParam.js]

View file

@ -16,7 +16,6 @@ dupe-manifest =
# - xpcshell-remote.ini
# For tests which should only run with both remote extensions and remote content.
[test_ext_geckoProfiler_schema.js]
[test_ext_manifest.js]
[test_ext_manifest_commands.js]
[test_ext_manifest_omnibox.js]

View file

@ -11,7 +11,7 @@ const { recordingState: {
REQUEST_TO_STOP_PROFILER,
}} = require("devtools/client/performance-new/utils");
const { OS } = require("resource://gre/modules/osfile.jsm");
const { ProfilerGetSymbols } = require("resource://app/modules/ProfilerGetSymbols.jsm");
const { ProfilerGetSymbols } = require("resource://gre/modules/ProfilerGetSymbols.jsm");
/**
* The recording state manages the current state of the recording panel.

View file

@ -5,7 +5,7 @@
"use strict";
importScripts("resource://gre/modules/osfile.jsm",
"resource://app/modules/profiler_get_symbols.js");
"resource://gre/modules/profiler_get_symbols.js");
// This worker uses the wasm module that was generated from https://github.com/mstange/profiler-get-symbols.
// See ProfilerGetSymbols.jsm for more information.

View file

@ -81,7 +81,7 @@ this.ProfilerGetSymbols = {
return new Promise((resolve, reject) => {
const worker =
new ChromeWorker("resource://app/modules/ProfilerGetSymbols-worker.js");
new ChromeWorker("resource://gre/modules/ProfilerGetSymbols-worker.js");
worker.onmessage = (e) => {
if (e.data.error) {
reject(e.data.error);

View file

@ -17,6 +17,9 @@ toolkit.jar:
content/extensions/parent/ext-dns.js (parent/ext-dns.js)
content/extensions/parent/ext-downloads.js (parent/ext-downloads.js)
content/extensions/parent/ext-extension.js (parent/ext-extension.js)
#ifndef ANDROID
content/extensions/parent/ext-geckoProfiler.js (parent/ext-geckoProfiler.js)
#endif
content/extensions/parent/ext-i18n.js (parent/ext-i18n.js)
#ifndef ANDROID
content/extensions/parent/ext-identity.js (parent/ext-identity.js)

View file

@ -36,6 +36,13 @@ EXTRA_JS_MODULES += [
'Schemas.jsm',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] != "android":
EXTRA_JS_MODULES += [
'profiler_get_symbols.js',
'ProfilerGetSymbols-worker.js',
'ProfilerGetSymbols.jsm',
]
EXTRA_COMPONENTS += [
'extensions-toolkit.manifest',
]

View file

@ -5,7 +5,7 @@
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.defineModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");
ChromeUtils.defineModuleGetter(this, "ProfilerGetSymbols", "resource://app/modules/ProfilerGetSymbols.jsm");
ChromeUtils.defineModuleGetter(this, "ProfilerGetSymbols", "resource://gre/modules/ProfilerGetSymbols.jsm");
const PREF_ASYNC_STACK = "javascript.options.asyncstack";

View file

@ -17,6 +17,9 @@ toolkit.jar:
content/extensions/schemas/extension.json
content/extensions/schemas/extension_types.json
content/extensions/schemas/extension_protocol_handlers.json
#ifndef ANDROID
content/extensions/schemas/geckoProfiler.json
#endif
content/extensions/schemas/i18n.json
#ifndef ANDROID
content/extensions/schemas/identity.json

View file

@ -60,6 +60,8 @@ fail-if = appname == "thunderbird"
[test_ext_extension_content_telemetry.js]
skip-if = os == "android" # checking for telemetry needs to be updated: 1384923
[test_ext_extension_startup_telemetry.js]
[test_ext_geckoProfiler_control.js]
skip-if = os == "android" # Not shipped on Android
[test_ext_geturl.js]
[test_ext_idle.js]
[test_ext_incognito.js]

View file

@ -33,6 +33,8 @@ tags = webextensions in-process-webextensions
[test_csp_validator.js]
[test_ext_contexts.js]
[test_ext_json_parser.js]
[test_ext_geckoProfiler_schema.js]
skip-if = os == 'android' # Not shipped on Android
[test_ext_manifest.js]
skip-if = toolkit == 'android' # browser_action icon testing not supported on android
[test_ext_manifest_content_security_policy.js]

View file

@ -117,7 +117,7 @@ class Vector;
// |MACRO| appropriately to extract the relevant parts. Note that the number
// values are used internally only and so can be changed without consequence.
// Any changes to this list should also be applied to the feature list in
// browser/components/extensions/schemas/geckoProfiler.json.
// toolkit/components/extensions/schemas/geckoProfiler.json.
# define PROFILER_FOR_EACH_FEATURE(MACRO) \
/* Profile Java code (Android only). */ \
MACRO(0, "java", Java) \