Commit e0100fb2 authored by jbroman@chromium.org's avatar jbroman@chromium.org

Revert of DevTools: Introduce module initializers (https://codereview.chromium.org/451713002/)

Reason for revert:
Breaks android_aosp bot and prevents Blink roll.

http://build.chromium.org/p/tryserver.chromium.linux/builders/android_aosp/builds/4536/steps/compile/logs/stdio

make: *** No rule to make target `out/target/product/generic/obj/GYP/shared_intermediates/resources/inspector/documentation/DocumentationView.js', needed by `out/target/product/generic/obj/GYP/shared_intermediates/devtools/devtools_resources.grd'.  Stop.


Original issue's description:
> DevTools: Introduce module initializers
> 
> For all lazy-loaded modules and workers, _module.js files are introduced, which
> importScript() all scripts for a particular module.
> 
> This allows to:
> - get rid of importScript() calls intertwined with meaningful code,
> - simplify module loading, since Runtime does not need to read the
>   module descriptor to determine the resource names.
> 
> This approach is similar to how we implement
> the CSS loading in inspector.css.
> 
> R=pfeldman, vsevik
> BUG=391566
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=179948

TBR=pfeldman@chromium.org,vsevik@chromium.org,lushnikov@chromium.org,eustas@chromium.org,apavlov@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=391566

Review URL: https://codereview.chromium.org/458753003

git-svn-id: svn://svn.chromium.org/blink/trunk@179963 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent e019a199
...@@ -23,6 +23,7 @@ function onload() ...@@ -23,6 +23,7 @@ function onload()
var test = function() var test = function()
{ {
var panel = WebInspector.inspectorView.showPanel("sources"); var panel = WebInspector.inspectorView.showPanel("sources");
var worker = new Worker("ScriptFormatterWorker.js");
var sourceFrame; var sourceFrame;
var scriptFormatter = InspectorTest.scriptFormatter(); var scriptFormatter = InspectorTest.scriptFormatter();
......
...@@ -3,7 +3,7 @@ function initialize_EditorTests() ...@@ -3,7 +3,7 @@ function initialize_EditorTests()
InspectorTest.createTestEditor = function(clientHeight, textEditorDelegate) InspectorTest.createTestEditor = function(clientHeight, textEditorDelegate)
{ {
runtime.loadModule("source_frame"); loadScript("source_frame/SourceFrame.js");
var textEditor = new WebInspector.CodeMirrorTextEditor("", textEditorDelegate || new WebInspector.TextEditorDelegate()); var textEditor = new WebInspector.CodeMirrorTextEditor("", textEditorDelegate || new WebInspector.TextEditorDelegate());
if (clientHeight) if (clientHeight)
textEditor.element.style.height = clientHeight + "px"; textEditor.element.style.height = clientHeight + "px";
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
var test = function() var test = function()
{ {
var worker = Runtime.startWorker("script_formatter_worker"); var worker = new Worker("script_formatter_worker/ScriptFormatterWorker.js");
WebInspector.inspectorView.showPanel("sources"); WebInspector.inspectorView.showPanel("sources");
InspectorTest.runTestSuite([ InspectorTest.runTestSuite([
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
var test = function() var test = function()
{ {
var worker = Runtime.startWorker("script_formatter_worker"); var worker = new Worker("script_formatter_worker/ScriptFormatterWorker.js");
var parsedScript = "function first(x,y) { }\n var second = function(y \n , \nz) { }\n Object = function(arg) {\n}\n Object.prototype.functionOnPrototype = function ( a, b , \n c, d , \n e , f ) { function innerFunction1() {\n var innerFunction2 = function(arg1,arg2) {} } }"; var parsedScript = "function first(x,y) { }\n var second = function(y \n , \nz) { }\n Object = function(arg) {\n}\n Object.prototype.functionOnPrototype = function ( a, b , \n c, d , \n e , f ) { function innerFunction1() {\n var innerFunction2 = function(arg1,arg2) {} } }";
worker.onmessage = InspectorTest.safeWrap(function(event) worker.onmessage = InspectorTest.safeWrap(function(event)
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
var test = function() var test = function()
{ {
var panel = WebInspector.panels.sources; var panel = WebInspector.panels.sources;
var worker = Runtime.startWorker("script_formatter_worker"); var worker = new Worker("script_formatter_worker/ScriptFormatterWorker.js");
InspectorTest.runDebuggerTestSuite([ InspectorTest.runDebuggerTestSuite([
function testScriptFormatterWorker(next) function testScriptFormatterWorker(next)
......
...@@ -81,22 +81,22 @@ action("generate_devtools_grd") { ...@@ -81,22 +81,22 @@ action("generate_devtools_grd") {
input_pages = [ input_pages = [
"$root_out_dir/resources/inspector/devtools.html", "$root_out_dir/resources/inspector/devtools.html",
"$root_out_dir/resources/inspector/inspector.css", "$root_out_dir/resources/inspector/inspector.css",
"$root_out_dir/resources/inspector/audits/_module.js", "$root_out_dir/resources/inspector/audits/AuditsPanel.js",
"$root_out_dir/resources/inspector/console/_module.js", "$root_out_dir/resources/inspector/console/ConsolePanel.js",
"$root_out_dir/resources/inspector/devices/_module.js", "$root_out_dir/resources/inspector/devices/DevicesView.js",
"$root_out_dir/resources/inspector/elements/_module.js", "$root_out_dir/resources/inspector/elements/ElementsPanel.js",
"$root_out_dir/resources/inspector/extensions/_module.js", "$root_out_dir/resources/inspector/extensions/ExtensionServer.js",
"$root_out_dir/resources/inspector/heap_snapshot_worker/_module.js", "$root_out_dir/resources/inspector/heap_snapshot_worker/HeapSnapshotWorker.js",
"$root_out_dir/resources/inspector/layers/_module.js", "$root_out_dir/resources/inspector/layers/LayersPanel.js",
"$root_out_dir/resources/inspector/main/Main.js", "$root_out_dir/resources/inspector/main/Main.js",
"$root_out_dir/resources/inspector/network/_module.js", "$root_out_dir/resources/inspector/network/NetworkPanel.js",
"$root_out_dir/resources/inspector/profiler/_module.js", "$root_out_dir/resources/inspector/profiler/ProfilesPanel.js",
"$root_out_dir/resources/inspector/resources/_module.js", "$root_out_dir/resources/inspector/resources/ResourcesPanel.js",
"$root_out_dir/resources/inspector/script_formatter_worker/_module.js", "$root_out_dir/resources/inspector/script_formatter_worker/ScriptFormatterWorker.js",
"$root_out_dir/resources/inspector/source_frame/_module.js", "$root_out_dir/resources/inspector/source_frame/SourceFrame.js",
"$root_out_dir/resources/inspector/sources/_module.js", "$root_out_dir/resources/inspector/sources/SourcesPanel.js",
"$root_out_dir/resources/inspector/temp_storage_shared_worker/_module.js", "$root_out_dir/resources/inspector/temp_storage_shared_worker/TempStorageSharedWorker.js",
"$root_out_dir/resources/inspector/timeline/_module.js", "$root_out_dir/resources/inspector/timeline/TimelinePanel.js",
"$root_out_dir/resources/inspector/devtools_extension_api.js", "$root_out_dir/resources/inspector/devtools_extension_api.js",
] + gypi_values.devtools_standalone_files + gypi_values.devtools_cm_css_files ] + gypi_values.devtools_standalone_files + gypi_values.devtools_cm_css_files
...@@ -182,37 +182,37 @@ action("frontend_protocol_sources") { ...@@ -182,37 +182,37 @@ action("frontend_protocol_sources") {
} }
# Runs the inline_js_imports script. # Runs the inline_js_imports script.
# module_name: (String) The JS module name to process. # input: (String) The input .js file to read.
# imported_files: (List of strings) The list of files the input depends on. # imported_files: (List of strings) The list of files the input depends on.
# output: (String) The .js file to write.
template("inline_js_imports") { template("inline_js_imports") {
assert(defined(invoker.module_name), target_name) assert(defined(invoker.input), target_name)
assert(defined(invoker.imported_files), target_name) assert(defined(invoker.imported_files), target_name)
assert(defined(invoker.output), target_name)
action(target_name) { action(target_name) {
script = "scripts/inline_js_imports.py" script = "scripts/inline_js_imports.py"
module_name = invoker.module_name
input = "front_end/" + module_name + "/_module.js" inputs = [ invoker.input ] + invoker.imported_files
inputs = [ input ] + invoker.imported_files outputs = [ invoker.output ]
output = "$root_out_dir/resources/inspector/" + module_name + "/_module.js"
outputs = [ output ]
args = [ args = [
rebase_path(input, root_build_dir), rebase_path(invoker.input, root_build_dir),
rebase_path(output, root_build_dir), rebase_path(invoker.output, root_build_dir),
] ]
} }
} }
inline_js_imports("build_audits_module") { inline_js_imports("build_audits_module") {
module_name = "audits" input = "front_end/audits/AuditsPanel.js"
imported_files = gypi_values.devtools_audits_js_files imported_files = gypi_values.devtools_audits_js_files
output = "$root_out_dir/resources/inspector/audits/AuditsPanel.js"
} }
inline_js_imports("build_console_module") { inline_js_imports("build_console_module") {
module_name = "console" input = "front_end/console/ConsolePanel.js"
imported_files = gypi_values.devtools_console_js_files imported_files = gypi_values.devtools_console_js_files
output = "$root_out_dir/resources/inspector/console/ConsolePanel.js"
} }
action("build_core_module") { action("build_core_module") {
...@@ -248,79 +248,94 @@ action("build_core_module") { ...@@ -248,79 +248,94 @@ action("build_core_module") {
} }
inline_js_imports("build_devices_module") { inline_js_imports("build_devices_module") {
module_name = "devices" input = "front_end/devices/DevicesView.js"
imported_files = gypi_values.devtools_devices_js_files imported_files = gypi_values.devtools_devices_js_files
output = "$root_out_dir/resources/inspector/devices/DevicesView.js"
} }
inline_js_imports("build_documentation_module") { inline_js_imports("build_documentation_module") {
module_name = "documentation" input = "front_end/documentation/DocumentationView.js"
imported_files = gypi_values.devtools_documentation_js_files imported_files = gypi_values.devtools_documentation_js_files
output = "$root_out_dir/resources/inspector/documentation/DocumentationView.js"
} }
inline_js_imports("build_elements_module") { inline_js_imports("build_elements_module") {
module_name = "elements" input = "front_end/elements/ElementsPanel.js"
imported_files = gypi_values.devtools_elements_js_files imported_files = gypi_values.devtools_elements_js_files
output = "$root_out_dir/resources/inspector/elements/ElementsPanel.js"
} }
inline_js_imports("build_extensions_module") { inline_js_imports("build_extensions_module") {
module_name = "extensions" input = "front_end/extensions/ExtensionServer.js"
imported_files = devtools_extensions_js_files imported_files = devtools_extensions_js_files
output = "$root_out_dir/resources/inspector/extensions/ExtensionServer.js"
} }
inline_js_imports("build_heap_snapshot_worker_module") { inline_js_imports("build_heap_snapshot_worker_module") {
module_name = "heap_snapshot_worker" input = "front_end/heap_snapshot_worker/HeapSnapshotWorker.js"
imported_files = gypi_values.devtools_heap_snapshot_worker_js_files imported_files = gypi_values.devtools_heap_snapshot_worker_js_files
output = "$root_out_dir/resources/inspector/heap_snapshot_worker/HeapSnapshotWorker.js"
} }
inline_js_imports("build_layers_module") { inline_js_imports("build_layers_module") {
module_name = "layers" input = "front_end/layers/LayersPanel.js"
imported_files = gypi_values.devtools_layers_js_files imported_files = gypi_values.devtools_layers_js_files
output = "$root_out_dir/resources/inspector/layers/LayersPanel.js"
} }
inline_js_imports("build_network_module") { inline_js_imports("build_network_module") {
module_name = "network" input = "front_end/network/NetworkPanel.js"
imported_files = gypi_values.devtools_network_js_files imported_files = gypi_values.devtools_network_js_files
output = "$root_out_dir/resources/inspector/network/NetworkPanel.js"
} }
inline_js_imports("build_profiler_module") { inline_js_imports("build_profiler_module") {
module_name = "profiler" input = "front_end/profiler/ProfilesPanel.js"
imported_files = gypi_values.devtools_profiler_js_files imported_files = gypi_values.devtools_profiler_js_files
output = "$root_out_dir/resources/inspector/profiler/ProfilesPanel.js"
} }
inline_js_imports("build_resources_module") { inline_js_imports("build_resources_module") {
module_name = "resources" input = "front_end/resources/ResourcesPanel.js"
imported_files = gypi_values.devtools_resources_js_files imported_files = gypi_values.devtools_resources_js_files
output = "$root_out_dir/resources/inspector/resources/ResourcesPanel.js"
} }
inline_js_imports("build_script_formatter_worker_module") { inline_js_imports("build_script_formatter_worker_module") {
module_name = "script_formatter_worker" input = "front_end/script_formatter_worker/ScriptFormatterWorker.js"
imported_files = gypi_values.devtools_uglify_files imported_files = gypi_values.devtools_uglify_files
output = "$root_out_dir/resources/inspector/script_formatter_worker/ScriptFormatterWorker.js"
} }
inline_js_imports("build_settings_module") { inline_js_imports("build_settings_module") {
module_name = "settings" input = "front_end/settings/SettingsScreen.js"
imported_files = gypi_values.devtools_settings_js_files imported_files = gypi_values.devtools_settings_js_files
output = "$root_out_dir/resources/inspector/settings/SettingsScreen.js"
} }
inline_js_imports("build_source_frame_module") { inline_js_imports("build_source_frame_module") {
module_name = "source_frame" input = "front_end/source_frame/SourceFrame.js"
imported_files = gypi_values.devtools_source_frame_js_files + imported_files = gypi_values.devtools_source_frame_js_files +
gypi_values.devtools_cm_js_files gypi_values.devtools_cm_js_files
output = "$root_out_dir/resources/inspector/source_frame/SourceFrame.js"
} }
inline_js_imports("build_sources_module") { inline_js_imports("build_sources_module") {
module_name = "sources" input = "front_end/sources/SourcesPanel.js"
imported_files = gypi_values.devtools_sources_js_files imported_files = gypi_values.devtools_sources_js_files
output = "$root_out_dir/resources/inspector/sources/SourcesPanel.js"
} }
inline_js_imports("build_temp_storage_shared_worker_module") { inline_js_imports("build_temp_storage_shared_worker_module") {
module_name = "temp_storage_shared_worker" input = "front_end/temp_storage_shared_worker/TempStorageSharedWorker.js"
imported_files = gypi_values.devtools_temp_storage_shared_worker_js_files imported_files = gypi_values.devtools_temp_storage_shared_worker_js_files
output = "$root_out_dir/resources/inspector/temp_storage_shared_worker/TempStorageSharedWorker.js"
} }
inline_js_imports("build_timeline_module") { inline_js_imports("build_timeline_module") {
module_name = "timeline" input = "front_end/timeline/TimelinePanel.js"
imported_files = gypi_values.devtools_timeline_js_files imported_files = gypi_values.devtools_timeline_js_files
output = "$root_out_dir/resources/inspector/timeline/TimelinePanel.js"
} }
action("concatenated_module_descriptors") { action("concatenated_module_descriptors") {
......
...@@ -303,7 +303,6 @@ ...@@ -303,7 +303,6 @@
# Lazy-loaded modules. # Lazy-loaded modules.
'devtools_audits_js_files': [ 'devtools_audits_js_files': [
'front_end/audits/_module.js',
'front_end/audits/AuditCategories.js', 'front_end/audits/AuditCategories.js',
'front_end/audits/AuditCategory.js', 'front_end/audits/AuditCategory.js',
'front_end/audits/AuditController.js', 'front_end/audits/AuditController.js',
...@@ -314,17 +313,14 @@ ...@@ -314,17 +313,14 @@
'front_end/audits/AuditsPanel.js', 'front_end/audits/AuditsPanel.js',
], ],
'devtools_console_js_files': [ 'devtools_console_js_files': [
'front_end/console/_module.js',
'front_end/console/ConsolePanel.js', 'front_end/console/ConsolePanel.js',
'front_end/console/ConsoleView.js', 'front_end/console/ConsoleView.js',
'front_end/console/ConsoleViewMessage.js', 'front_end/console/ConsoleViewMessage.js',
], ],
'devtools_devices_js_files': [ 'devtools_devices_js_files': [
'front_end/devices/_module.js',
'front_end/devices/DevicesView.js', 'front_end/devices/DevicesView.js',
], ],
'devtools_documentation_js_files': [ 'devtools_documentation_js_files': [
'front_end/documentation/_module.js',
'front_end/documentation/CSSArticle.js', 'front_end/documentation/CSSArticle.js',
'front_end/documentation/DocumentationURLProvider.js', 'front_end/documentation/DocumentationURLProvider.js',
'front_end/documentation/DocumentationView.js', 'front_end/documentation/DocumentationView.js',
...@@ -332,7 +328,6 @@ ...@@ -332,7 +328,6 @@
'front_end/documentation/WikiParser.js', 'front_end/documentation/WikiParser.js',
], ],
'devtools_elements_js_files': [ 'devtools_elements_js_files': [
'front_end/elements/_module.js',
'front_end/elements/DOMSyntaxHighlighter.js', 'front_end/elements/DOMSyntaxHighlighter.js',
'front_end/elements/ElementsPanel.js', 'front_end/elements/ElementsPanel.js',
'front_end/elements/ElementsTreeOutline.js', 'front_end/elements/ElementsTreeOutline.js',
...@@ -344,7 +339,6 @@ ...@@ -344,7 +339,6 @@
'front_end/elements/StylesSidebarPane.js', 'front_end/elements/StylesSidebarPane.js',
], ],
'devtools_extensions_js_files': [ 'devtools_extensions_js_files': [
'front_end/extensions/_module.js',
'front_end/extensions/ExtensionAuditCategory.js', 'front_end/extensions/ExtensionAuditCategory.js',
'front_end/extensions/ExtensionPanel.js', 'front_end/extensions/ExtensionPanel.js',
'front_end/extensions/ExtensionRegistryStub.js', 'front_end/extensions/ExtensionRegistryStub.js',
...@@ -356,7 +350,6 @@ ...@@ -356,7 +350,6 @@
'front_end/common/TextUtils.js', 'front_end/common/TextUtils.js',
'front_end/common/UIString.js', 'front_end/common/UIString.js',
'front_end/common/utilities.js', 'front_end/common/utilities.js',
'front_end/heap_snapshot_worker/_module.js',
'front_end/heap_snapshot_worker/AllocationProfile.js', 'front_end/heap_snapshot_worker/AllocationProfile.js',
'front_end/heap_snapshot_worker/HeapSnapshot.js', 'front_end/heap_snapshot_worker/HeapSnapshot.js',
'front_end/heap_snapshot_worker/HeapSnapshotLoader.js', 'front_end/heap_snapshot_worker/HeapSnapshotLoader.js',
...@@ -366,14 +359,12 @@ ...@@ -366,14 +359,12 @@
'front_end/profiler/HeapSnapshotCommon.js', 'front_end/profiler/HeapSnapshotCommon.js',
], ],
'devtools_layers_js_files': [ 'devtools_layers_js_files': [
'front_end/layers/_module.js',
'front_end/layers/LayerDetailsView.js', 'front_end/layers/LayerDetailsView.js',
'front_end/layers/LayerPaintProfilerView.js', 'front_end/layers/LayerPaintProfilerView.js',
'front_end/layers/LayersPanel.js', 'front_end/layers/LayersPanel.js',
'front_end/layers/LayerTreeOutline.js', 'front_end/layers/LayerTreeOutline.js',
], ],
'devtools_network_js_files': [ 'devtools_network_js_files': [
'front_end/network/_module.js',
'front_end/network/HAREntry.js', 'front_end/network/HAREntry.js',
'front_end/network/NetworkItemView.js', 'front_end/network/NetworkItemView.js',
'front_end/network/NetworkPanel.js', 'front_end/network/NetworkPanel.js',
...@@ -388,7 +379,6 @@ ...@@ -388,7 +379,6 @@
'front_end/network/ResourceWebSocketFrameView.js', 'front_end/network/ResourceWebSocketFrameView.js',
], ],
'devtools_profiler_js_files': [ 'devtools_profiler_js_files': [
'front_end/profiler/_module.js',
'front_end/profiler/CanvasProfileView.js', 'front_end/profiler/CanvasProfileView.js',
'front_end/profiler/CanvasReplayStateView.js', 'front_end/profiler/CanvasReplayStateView.js',
'front_end/profiler/CPUProfileBottomUpDataGrid.js', 'front_end/profiler/CPUProfileBottomUpDataGrid.js',
...@@ -406,7 +396,6 @@ ...@@ -406,7 +396,6 @@
'front_end/profiler/ProfileTypeRegistry.js', 'front_end/profiler/ProfileTypeRegistry.js',
], ],
'devtools_resources_js_files': [ 'devtools_resources_js_files': [
'front_end/resources/_module.js',
'front_end/resources/ApplicationCacheItemsView.js', 'front_end/resources/ApplicationCacheItemsView.js',
'front_end/resources/CookieItemsView.js', 'front_end/resources/CookieItemsView.js',
'front_end/resources/DatabaseQueryView.js', 'front_end/resources/DatabaseQueryView.js',
...@@ -420,19 +409,16 @@ ...@@ -420,19 +409,16 @@
], ],
'devtools_script_formatter_worker_js_files': [ 'devtools_script_formatter_worker_js_files': [
'front_end/common/utilities.js', 'front_end/common/utilities.js',
'front_end/script_formatter_worker/_module.js',
'front_end/script_formatter_worker/CSSFormatter.js', 'front_end/script_formatter_worker/CSSFormatter.js',
'front_end/script_formatter_worker/JavaScriptFormatter.js', 'front_end/script_formatter_worker/JavaScriptFormatter.js',
'front_end/script_formatter_worker/ScriptFormatterWorker.js', 'front_end/script_formatter_worker/ScriptFormatterWorker.js',
], ],
'devtools_settings_js_files': [ 'devtools_settings_js_files': [
'front_end/settings/_module.js',
'front_end/settings/EditFileSystemDialog.js', 'front_end/settings/EditFileSystemDialog.js',
'front_end/settings/FrameworkBlackboxDialog.js', 'front_end/settings/FrameworkBlackboxDialog.js',
'front_end/settings/SettingsScreen.js', 'front_end/settings/SettingsScreen.js',
], ],
'devtools_source_frame_js_files': [ 'devtools_source_frame_js_files': [
'front_end/source_frame/_module.js',
'front_end/source_frame/CodeMirrorTextEditor.js', 'front_end/source_frame/CodeMirrorTextEditor.js',
'front_end/source_frame/CodeMirrorUtils.js', 'front_end/source_frame/CodeMirrorUtils.js',
'front_end/source_frame/FontView.js', 'front_end/source_frame/FontView.js',
...@@ -442,7 +428,6 @@ ...@@ -442,7 +428,6 @@
'front_end/source_frame/SourceFrame.js', 'front_end/source_frame/SourceFrame.js',
], ],
'devtools_sources_js_files': [ 'devtools_sources_js_files': [
'front_end/sources/_module.js',
'front_end/sources/AddSourceMapURLDialog.js', 'front_end/sources/AddSourceMapURLDialog.js',
'front_end/sources/AdvancedSearchView.js', 'front_end/sources/AdvancedSearchView.js',
'front_end/sources/BreakpointsSidebarPane.js', 'front_end/sources/BreakpointsSidebarPane.js',
...@@ -474,11 +459,9 @@ ...@@ -474,11 +459,9 @@
'front_end/sources/WorkersSidebarPane.js', 'front_end/sources/WorkersSidebarPane.js',
], ],
'devtools_temp_storage_shared_worker_js_files': [ 'devtools_temp_storage_shared_worker_js_files': [
'front_end/temp_storage_shared_worker/_module.js',
'front_end/temp_storage_shared_worker/TempStorageSharedWorker.js', 'front_end/temp_storage_shared_worker/TempStorageSharedWorker.js',
], ],
'devtools_timeline_js_files': [ 'devtools_timeline_js_files': [
'front_end/timeline/_module.js',
'front_end/timeline/CountersGraph.js', 'front_end/timeline/CountersGraph.js',
'front_end/timeline/Layers3DView.js', 'front_end/timeline/Layers3DView.js',
'front_end/timeline/MemoryCountersGraph.js', 'front_end/timeline/MemoryCountersGraph.js',
......
...@@ -116,15 +116,6 @@ var Runtime = function(descriptors) ...@@ -116,15 +116,6 @@ var Runtime = function(descriptors)
this._descriptorsMap[descriptors[i]["name"]] = descriptors[i]; this._descriptorsMap[descriptors[i]["name"]] = descriptors[i];
} }
/**
* @param {string} moduleName
* @return {!Worker}
*/
Runtime.startWorker = function(moduleName)
{
return new Worker(moduleName + "/_module.js");
}
Runtime.prototype = { Runtime.prototype = {
/** /**
* @param {!Array.<string>} configuration * @param {!Array.<string>} configuration
...@@ -443,8 +434,9 @@ Runtime.Module.prototype = { ...@@ -443,8 +434,9 @@ Runtime.Module.prototype = {
var dependencies = this._descriptor.dependencies; var dependencies = this._descriptor.dependencies;
for (var i = 0; dependencies && i < dependencies.length; ++i) for (var i = 0; dependencies && i < dependencies.length; ++i)
this._manager.loadModule(dependencies[i]); this._manager.loadModule(dependencies[i]);
if (this._descriptor.scripts) var scripts = this._descriptor.scripts;
loadScript(this._name + "/_module.js"); for (var i = 0; scripts && i < scripts.length; ++i)
loadScript(this._name + "/" + scripts[i]);
this._isLoading = false; this._isLoading = false;
this._loaded = true; this._loaded = true;
} }
......
...@@ -519,3 +519,11 @@ WebInspector.AuditRules = {}; ...@@ -519,3 +519,11 @@ WebInspector.AuditRules = {};
* @type {!Object.<string, function(new:WebInspector.AuditCategory)>} * @type {!Object.<string, function(new:WebInspector.AuditCategory)>}
*/ */
WebInspector.AuditCategories = {}; WebInspector.AuditCategories = {};
importScript("AuditCategory.js");
importScript("AuditCategories.js");
importScript("AuditController.js");
importScript("AuditFormatters.js");
importScript("AuditLauncherView.js");
importScript("AuditResultView.js");
importScript("AuditRules.js");
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
importScript("AuditsPanel.js");
importScript("AuditCategory.js");
importScript("AuditCategories.js");
importScript("AuditController.js");
importScript("AuditFormatters.js");
importScript("AuditLauncherView.js");
importScript("AuditResultView.js");
importScript("AuditRules.js");
...@@ -8,14 +8,5 @@ ...@@ -8,14 +8,5 @@
"className": "WebInspector.AuditsPanel" "className": "WebInspector.AuditsPanel"
} }
], ],
"scripts": [ "scripts": [ "AuditsPanel.js" ]
"AuditsPanel.js",
"AuditCategory.js",
"AuditCategories.js",
"AuditController.js",
"AuditFormatters.js",
"AuditLauncherView.js",
"AuditResultView.js",
"AuditRules.js"
]
} }
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
importScript("ConsoleViewMessage.js");
importScript("ConsoleView.js");
/** /**
* @constructor * @constructor
* @extends {WebInspector.Panel} * @extends {WebInspector.Panel}
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
importScript("ConsoleViewMessage.js");
importScript("ConsoleView.js");
importScript("ConsolePanel.js");
...@@ -51,9 +51,5 @@ ...@@ -51,9 +51,5 @@
"settingType": "checkbox" "settingType": "checkbox"
} }
], ],
"scripts": [ "scripts": [ "ConsolePanel.js" ]
"ConsoleViewMessage.js",
"ConsoleView.js",
"ConsolePanel.js"
]
} }
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
importScript("DevicesView.js");
\ No newline at end of file
...@@ -9,5 +9,5 @@ ...@@ -9,5 +9,5 @@
"className": "WebInspector.DevicesView" "className": "WebInspector.DevicesView"
} }
], ],
"scripts": ["DevicesView.js"] "scripts": [ "DevicesView.js" ]
} }
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
importScript("WikiParser.js");
importScript("JSArticle.js");
importScript("CSSArticle.js");
importScript("DocumentationURLProvider.js");
/** /**
* @constructor * @constructor
* @extends {WebInspector.VBox} * @extends {WebInspector.VBox}
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
importScript("WikiParser.js");
importScript("JSArticle.js");
importScript("CSSArticle.js");
importScript("DocumentationURLProvider.js");
importScript("DocumentationView.js");
...@@ -6,11 +6,5 @@ ...@@ -6,11 +6,5 @@
"className": "WebInspector.DocumentationView.ContextMenuProvider" "className": "WebInspector.DocumentationView.ContextMenuProvider"
} }
], ],
"scripts": [ "scripts": [ "DocumentationView.js" ]
"WikiParser.js",
"JSArticle.js",
"CSSArticle.js",
"DocumentationURLProvider.js",
"DocumentationView.js"
]
} }
...@@ -28,6 +28,15 @@ ...@@ -28,6 +28,15 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
importScript("Spectrum.js");
importScript("DOMSyntaxHighlighter.js");
importScript("ElementsTreeOutline.js");
importScript("EventListenersSidebarPane.js");
importScript("MetricsSidebarPane.js");
importScript("PlatformFontsSidebarPane.js");
importScript("PropertiesSidebarPane.js");
importScript("StylesSidebarPane.js");
/** /**
* @constructor * @constructor
* @implements {WebInspector.Searchable} * @implements {WebInspector.Searchable}
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
importScript("Spectrum.js");
importScript("DOMSyntaxHighlighter.js");
importScript("ElementsTreeOutline.js");
importScript("EventListenersSidebarPane.js");
importScript("MetricsSidebarPane.js");
importScript("PlatformFontsSidebarPane.js");
importScript("PropertiesSidebarPane.js");
importScript("StylesSidebarPane.js");
importScript("ElementsPanel.js");
...@@ -39,10 +39,10 @@ ...@@ -39,10 +39,10 @@
"settingName": "colorFormat", "settingName": "colorFormat",
"settingType": "select", "settingType": "select",
"options": [ "options": [
["As authored", "original"], [ "As authored", "original" ],
["HEX: #DAC0DE", "hex", true], [ "HEX: #DAC0DE", "hex", true ],
["RGB: rgb(128, 255, 255)", "rgb", true], [ "RGB: rgb(128, 255, 255)", "rgb", true ],
["HSL: hsl(300, 80%, 90%)", "hsl", true] [ "HSL: hsl(300, 80%, 90%)", "hsl", true ]
] ]
}, },
{ {
...@@ -74,15 +74,5 @@ ...@@ -74,15 +74,5 @@
"settingType": "checkbox" "settingType": "checkbox"
} }
], ],
"scripts": [ "scripts": [ "ElementsPanel.js" ]
"Spectrum.js",
"DOMSyntaxHighlighter.js",
"ElementsTreeOutline.js",
"EventListenersSidebarPane.js",
"MetricsSidebarPane.js",
"PlatformFontsSidebarPane.js",
"PropertiesSidebarPane.js",
"StylesSidebarPane.js",
"ElementsPanel.js"
]
} }
...@@ -28,6 +28,11 @@ ...@@ -28,6 +28,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
importScript("ExtensionAPI.js");
importScript("ExtensionRegistryStub.js");
importScript("ExtensionAuditCategory.js");
/** /**
* @constructor * @constructor
* @implements {WebInspector.ExtensionServerAPI} * @implements {WebInspector.ExtensionServerAPI}
...@@ -1095,3 +1100,6 @@ WebInspector.ExtensionStatus.Record; ...@@ -1095,3 +1100,6 @@ WebInspector.ExtensionStatus.Record;
WebInspector.extensionAPI = {}; WebInspector.extensionAPI = {};
defineCommonExtensionSymbols(WebInspector.extensionAPI); defineCommonExtensionSymbols(WebInspector.extensionAPI);
importScript("ExtensionPanel.js");
importScript("ExtensionView.js");
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
importScript("ExtensionAPI.js");
importScript("ExtensionRegistryStub.js");
importScript("ExtensionAuditCategory.js");
importScript("ExtensionServer.js");
importScript("ExtensionPanel.js");
importScript("ExtensionView.js");
\ No newline at end of file
...@@ -5,13 +5,6 @@ ...@@ -5,13 +5,6 @@
"className": "WebInspector.ExtensionServer" "className": "WebInspector.ExtensionServer"
} }
], ],
"dependencies": ["sources"], "dependencies": [ "sources" ],
"scripts": [ "scripts": [ "ExtensionServer.js" ]
"ExtensionAPI.js",
"ExtensionRegistryStub.js",
"ExtensionAuditCategory.js",
"ExtensionServer.js",
"ExtensionPanel.js",
"ExtensionView.js"
]
} }
...@@ -28,6 +28,18 @@ ...@@ -28,6 +28,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
WebInspector = {};
importScripts("../common/UIString.js");
importScripts("../common/utilities.js");
importScripts("../common/TextUtils.js");
importScripts("../profiler/HeapSnapshotCommon.js");
importScripts("AllocationProfile.js");
importScripts("HeapSnapshot.js");
importScripts("HeapSnapshotLoader.js");
importScripts("HeapSnapshotWorkerDispatcher.js");
importScripts("JSHeapSnapshot.js");
function postMessageWrapper(message) function postMessageWrapper(message)
{ {
postMessage(message); postMessage(message);
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
importScripts("../common/utilities.js");
importScripts("../common/WebInspector.js");
importScripts("../common/UIString.js");
importScripts("../common/TextUtils.js");
importScripts("../profiler/HeapSnapshotCommon.js");
importScripts("AllocationProfile.js");
importScripts("HeapSnapshot.js");
importScripts("HeapSnapshotLoader.js");
importScripts("HeapSnapshotWorkerDispatcher.js");
importScripts("JSHeapSnapshot.js");
importScripts("HeapSnapshotWorker.js");
...@@ -28,6 +28,10 @@ ...@@ -28,6 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
importScript("LayerTreeOutline.js");
importScript("LayerDetailsView.js");
importScript("LayerPaintProfilerView.js");
/** /**
* @constructor * @constructor
* @extends {WebInspector.PanelWithSidebarTree} * @extends {WebInspector.PanelWithSidebarTree}
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
importScript("LayerTreeOutline.js");
importScript("LayerDetailsView.js");
importScript("LayerPaintProfilerView.js");
importScript("LayersPanel.js");
...@@ -13,11 +13,6 @@ ...@@ -13,11 +13,6 @@
"className": "WebInspector.LayersPanel.LayerTreeRevealer" "className": "WebInspector.LayersPanel.LayerTreeRevealer"
} }
], ],
"dependencies": ["timeline"], "dependencies": [ "timeline" ],
"scripts": [ "scripts": [ "LayersPanel.js" ]
"LayerTreeOutline.js",
"LayerDetailsView.js",
"LayerPaintProfilerView.js",
"LayersPanel.js"
]
} }
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
importScript("Main.js");
\ No newline at end of file
...@@ -28,6 +28,18 @@ ...@@ -28,6 +28,18 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
importScript("HAREntry.js");
importScript("RequestView.js");
importScript("NetworkItemView.js");
importScript("RequestCookiesView.js");
importScript("RequestHeadersView.js");
importScript("RequestHTMLView.js");
importScript("RequestJSONView.js");
importScript("RequestPreviewView.js");
importScript("RequestResponseView.js");
importScript("RequestTimingView.js");
importScript("ResourceWebSocketFrameView.js");
/** /**
* @constructor * @constructor
* @implements {WebInspector.Searchable} * @implements {WebInspector.Searchable}
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
importScript("HAREntry.js");
importScript("RequestView.js");
importScript("NetworkItemView.js");
importScript("RequestCookiesView.js");
importScript("RequestHeadersView.js");
importScript("RequestHTMLView.js");
importScript("RequestJSONView.js");
importScript("RequestPreviewView.js");
importScript("RequestResponseView.js");
importScript("RequestTimingView.js");
importScript("ResourceWebSocketFrameView.js");
importScript("NetworkPanel.js");
...@@ -18,19 +18,6 @@ ...@@ -18,19 +18,6 @@
"className": "WebInspector.NetworkPanel.RequestRevealer" "className": "WebInspector.NetworkPanel.RequestRevealer"
} }
], ],
"dependencies": ["source_frame"], "dependencies": [ "source_frame" ],
"scripts": [ "scripts": [ "NetworkPanel.js" ]
"HAREntry.js",
"RequestView.js",
"NetworkItemView.js",
"RequestCookiesView.js",
"RequestHeadersView.js",
"RequestHTMLView.js",
"RequestJSONView.js",
"RequestPreviewView.js",
"RequestResponseView.js",
"RequestTimingView.js",
"ResourceWebSocketFrameView.js",
"NetworkPanel.js"
]
} }
...@@ -40,7 +40,7 @@ WebInspector.HeapSnapshotWorkerProxy = function(eventHandler) ...@@ -40,7 +40,7 @@ WebInspector.HeapSnapshotWorkerProxy = function(eventHandler)
this._nextCallId = 1; this._nextCallId = 1;
this._callbacks = []; this._callbacks = [];
this._previousCallbacks = []; this._previousCallbacks = [];
this._worker = Runtime.startWorker("heap_snapshot_worker"); this._worker = new Worker("heap_snapshot_worker/HeapSnapshotWorker.js");
this._worker.onmessage = this._messageReceived.bind(this); this._worker.onmessage = this._messageReceived.bind(this);
} }
......
...@@ -1311,3 +1311,19 @@ WebInspector.ProfilesSidebarTreeElement.prototype = { ...@@ -1311,3 +1311,19 @@ WebInspector.ProfilesSidebarTreeElement.prototype = {
__proto__: WebInspector.SidebarTreeElement.prototype __proto__: WebInspector.SidebarTreeElement.prototype
} }
importScript("CPUProfileDataGrid.js");
importScript("CPUProfileBottomUpDataGrid.js");
importScript("CPUProfileTopDownDataGrid.js");
importScript("CPUProfileFlameChart.js");
importScript("CPUProfileView.js");
importScript("HeapSnapshotCommon.js");
importScript("HeapSnapshotProxy.js");
importScript("HeapSnapshotDataGrids.js");
importScript("HeapSnapshotGridNodes.js");
importScript("HeapSnapshotView.js");
importScript("ProfileLauncherView.js");
importScript("CanvasProfileView.js");
importScript("CanvasReplayStateView.js");
importScript("ProfileTypeRegistry.js");
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
importScript("ProfilesPanel.js");
importScript("CPUProfileDataGrid.js");
importScript("CPUProfileBottomUpDataGrid.js");
importScript("CPUProfileTopDownDataGrid.js");
importScript("CPUProfileFlameChart.js");
importScript("CPUProfileView.js");
importScript("HeapSnapshotCommon.js");
importScript("HeapSnapshotProxy.js");
importScript("HeapSnapshotDataGrids.js");
importScript("HeapSnapshotGridNodes.js");
importScript("HeapSnapshotView.js");
importScript("ProfileLauncherView.js");
importScript("CanvasProfileView.js");
importScript("CanvasReplayStateView.js");
importScript("ProfileTypeRegistry.js");
...@@ -34,21 +34,5 @@ ...@@ -34,21 +34,5 @@
"settingType": "checkbox" "settingType": "checkbox"
} }
], ],
"scripts": [ "scripts": [ "ProfilesPanel.js" ]
"ProfilesPanel.js",
"CPUProfileDataGrid.js",
"CPUProfileBottomUpDataGrid.js",
"CPUProfileTopDownDataGrid.js",
"CPUProfileFlameChart.js",
"CPUProfileView.js",
"HeapSnapshotCommon.js",
"HeapSnapshotProxy.js",
"HeapSnapshotDataGrids.js",
"HeapSnapshotGridNodes.js",
"HeapSnapshotView.js",
"ProfileLauncherView.js",
"CanvasProfileView.js",
"CanvasReplayStateView.js",
"ProfileTypeRegistry.js"
]
} }
...@@ -28,6 +28,16 @@ ...@@ -28,6 +28,16 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
importScript("ApplicationCacheItemsView.js");
importScript("CookieItemsView.js");
importScript("DOMStorageItemsView.js");
importScript("DatabaseQueryView.js");
importScript("DatabaseTableView.js");
importScript("DirectoryContentView.js");
importScript("IndexedDBViews.js");
importScript("FileContentView.js");
importScript("FileSystemView.js");
/** /**
* @constructor * @constructor
* @extends {WebInspector.PanelWithSidebarTree} * @extends {WebInspector.PanelWithSidebarTree}
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
importScript("ApplicationCacheItemsView.js");
importScript("CookieItemsView.js");
importScript("DOMStorageItemsView.js");
importScript("DatabaseQueryView.js");
importScript("DatabaseTableView.js");
importScript("DirectoryContentView.js");
importScript("IndexedDBViews.js");
importScript("FileContentView.js");
importScript("FileSystemView.js");
importScript("ResourcesPanel.js");
\ No newline at end of file
...@@ -13,17 +13,6 @@ ...@@ -13,17 +13,6 @@
"className": "WebInspector.ResourcesPanel.ResourceRevealer" "className": "WebInspector.ResourcesPanel.ResourceRevealer"
} }
], ],
"dependencies": ["source_frame"], "dependencies": [ "source_frame" ],
"scripts": [ "scripts": [ "ResourcesPanel.js" ]
"ApplicationCacheItemsView.js",
"CookieItemsView.js",
"DOMStorageItemsView.js",
"DatabaseQueryView.js",
"DatabaseTableView.js",
"DirectoryContentView.js",
"IndexedDBViews.js",
"FileContentView.js",
"FileSystemView.js",
"ResourcesPanel.js"
]
} }
...@@ -986,7 +986,7 @@ FormatterWorker.JavaScriptTokensByType = { ...@@ -986,7 +986,7 @@ FormatterWorker.JavaScriptTokensByType = {
*/ */
FormatterWorker.JavaScriptTokenizer = function(content) FormatterWorker.JavaScriptTokenizer = function(content)
{ {
this._readNextToken = tokenizerHolder.tokenizer(content); this._readNextToken = parse.tokenizer(content);
this._state = this._readNextToken.context(); this._state = this._readNextToken.context();
} }
......
...@@ -27,6 +27,13 @@ ...@@ -27,6 +27,13 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
importScripts("../common/utilities.js");
importScripts("../cm/headlesscodemirror.js");
importScripts("../cm/css.js");
importScripts("../cm/javascript.js");
importScripts("../cm/xml.js");
importScripts("../cm/htmlmixed.js");
WebInspector = {};
FormatterWorker = { FormatterWorker = {
/** /**
* @param {string} mimeType * @param {string} mimeType
...@@ -490,11 +497,15 @@ FormatterWorker.HTMLFormatter.prototype = { ...@@ -490,11 +497,15 @@ FormatterWorker.HTMLFormatter.prototype = {
*/ */
function require() function require()
{ {
return tokenizerHolder; return parse;
} }
/** /**
* @type {!{tokenizer}} * @type {!{tokenizer}}
*/ */
var exports = { tokenizer: null }; var exports = { tokenizer: null };
var tokenizerHolder = exports; importScripts("../UglifyJS/parse-js.js");
var parse = exports;
importScripts("JavaScriptFormatter.js");
importScripts("CSSFormatter.js");
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
importScripts("../common/utilities.js");
importScripts("../common/WebInspector.js");
importScripts("../cm/headlesscodemirror.js");
importScripts("../cm/css.js");
importScripts("../cm/javascript.js");
importScripts("../cm/xml.js");
importScripts("../cm/htmlmixed.js");
importScripts("ScriptFormatterWorker.js");
importScripts("../UglifyJS/parse-js.js");
importScripts("JavaScriptFormatter.js");
importScripts("CSSFormatter.js");
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
*/ */
WebInspector.CSSParser = function() WebInspector.CSSParser = function()
{ {
this._worker = Runtime.startWorker("script_formatter_worker"); this._worker = new Worker("script_formatter_worker/ScriptFormatterWorker.js");
this._worker.onmessage = this._onRuleChunk.bind(this); this._worker.onmessage = this._onRuleChunk.bind(this);
this._rules = []; this._rules = [];
} }
......
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
importScript("EditFileSystemDialog.js");
importScript("FrameworkBlackboxDialog.js");
/** /**
* @constructor * @constructor
* @param {!function()} onHide * @param {!function()} onHide
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
importScript("EditFileSystemDialog.js");
importScript("FrameworkBlackboxDialog.js");
importScript("SettingsScreen.js");
...@@ -25,9 +25,5 @@ ...@@ -25,9 +25,5 @@
"className": "WebInspector.SettingsScreen.SkipStackFramePatternSettingDelegate" "className": "WebInspector.SettingsScreen.SkipStackFramePatternSettingDelegate"
} }
], ],
"scripts": [ "scripts": [ "SettingsScreen.js" ]
"EditFileSystemDialog.js",
"FrameworkBlackboxDialog.js",
"SettingsScreen.js"
]
} }
...@@ -28,6 +28,27 @@ ...@@ -28,6 +28,27 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
importScript("../cm/codemirror.js");
importScript("../cm/css.js");
importScript("../cm/javascript.js");
importScript("../cm/xml.js");
importScript("../cm/htmlmixed.js");
importScript("../cm/matchbrackets.js");
importScript("../cm/closebrackets.js");
importScript("../cm/markselection.js");
importScript("../cm/comment.js");
importScript("../cm/overlay.js");
importScript("../cm/htmlembedded.js");
importScript("../cm/clike.js");
importScript("../cm/coffeescript.js");
importScript("../cm/php.js");
importScript("../cm/python.js");
importScript("../cm/shell.js");
importScript("CodeMirrorUtils.js");
importScript("CodeMirrorTextEditor.js");
/** /**
* @extends {WebInspector.VBox} * @extends {WebInspector.VBox}
* @constructor * @constructor
...@@ -1021,3 +1042,8 @@ WebInspector.TextEditorDelegateForSourceFrame.prototype = { ...@@ -1021,3 +1042,8 @@ WebInspector.TextEditorDelegateForSourceFrame.prototype = {
this._sourceFrame.onJumpToPosition(from, to); this._sourceFrame.onJumpToPosition(from, to);
} }
} }
importScript("GoToLineDialog.js");
importScript("ResourceView.js");
importScript("FontView.js");
importScript("ImageView.js");
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
importScript("../cm/codemirror.js");
importScript("../cm/css.js");
importScript("../cm/javascript.js");
importScript("../cm/xml.js");
importScript("../cm/htmlmixed.js");
importScript("../cm/matchbrackets.js");
importScript("../cm/closebrackets.js");
importScript("../cm/markselection.js");
importScript("../cm/comment.js");
importScript("../cm/overlay.js");
importScript("../cm/htmlembedded.js");
importScript("../cm/clike.js");
importScript("../cm/coffeescript.js");
importScript("../cm/php.js");
importScript("../cm/python.js");
importScript("../cm/shell.js");
importScript("CodeMirrorUtils.js");
importScript("CodeMirrorTextEditor.js");
importScript("SourceFrame.js");
importScript("GoToLineDialog.js");
importScript("ResourceView.js");
importScript("FontView.js");
importScript("ImageView.js");
...@@ -22,31 +22,5 @@ ...@@ -22,31 +22,5 @@
] ]
} }
], ],
"scripts": [ "scripts": [ "SourceFrame.js" ]
"../cm/codemirror.js",
"../cm/css.js",
"../cm/javascript.js",
"../cm/xml.js",
"../cm/htmlmixed.js",
"../cm/matchbrackets.js",
"../cm/closebrackets.js",
"../cm/markselection.js",
"../cm/comment.js",
"../cm/overlay.js",
"../cm/htmlembedded.js",
"../cm/clike.js",
"../cm/coffeescript.js",
"../cm/php.js",
"../cm/python.js",
"../cm/shell.js",
"CodeMirrorUtils.js",
"CodeMirrorTextEditor.js",
"SourceFrame.js",
"GoToLineDialog.js",
"ResourceView.js",
"FontView.js",
"ImageView.js"
]
} }
...@@ -535,7 +535,7 @@ WebInspector.JavaScriptOutlineDialog = function(uiSourceCode, selectItemCallback ...@@ -535,7 +535,7 @@ WebInspector.JavaScriptOutlineDialog = function(uiSourceCode, selectItemCallback
this._functionItems = []; this._functionItems = [];
this._selectItemCallback = selectItemCallback; this._selectItemCallback = selectItemCallback;
this._outlineWorker = Runtime.startWorker("script_formatter_worker"); this._outlineWorker = new Worker("script_formatter_worker/ScriptFormatterWorker.js");
this._outlineWorker.onmessage = this._didBuildOutlineChunk.bind(this); this._outlineWorker.onmessage = this._didBuildOutlineChunk.bind(this);
this._outlineWorker.postMessage({ method: "javaScriptOutline", params: { content: uiSourceCode.workingCopy() } }); this._outlineWorker.postMessage({ method: "javaScriptOutline", params: { content: uiSourceCode.workingCopy() } });
} }
......
...@@ -124,7 +124,7 @@ WebInspector.ScriptFormatter.prototype = { ...@@ -124,7 +124,7 @@ WebInspector.ScriptFormatter.prototype = {
get _worker() get _worker()
{ {
if (!this._cachedWorker) { if (!this._cachedWorker) {
this._cachedWorker = Runtime.startWorker("script_formatter_worker"); this._cachedWorker = new Worker("script_formatter_worker/ScriptFormatterWorker.js");
this._cachedWorker.onmessage = /** @type {function(this:Worker)} */ (this._didFormatContent.bind(this)); this._cachedWorker.onmessage = /** @type {function(this:Worker)} */ (this._didFormatContent.bind(this));
} }
return this._cachedWorker; return this._cachedWorker;
......
...@@ -24,6 +24,38 @@ ...@@ -24,6 +24,38 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
importScript("jsdifflib.js")
importScript("Placard.js");
importScript("AddSourceMapURLDialog.js");
importScript("BreakpointsSidebarPane.js");
importScript("CallStackSidebarPane.js");
importScript("SimpleHistoryManager.js");
importScript("EditingLocationHistoryManager.js");
importScript("FilePathScoreFunction.js");
importScript("FilteredItemSelectionDialog.js");
importScript("UISourceCodeFrame.js");
importScript("JavaScriptSourceFrame.js");
importScript("CSSSourceFrame.js");
importScript("NavigatorView.js");
importScript("RevisionHistoryView.js");
importScript("ScopeChainSidebarPane.js");
importScript("SourcesNavigator.js");
importScript("StyleSheetOutlineDialog.js");
importScript("TabbedEditorContainer.js");
importScript("WatchExpressionsSidebarPane.js");
importScript("WorkersSidebarPane.js");
importScript("ThreadsSidebarPane.js");
importScript("ScriptFormatterEditorAction.js");
importScript("InplaceFormatterEditorAction.js");
importScript("ScriptFormatter.js");
importScript("SourcesView.js");
// Search results pane
importScript("AdvancedSearchView.js");
importScript("FileBasedSearchResultsPane.js");
importScript("SourcesSearchScope.js");
/** /**
* @constructor * @constructor
* @extends {WebInspector.Panel} * @extends {WebInspector.Panel}
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
importScript("jsdifflib.js")
importScript("Placard.js");
importScript("AddSourceMapURLDialog.js");
importScript("BreakpointsSidebarPane.js");
importScript("CallStackSidebarPane.js");
importScript("SimpleHistoryManager.js");
importScript("EditingLocationHistoryManager.js");
importScript("FilePathScoreFunction.js");
importScript("FilteredItemSelectionDialog.js");
importScript("UISourceCodeFrame.js");
importScript("JavaScriptSourceFrame.js");
importScript("CSSSourceFrame.js");
importScript("NavigatorView.js");
importScript("RevisionHistoryView.js");
importScript("ScopeChainSidebarPane.js");
importScript("SourcesNavigator.js");
importScript("StyleSheetOutlineDialog.js");
importScript("TabbedEditorContainer.js");
importScript("WatchExpressionsSidebarPane.js");
importScript("WorkersSidebarPane.js");
importScript("ThreadsSidebarPane.js");
importScript("ScriptFormatterEditorAction.js");
importScript("InplaceFormatterEditorAction.js");
importScript("ScriptFormatter.js");
importScript("SourcesView.js");
// Search results pane
importScript("AdvancedSearchView.js");
importScript("FileBasedSearchResultsPane.js");
importScript("SourcesSearchScope.js");
importScript("SourcesPanel.js");
...@@ -178,35 +178,6 @@ ...@@ -178,35 +178,6 @@
"settingType": "checkbox" "settingType": "checkbox"
} }
], ],
"dependencies": ["source_frame"], "dependencies": [ "source_frame" ],
"scripts": [ "scripts": [ "SourcesPanel.js" ]
"jsdifflib.js",
"Placard.js",
"AddSourceMapURLDialog.js",
"BreakpointsSidebarPane.js",
"CallStackSidebarPane.js",
"SimpleHistoryManager.js",
"EditingLocationHistoryManager.js",
"FilePathScoreFunction.js",
"FilteredItemSelectionDialog.js",
"UISourceCodeFrame.js",
"JavaScriptSourceFrame.js",
"CSSSourceFrame.js",
"NavigatorView.js",
"RevisionHistoryView.js",
"ScopeChainSidebarPane.js",
"SourcesNavigator.js",
"StyleSheetOutlineDialog.js",
"TabbedEditorContainer.js",
"WatchExpressionsSidebarPane.js",
"WorkersSidebarPane.js",
"ScriptFormatterEditorAction.js",
"InplaceFormatterEditorAction.js",
"ScriptFormatter.js",
"SourcesView.js",
"AdvancedSearchView.js",
"FileBasedSearchResultsPane.js",
"SourcesSearchScope.js",
"SourcesPanel.js"
]
} }
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
importScript("TempStorageSharedWorker.js");
\ No newline at end of file
...@@ -29,6 +29,32 @@ ...@@ -29,6 +29,32 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
importScript("CountersGraph.js");
importScript("Layers3DView.js");
importScript("MemoryCountersGraph.js");
importScript("TimelineModel.js");
importScript("TimelineModelImpl.js");
importScript("TimelineJSProfile.js");
importScript("TimelineOverviewPane.js");
importScript("TimelinePresentationModel.js");
importScript("TracingTimelineModel.js");
importScript("TimelineFrameModel.js");
importScript("TimelineEventOverview.js");
importScript("TimelineFrameOverview.js");
importScript("TimelineMemoryOverview.js");
importScript("TimelinePowerGraph.js");
importScript("TimelinePowerOverview.js");
importScript("TimelineFlameChart.js");
importScript("TimelineUIUtils.js");
importScript("TimelineUIUtilsImpl.js");
importScript("TimelineView.js");
importScript("TimelineLayersView.js");
importScript("TimelinePaintProfilerView.js");
importScript("TracingModel.js");
importScript("TracingTimelineUIUtils.js");
importScript("TransformController.js");
importScript("PaintProfilerView.js");
/** /**
* @constructor * @constructor
* @extends {WebInspector.Panel} * @extends {WebInspector.Panel}
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
importScript("CountersGraph.js");
importScript("Layers3DView.js");
importScript("MemoryCountersGraph.js");
importScript("TimelineModel.js");
importScript("TimelineModelImpl.js");
importScript("TimelineJSProfile.js");
importScript("TimelineOverviewPane.js");
importScript("TimelinePresentationModel.js");
importScript("TracingTimelineModel.js");
importScript("TimelineFrameModel.js");
importScript("TimelineEventOverview.js");
importScript("TimelineFrameOverview.js");
importScript("TimelineMemoryOverview.js");
importScript("TimelinePowerGraph.js");
importScript("TimelinePowerOverview.js");
importScript("TimelineFlameChart.js");
importScript("TimelineUIUtils.js");
importScript("TimelineUIUtilsImpl.js");
importScript("TimelineView.js");
importScript("TimelineLayersView.js");
importScript("TimelinePaintProfilerView.js");
importScript("TracingModel.js");
importScript("TracingTimelineUIUtils.js");
importScript("TransformController.js");
importScript("PaintProfilerView.js");
importScript("TimelinePanel.js");
...@@ -8,32 +8,5 @@ ...@@ -8,32 +8,5 @@
"className": "WebInspector.TimelinePanel" "className": "WebInspector.TimelinePanel"
} }
], ],
"scripts": [ "scripts": [ "TimelinePanel.js" ]
"CountersGraph.js",
"Layers3DView.js",
"MemoryCountersGraph.js",
"TimelineModel.js",
"TimelineModelImpl.js",
"TimelineJSProfile.js",
"TimelineOverviewPane.js",
"TimelinePresentationModel.js",
"TracingTimelineModel.js",
"TimelineFrameModel.js",
"TimelineEventOverview.js",
"TimelineFrameOverview.js",
"TimelineMemoryOverview.js",
"TimelinePowerGraph.js",
"TimelinePowerOverview.js",
"TimelineFlameChart.js",
"TimelineUIUtils.js",
"TimelineUIUtilsImpl.js",
"TimelineView.js",
"TimelineLayersView.js",
"TimelinePaintProfilerView.js",
"TracingModel.js",
"TracingTimelineUIUtils.js",
"TransformController.js",
"PaintProfilerView.js",
"TimelinePanel.js"
]
} }
...@@ -36,9 +36,9 @@ import subprocess ...@@ -36,9 +36,9 @@ import subprocess
import sys import sys
import tempfile import tempfile
try: try:
import simplejson as json
except ImportError:
import json import json
except ImportError:
import simplejson as json
scripts_path = path.dirname(path.abspath(__file__)) scripts_path = path.dirname(path.abspath(__file__))
devtools_path = path.dirname(scripts_path) devtools_path = path.dirname(scripts_path)
...@@ -57,9 +57,8 @@ java_exec = "java -Xms1024m -server -XX:+TieredCompilation" ...@@ -57,9 +57,8 @@ java_exec = "java -Xms1024m -server -XX:+TieredCompilation"
generate_protocol_externs.generate_protocol_externs(protocol_externs_file, path.join(devtools_path, "protocol.json")) generate_protocol_externs.generate_protocol_externs(protocol_externs_file, path.join(devtools_path, "protocol.json"))
jsmodule_name_prefix = "jsmodule_" jsmodule_name_prefix = "jsmodule_"
frontend_modules_name = "frontend_modules.json" js_modules_name = "frontend_modules.json"
runtime_module_name = "_runtime" runtime_module_name = "_runtime"
module_initializer_name = "_module.js"
def error_excepthook(exctype, value, traceback): def error_excepthook(exctype, value, traceback):
...@@ -68,12 +67,31 @@ def error_excepthook(exctype, value, traceback): ...@@ -68,12 +67,31 @@ def error_excepthook(exctype, value, traceback):
sys.excepthook = error_excepthook sys.excepthook = error_excepthook
try: try:
with open(path.join(scripts_path, frontend_modules_name), "rt") as js_modules_file: with open(path.join(scripts_path, js_modules_name), "rt") as js_modules_file:
modules = json.loads(js_modules_file.read()) modules = json.loads(js_modules_file.read())
except: except:
log_error("Failed to read %s" % frontend_modules_name) print "ERROR: Failed to read %s" % js_modules_name
raise raise
# `importScript` function must not be used in any files
# except module headers. Refer to devtools.gyp file for
# the module header list.
allowed_import_statements_files = [
"console/ConsolePanel.js",
"elements/ElementsPanel.js",
"resources/ResourcesPanel.js",
"network/NetworkPanel.js",
"settings/SettingsScreen.js",
"sources/SourcesPanel.js",
"timeline/TimelinePanel.js",
"profiler/ProfilesPanel.js",
"audits/AuditsPanel.js",
"layers/LayersPanel.js",
"extensions/ExtensionServer.js",
"source_frame/SourceFrame.js",
"documentation/DocumentationView.js",
]
type_checked_jsdoc_tags_list = ["param", "return", "type", "enum"] type_checked_jsdoc_tags_list = ["param", "return", "type", "enum"]
type_checked_jsdoc_tags_or = "|".join(type_checked_jsdoc_tags_list) type_checked_jsdoc_tags_or = "|".join(type_checked_jsdoc_tags_list)
...@@ -97,25 +115,20 @@ def hasErrors(output): ...@@ -97,25 +115,20 @@ def hasErrors(output):
return re.search(error_warning_regex, output) != None return re.search(error_warning_regex, output) != None
def log_error(message):
print "ERROR: " + message
def verify_importScript_usage(): def verify_importScript_usage():
errors_found = False errors_found = False
for module in modules: for module in modules:
for file_name in module["sources"]: for file_name in module['sources']:
if path.basename(file_name) == module_initializer_name: if file_name in allowed_import_statements_files:
log_error("Module initializer (%s) may not be listed among module's scripts; found in '%s'" % (module_initializer_name, module["name"]))
errors_found = True
continue continue
try: try:
with open(path.join(devtools_frontend_path, file_name), "r") as sourceFile: with open(path.join(devtools_frontend_path, file_name), "r") as sourceFile:
source = sourceFile.read() source = sourceFile.read()
if re.search(importscript_regex, source): if re.search(importscript_regex, source):
log_error("importScript() call only allowed in module initializers (%s); found in %s" % (module_initializer_name, file_name)) print "ERROR: importScript function call is allowed in module header files only (found in %s)" % file_name
errors_found = True errors_found = True
except: except:
log_error("Failed to access %s" % file_name) print "ERROR: Failed to access %s" % file_name
raise raise
return errors_found return errors_found
...@@ -213,7 +226,7 @@ def verify_standalone_modules(): ...@@ -213,7 +226,7 @@ def verify_standalone_modules():
for module in modules: for module in modules:
for dependency in module["dependencies"]: for dependency in module["dependencies"]:
if dependency in standalone_modules_by_name: if dependency in standalone_modules_by_name:
log_error("Standalone module '%s' may not be present among the dependencies of '%s'" % (dependency, module["name"])) print "ERROR: Standalone module %s may not be present among the dependencies of %s" % (dependency, module["name"])
errors_found = True errors_found = True
verify_standalone_modules() verify_standalone_modules()
...@@ -230,7 +243,7 @@ def check_duplicate_files(): ...@@ -230,7 +243,7 @@ def check_duplicate_files():
for source in module["sources"]: for source in module["sources"]:
referencing_module = seen_files.get(source) referencing_module = seen_files.get(source)
if referencing_module: if referencing_module:
log_error("Duplicate use of %s in '%s' (previously seen in '%s')" % (source, name, referencing_module)) print "ERROR: Duplicate use of %s in '%s' (previously seen in '%s')" % (source, name, referencing_module)
seen_files[source] = name seen_files[source] = name
for module_name in standalone_modules_by_name: for module_name in standalone_modules_by_name:
......
...@@ -10,10 +10,6 @@ from os import path ...@@ -10,10 +10,6 @@ from os import path
import errno import errno
import shutil import shutil
import sys import sys
try:
import simplejson as json
except ImportError:
import json
def read_file(filename): def read_file(filename):
...@@ -27,17 +23,9 @@ def build_modules(module_jsons): ...@@ -27,17 +23,9 @@ def build_modules(module_jsons):
if not path.exists(json_filename): if not path.exists(json_filename):
continue continue
module_name = path.basename(path.dirname(json_filename)) module_name = path.basename(path.dirname(json_filename))
json = read_file(json_filename).replace('{', '{"name":"%s",' % module_name, 1)
# pylint: disable=E1103 result.append(json)
module_json = json.loads(read_file(json_filename)) return ','.join(result)
module_json['name'] = module_name
# Clear scripts, as they are not used at runtime
# (only the fact of their presence is important).
if module_json.get('scripts'):
module_json['scripts'] = []
result.append(module_json)
return json.dumps(result)
def main(argv): def main(argv):
...@@ -46,7 +34,7 @@ def main(argv): ...@@ -46,7 +34,7 @@ def main(argv):
module_jsons = argv[3:] module_jsons = argv[3:]
with open(output_filename, 'w') as output_file: with open(output_filename, 'w') as output_file:
output_file.write('var allDescriptors=%s;' % build_modules(module_jsons)) output_file.write('var allDescriptors=[%s];' % build_modules(module_jsons))
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -75,7 +75,7 @@ def main(argv): ...@@ -75,7 +75,7 @@ def main(argv):
output_script = re.sub(r'importScripts?\([\'"]([^\'"]+)[\'"]\)', replace, input_script) output_script = re.sub(r'importScripts?\([\'"]([^\'"]+)[\'"]\)', replace, input_script)
if re.search("importScripts?\(\"", output_script): if re.search("importScripts?\(\"", output_script):
raise Exception('Unresolved "importScript" statements found in "%s". ' raise Exception('Unresolved "importScript" statements found in "%s". '
'Make sure you call "importScript" in module initializers only.' % 'Make sure you call "importScript" in module heads only.' %
(output_file_name)) (output_file_name))
if os.path.exists(output_file_name): if os.path.exists(output_file_name):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment