| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 'use strict'; | 4 'use strict'; |
| 5 const fs = require('fs'); | 5 const fs = require('fs'); |
| 6 const path = require('path'); | 6 const path = require('path'); |
| 7 | 7 |
| 8 const utils = require('../utils'); | 8 const utils = require('../utils'); |
| 9 | 9 |
| 10 const FRONTEND_PATH = path.resolve(__dirname, '..', '..', 'front_end'); | 10 const FRONTEND_PATH = path.resolve(__dirname, '..', '..', 'front_end'); |
| 11 const BUILD_GN_PATH = path.resolve(__dirname, '..', '..', 'BUILD.gn'); | 11 const BUILD_GN_PATH = path.resolve(__dirname, '..', '..', 'BUILD.gn'); |
| 12 const SPECIAL_CASE_NAMESPACES_PATH = path.resolve(__dirname, '..', 'special_case
_namespaces.json'); | 12 const SPECIAL_CASE_NAMESPACES_PATH = path.resolve(__dirname, '..', 'special_case
_namespaces.json'); |
| 13 | 13 |
| 14 const APPLICATION_DESCRIPTORS = [ | 14 const APPLICATION_DESCRIPTORS = [ |
| 15 'inspector.json', | 15 'inspector.json', |
| 16 'toolbox.json', | 16 'toolbox.json', |
| 17 'unit_test_runner.json', | 17 'unit_test_runner.json', |
| 18 'formatter_worker.json', | 18 'formatter_worker.json', |
| 19 'heap_snapshot_worker.json', | 19 'heap_snapshot_worker.json', |
| 20 'utility_shared_worker.json', | 20 'utility_shared_worker.json', |
| 21 ]; | 21 ]; |
| 22 | 22 |
| 23 // Replace based on specified transformation | 23 // Replace based on specified transformation |
| 24 const MODULES_TO_REMOVE = []; | 24 const MODULES_TO_REMOVE = []; |
| 25 | 25 |
| 26 const JS_FILES_MAPPING = [ | 26 const JS_FILES_MAPPING = [ |
| 27 {file: 'sdk/NetworkLog.js', new: 'network_log'}, | 27 {file: 'common/Text.js', new: 'text_utils'}, |
| 28 {file: 'sdk/HAREntry.js', new: 'network_log'}, | 28 {file: 'common/TextUtils.js', new: 'text_utils'}, |
| 29 {file: 'common/TextRange.js', new: 'text_utils'}, |
| 29 ]; | 30 ]; |
| 30 | 31 |
| 31 const MODULE_MAPPING = { | 32 const MODULE_MAPPING = { |
| 32 network_log: { | 33 text_utils: { |
| 33 dependencies: ['sdk'], | 34 dependencies: [], |
| 34 dependents: ['audits', 'components', 'console_model', 'extensions', 'main',
'network'], | 35 dependents: ['common'], |
| 35 applications: ['inspector.json'], | 36 applications: ['inspector.json'], |
| 36 autostart: true, // set to autostart because of extensions | 37 autostart: true, // set to autostart because of extensions |
| 37 }, | 38 }, |
| 38 }; | 39 }; |
| 39 | 40 |
| 40 const NEW_DEPENDENCIES_BY_EXISTING_MODULES = { | 41 const NEW_DEPENDENCIES_BY_EXISTING_MODULES = { |
| 41 // resources: ['components'], | 42 // resources: ['components'], |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 const REMOVE_DEPENDENCIES_BY_EXISTING_MODULES = {}; | 45 const REMOVE_DEPENDENCIES_BY_EXISTING_MODULES = {}; |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 return string.split('') | 680 return string.split('') |
| 680 .map(function(char) { | 681 .map(function(char) { |
| 681 var charCode = char.charCodeAt(0); | 682 var charCode = char.charCodeAt(0); |
| 682 return charCode > 127 ? unicodeCharEscape(charCode) : char; | 683 return charCode > 127 ? unicodeCharEscape(charCode) : char; |
| 683 }) | 684 }) |
| 684 .join(''); | 685 .join(''); |
| 685 } | 686 } |
| 686 | 687 |
| 687 if (require.main === module) | 688 if (require.main === module) |
| 688 extractModule(); | 689 extractModule(); |
| OLD | NEW |