Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(790)

Unified Diff: third_party/WebKit/Source/devtools/scripts/extract_module/extract_module.js

Issue 2915883002: DevTools: prepare to unify Network and CPU throttling UI (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/scripts/extract_module/extract_module.js
diff --git a/third_party/WebKit/Source/devtools/scripts/extract_module/extract_module.js b/third_party/WebKit/Source/devtools/scripts/extract_module/extract_module.js
index e48ad00504858eeca545160b8eff16bf45937baa..0d41c2de3e11fd76bd814c9ed6545f7b2e2d36a7 100644
--- a/third_party/WebKit/Source/devtools/scripts/extract_module/extract_module.js
+++ b/third_party/WebKit/Source/devtools/scripts/extract_module/extract_module.js
@@ -11,6 +11,12 @@ const FRONTEND_PATH = path.resolve(__dirname, '..', '..', 'front_end');
const BUILD_GN_PATH = path.resolve(__dirname, '..', '..', 'BUILD.gn');
const SPECIAL_CASE_NAMESPACES_PATH = path.resolve(__dirname, '..', 'special_case_namespaces.json');
+/*
+ * ==========================================
+ * START EDITING HERE - TRANSFORMATION INPUTS
+ * ==========================================
+ */
+
const APPLICATION_DESCRIPTORS = [
'inspector.json',
'toolbox.json',
@@ -20,30 +26,64 @@ const APPLICATION_DESCRIPTORS = [
'utility_shared_worker.json',
];
-// Replace based on specified transformation
-const MODULES_TO_REMOVE = [];
-
+/*
+ * If the transformation removes all the files of a module:
+ * ['text_editor']
+ */
+const MODULES_TO_REMOVE = ['network_conditions'];
+
+/**
+ * If moving to a new module:
+ * {file: 'common/Text.js', new: 'a_new_module'}
+ *
+ * If moving to an existing module:
+ * {file: 'ui/SomeFile.js', existing: 'common'}
+ */
const JS_FILES_MAPPING = [
- {file: 'common/Text.js', new: 'text_utils'},
- {file: 'common/TextUtils.js', new: 'text_utils'},
- {file: 'common/TextRange.js', new: 'text_utils'},
+ {file: 'network_conditions/NetworkConditionsSelector.js', new: 'mobile_throttling'},
+ {file: 'network_conditions/NetworkConditionsSettingsTab.js', new: 'mobile_throttling'},
+ {file: 'network_conditions/NetworkPriorities.js', new: 'mobile_throttling'},
+ {file: 'components/CPUThrottlingManager.js', new: 'mobile_throttling'},
];
+/**
+ * List all new modules here:
+ * mobile_throttling: {
+ * dependencies: ['sdk'],
+ * dependents: ['console'],
+ * applications: ['inspector.json'],
+ * autostart: false,
+ * }
+ */
const MODULE_MAPPING = {
- text_utils: {
- dependencies: [],
- dependents: ['common'],
+ mobile_throttling: {
+ dependencies: ['common', 'sdk', 'ui', 'protocol'],
+ dependents: ['emulation', 'network', 'resources', 'timeline'],
applications: ['inspector.json'],
- autostart: true, // set to autostart because of extensions
+ autostart: true,
},
};
+/**
+ * If an existing module will have a new dependency on an existing module:
+ * console: ['new_dependency']
+ */
const NEW_DEPENDENCIES_BY_EXISTING_MODULES = {
// resources: ['components'],
};
+/**
+ * If an existing module will no longer have a dependency on a module:
+ * console: ['former_dependency']
+ */
const REMOVE_DEPENDENCIES_BY_EXISTING_MODULES = {};
+/*
+ * ==========================================
+ * STOP EDITING HERE
+ * ==========================================
+ */
+
const DEPENDENCIES_BY_MODULE = Object.keys(MODULE_MAPPING).reduce((acc, module) => {
acc[module] = MODULE_MAPPING[module].dependencies;
return acc;

Powered by Google App Engine
This is Rietveld 408576698