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

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

Issue 2668413003: DevTools: extract NetworkConditionsSelector into its own module (Closed)
Patch Set: rebaseline Created 3 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/module.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d6b5d00410512ed5cb995a541f87b15978fcf6a3..207a2ca4dd3f703bc3c69148bd59db615293ba36 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
@@ -24,17 +24,17 @@ const APPLICATION_DESCRIPTORS = [
const MODULES_TO_REMOVE = [];
const JS_FILES_MAPPING = [
- {file: 'common/CSSShadowModel.js', existing: 'inline_editor'}, {file: 'common/Geometry.js', existing: 'ui'},
+ {file: 'components/NetworkConditionsSelector.js', new: 'network_conditions'},
// {file: 'module/file.js', existing: 'module'}
];
const MODULE_MAPPING = {
- // heap_snapshot_model: {
- // dependencies: [],
- // dependents: ['heap_snapshot_worker', 'profiler'],
- // applications: ['inspector.json'], // need to manually add to heap snapshot worker b/c it's autostart
- // autostart: false,
- // },
+ network_conditions: {
+ dependencies: ['common', 'sdk', 'ui', 'protocol'],
+ dependents: ['emulation', 'resources', 'network', 'timeline'],
+ applications: ['inspector.json'],
+ autostart: true, // because emulation is autostart
+ },
};
const NEW_DEPENDENCIES_BY_EXISTING_MODULES = {
@@ -434,10 +434,16 @@ function removeFromExistingModuleDescriptors(modules, identifierMap, cssFilesMap
return;
let remainingExtensions = [];
for (let extension of moduleObj.extensions) {
- if (!objectIncludesIdentifier(extension))
+ if (!objectIncludesIdentifier(extension)) {
remainingExtensions.push(extension);
- else
- extensionMap.set(objectIncludesIdentifier(extension), extension);
+ } else {
+ if (extensionMap.has(objectIncludesIdentifier(extension))) {
+ let existingExtensions = extensionMap.get(objectIncludesIdentifier(extension));
+ extensionMap.set(objectIncludesIdentifier(extension), existingExtensions.concat(extension));
+ } else {
+ extensionMap.set(objectIncludesIdentifier(extension), [extension]);
+ }
+ }
}
moduleObj.extensions = remainingExtensions;
}
@@ -511,7 +517,7 @@ function createNewModuleDescriptors(extensionMap, cssFilesMapping, identifiersBy
.reduce((acc, file) => acc.concat(identifiersByFile.get(targetToOriginalFilesMap.get(file))), []);
for (let identifier of identifiers) {
if (extensionMap.has(identifier))
- extensions.push(extensionMap.get(identifier));
+ extensions = extensions.concat(extensionMap.get(identifier));
}
return extensions;
}
@@ -577,7 +583,7 @@ function updateExistingModuleDescriptors(extensionMap, cssFilesMapping, identifi
.reduce((acc, file) => acc.concat(identifiersByFile.get(targetToOriginalFilesMap.get(file))), []);
for (let identifier of identifiers) {
if (extensionMap.has(identifier))
- extensions.push(extensionMap.get(identifier));
+ extensions = extensions.concat(extensionMap.get(identifier));
}
return extensions;
}
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/module.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698