Diff
Modified: trunk/Source/WebCore/ChangeLog (110548 => 110549)
--- trunk/Source/WebCore/ChangeLog 2012-03-13 08:56:17 UTC (rev 110548)
+++ trunk/Source/WebCore/ChangeLog 2012-03-13 09:10:42 UTC (rev 110549)
@@ -1,3 +1,27 @@
+2012-03-12 Pavel Podivilov <podivi...@chromium.org>
+
+ Web Inspector: move ResourceScriptMapping to a separate file.
+ https://bugs.webkit.org/show_bug.cgi?id=80859
+
+ Reviewed by Vsevolod Vlasov.
+
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * inspector/compile-front-end.sh:
+ * inspector/front-end/ResourceScriptMapping.js: Copied from Source/WebCore/inspector/front-end/ScriptMapping.js.
+ (WebInspector.ResourceScriptMapping):
+ (WebInspector.ResourceScriptMapping.prototype.rawLocationToUILocation):
+ (WebInspector.ResourceScriptMapping.prototype.uiSourceCodeList):
+ (WebInspector.ResourceScriptMapping.prototype._handleUISourceCodeListChanged):
+ (WebInspector.ResourceScriptMapping.prototype._uiSourceCodeListChanged):
+ (WebInspector.ResourceScriptMapping.prototype._bindScriptToRawSourceCode):
+ (WebInspector.ResourceScriptMapping.prototype.setFormatSource):
+ (WebInspector.ResourceScriptMapping.prototype.forceUpdateSourceMapping):
+ (WebInspector.ResourceScriptMapping.prototype.reset):
+ * inspector/front-end/ScriptMapping.js:
+ * inspector/front-end/WebKit.qrc:
+ * inspector/front-end/inspector.html:
+
2012-03-12 Kentaro Hara <hara...@chromium.org>
Rename OptionsObject to Dictionary
Modified: trunk/Source/WebCore/WebCore.gypi (110548 => 110549)
--- trunk/Source/WebCore/WebCore.gypi 2012-03-13 08:56:17 UTC (rev 110548)
+++ trunk/Source/WebCore/WebCore.gypi 2012-03-13 09:10:42 UTC (rev 110549)
@@ -6264,6 +6264,7 @@
'inspector/front-end/ResourceJSONView.js',
'inspector/front-end/ResourceHTMLView.js',
'inspector/front-end/ResourceResponseView.js',
+ 'inspector/front-end/ResourceScriptMapping.js',
'inspector/front-end/ResourceTimingView.js',
'inspector/front-end/ResourceTreeModel.js',
'inspector/front-end/ResourceUtils.js',
Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (110548 => 110549)
--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2012-03-13 08:56:17 UTC (rev 110548)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2012-03-13 09:10:42 UTC (rev 110549)
@@ -73765,6 +73765,10 @@
>
</File>
<File
+ RelativePath="..\inspector\front-end\ResourceScriptMapping.js"
+ >
+ </File>
+ <File
RelativePath="..\inspector\front-end\ResourceTimingView.js"
>
</File>
Modified: trunk/Source/WebCore/inspector/compile-front-end.sh (110548 => 110549)
--- trunk/Source/WebCore/inspector/compile-front-end.sh 2012-03-13 08:56:17 UTC (rev 110548)
+++ trunk/Source/WebCore/inspector/compile-front-end.sh 2012-03-13 09:10:42 UTC (rev 110549)
@@ -45,7 +45,7 @@
--js Source/WebCore/inspector/front-end/UserMetrics.js \
--js Source/WebCore/inspector/front-end/HandlerRegistry.js \
--js Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js \
- --module jsmodule_sdk:34:jsmodule_common \
+ --module jsmodule_sdk:35:jsmodule_common \
--js Source/WebCore/inspector/front-end/InspectorBackend.js \
--js Source/WebCore/inspector/front-end/ApplicationCacheModel.js \
--js Source/WebCore/inspector/front-end/Color.js \
@@ -76,6 +76,7 @@
--js Source/WebCore/inspector/front-end/RemoteObject.js \
--js Source/WebCore/inspector/front-end/Resource.js \
--js Source/WebCore/inspector/front-end/ResourceCategory.js \
+ --js Source/WebCore/inspector/front-end/ResourceScriptMapping.js \
--js Source/WebCore/inspector/front-end/ResourceTreeModel.js \
--js Source/WebCore/inspector/front-end/ResourceUtils.js \
--js Source/WebCore/inspector/front-end/NetworkManager.js \
Copied: trunk/Source/WebCore/inspector/front-end/ResourceScriptMapping.js (from rev 110548, trunk/Source/WebCore/inspector/front-end/ScriptMapping.js) (0 => 110549)
--- trunk/Source/WebCore/inspector/front-end/ResourceScriptMapping.js (rev 0)
+++ trunk/Source/WebCore/inspector/front-end/ResourceScriptMapping.js 2012-03-13 09:10:42 UTC (rev 110549)
@@ -0,0 +1,195 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @constructor
+ * @extends {WebInspector.ScriptMapping}
+ */
+WebInspector.ResourceScriptMapping = function()
+{
+ this._rawSourceCodes = [];
+ this._rawSourceCodeForScriptId = {};
+ this._rawSourceCodeForURL = {};
+ this._rawSourceCodeForDocumentURL = {};
+ this._rawSourceCodeForUISourceCode = new Map();
+ this._formatter = new WebInspector.ScriptFormatter();
+ this._formatSource = false;
+}
+
+WebInspector.ResourceScriptMapping.prototype = {
+ /**
+ * @param {DebuggerAgent.Location} rawLocation
+ * @return {WebInspector.UILocation}
+ */
+ rawLocationToUILocation: function(rawLocation)
+ {
+ var rawSourceCode = this._rawSourceCodeForScriptId[rawLocation.scriptId];
+ return rawSourceCode.rawLocationToUILocation(rawLocation);
+ },
+
+ /**
+ * @param {WebInspector.UISourceCode} uiSourceCode
+ * @param {number} lineNumber
+ * @param {number} columnNumber
+ * @return {DebuggerAgent.Location}
+ */
+ uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber)
+ {
+ var rawSourceCode = this._rawSourceCodeForUISourceCode.get(uiSourceCode);
+ return rawSourceCode.uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber);
+ },
+
+ /**
+ * @return {Array.<WebInspector.UISourceCode>}
+ */
+ uiSourceCodeList: function()
+ {
+ var result = [];
+ for (var i = 0; i < this._rawSourceCodes.length; ++i) {
+ var uiSourceCodeList = this._rawSourceCodes[i].uiSourceCodeList();
+ for (var j = 0; j < uiSourceCodeList.length; ++j)
+ result.push(uiSourceCodeList[j]);
+ }
+ return result;
+ },
+
+ /**
+ * @param {WebInspector.Script} script
+ */
+ addScript: function(script)
+ {
+ var resource = null;
+ var isInlineScript = false;
+ if (script.isInlineScript()) {
+ resource = WebInspector.networkManager.inflightResourceForURL(script.sourceURL) || WebInspector.resourceForURL(script.sourceURL);
+ if (resource && resource.type === WebInspector.Resource.Type.Document) {
+ isInlineScript = true;
+ var rawSourceCode = this._rawSourceCodeForDocumentURL[script.sourceURL];
+ if (rawSourceCode) {
+ rawSourceCode.addScript(script);
+ this._bindScriptToRawSourceCode(script, rawSourceCode);
+ return;
+ }
+ }
+ }
+
+ var compilerSourceMapping = null;
+ if (WebInspector.settings.sourceMapsEnabled.get() && script.sourceMapURL)
+ compilerSourceMapping = new WebInspector.ClosureCompilerSourceMapping(script.sourceMapURL, script.sourceURL);
+
+ var rawSourceCode = new WebInspector.RawSourceCode(script.scriptId, script, resource, this._formatter, this._formatSource, compilerSourceMapping);
+ this._rawSourceCodes.push(rawSourceCode);
+ this._bindScriptToRawSourceCode(script, rawSourceCode);
+
+ if (isInlineScript)
+ this._rawSourceCodeForDocumentURL[script.sourceURL] = rawSourceCode;
+
+ if (rawSourceCode.uiSourceCodeList().length)
+ this._uiSourceCodeListChanged(rawSourceCode, [], rawSourceCode.uiSourceCodeList());
+ rawSourceCode.addEventListener(WebInspector.RawSourceCode.Events.UISourceCodeListChanged, this._handleUISourceCodeListChanged, this);
+ },
+
+ /**
+ * @param {WebInspector.Event} event
+ */
+ _handleUISourceCodeListChanged: function(event)
+ {
+ var rawSourceCode = /** @type {WebInspector.RawSourceCode} */ event.target;
+ var oldUISourceCodeList = /** @type {Array.<WebInspector.UISourceCode>} */ event.data["oldUISourceCodeList"];
+ this._uiSourceCodeListChanged(rawSourceCode, oldUISourceCodeList, rawSourceCode.uiSourceCodeList());
+ },
+
+ /**
+ * @param {WebInspector.RawSourceCode} rawSourceCode
+ * @param {Array.<WebInspector.UISourceCode>} removedItems
+ * @param {Array.<WebInspector.UISourceCode>} addedItems
+ */
+ _uiSourceCodeListChanged: function(rawSourceCode, removedItems, addedItems)
+ {
+ for (var i = 0; i < removedItems.length; ++i)
+ this._rawSourceCodeForUISourceCode.remove(removedItems[i]);
+ for (var i = 0; i < addedItems.length; ++i)
+ this._rawSourceCodeForUISourceCode.put(addedItems[i], rawSourceCode);
+
+ var scriptIds = [];
+ for (var i = 0; i < rawSourceCode._scripts.length; ++i)
+ scriptIds.push(rawSourceCode._scripts[i].scriptId);
+ var data = { removedItems: removedItems, addedItems: addedItems, scriptIds: scriptIds };
+ this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeListChanged, data);
+ },
+
+ /**
+ * @param {WebInspector.Script} script
+ * @param {WebInspector.RawSourceCode} rawSourceCode
+ */
+ _bindScriptToRawSourceCode: function(script, rawSourceCode)
+ {
+ this._rawSourceCodeForScriptId[script.scriptId] = rawSourceCode;
+ this._rawSourceCodeForURL[script.sourceURL] = rawSourceCode;
+ },
+
+ /**
+ * @param {boolean} formatSource
+ */
+ setFormatSource: function(formatSource)
+ {
+ if (this._formatSource === formatSource)
+ return;
+
+ this._formatSource = formatSource;
+ for (var i = 0; i < this._rawSourceCodes.length; ++i)
+ this._rawSourceCodes[i].setFormatted(this._formatSource);
+ },
+
+ /**
+ * @param {DebuggerAgent.Location} rawLocation
+ */
+ forceUpdateSourceMapping: function(rawLocation)
+ {
+ var rawSourceCode = this._rawSourceCodeForScriptId[rawLocation.scriptId];
+ rawSourceCode.forceUpdateSourceMapping();
+ },
+
+ reset: function()
+ {
+ for (var i = 0; i < this._rawSourceCodes.length; ++i) {
+ var rawSourceCode = this._rawSourceCodes[i];
+ this._uiSourceCodeListChanged(rawSourceCode, rawSourceCode.uiSourceCodeList(), []);
+ rawSourceCode.removeAllListeners();
+ }
+ this._rawSourceCodes = [];
+ this._rawSourceCodeForScriptId = {};
+ this._rawSourceCodeForURL = {};
+ this._rawSourceCodeForDocumentURL = {};
+ this._rawSourceCodeForUISourceCode.clear();
+ }
+}
+
+WebInspector.ResourceScriptMapping.prototype.__proto__ = WebInspector.ScriptMapping.prototype;
Modified: trunk/Source/WebCore/inspector/front-end/ScriptMapping.js (110548 => 110549)
--- trunk/Source/WebCore/inspector/front-end/ScriptMapping.js 2012-03-13 08:56:17 UTC (rev 110548)
+++ trunk/Source/WebCore/inspector/front-end/ScriptMapping.js 2012-03-13 09:10:42 UTC (rev 110549)
@@ -65,172 +65,6 @@
/**
* @constructor
- * @extends {WebInspector.ScriptMapping}
- */
-WebInspector.ResourceScriptMapping = function()
-{
- this._rawSourceCodes = [];
- this._rawSourceCodeForScriptId = {};
- this._rawSourceCodeForURL = {};
- this._rawSourceCodeForDocumentURL = {};
- this._rawSourceCodeForUISourceCode = new Map();
- this._formatter = new WebInspector.ScriptFormatter();
- this._formatSource = false;
-}
-
-WebInspector.ResourceScriptMapping.prototype = {
- /**
- * @param {DebuggerAgent.Location} rawLocation
- * @return {WebInspector.UILocation}
- */
- rawLocationToUILocation: function(rawLocation)
- {
- var rawSourceCode = this._rawSourceCodeForScriptId[rawLocation.scriptId];
- return rawSourceCode.rawLocationToUILocation(rawLocation);
- },
-
- /**
- * @param {WebInspector.UISourceCode} uiSourceCode
- * @param {number} lineNumber
- * @param {number} columnNumber
- * @return {DebuggerAgent.Location}
- */
- uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber)
- {
- var rawSourceCode = this._rawSourceCodeForUISourceCode.get(uiSourceCode);
- return rawSourceCode.uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber);
- },
-
- /**
- * @return {Array.<WebInspector.UISourceCode>}
- */
- uiSourceCodeList: function()
- {
- var result = [];
- for (var i = 0; i < this._rawSourceCodes.length; ++i) {
- var uiSourceCodeList = this._rawSourceCodes[i].uiSourceCodeList();
- for (var j = 0; j < uiSourceCodeList.length; ++j)
- result.push(uiSourceCodeList[j]);
- }
- return result;
- },
-
- /**
- * @param {WebInspector.Script} script
- */
- addScript: function(script)
- {
- var resource = null;
- var isInlineScript = false;
- if (script.isInlineScript()) {
- resource = WebInspector.networkManager.inflightResourceForURL(script.sourceURL) || WebInspector.resourceForURL(script.sourceURL);
- if (resource && resource.type === WebInspector.Resource.Type.Document) {
- isInlineScript = true;
- var rawSourceCode = this._rawSourceCodeForDocumentURL[script.sourceURL];
- if (rawSourceCode) {
- rawSourceCode.addScript(script);
- this._bindScriptToRawSourceCode(script, rawSourceCode);
- return;
- }
- }
- }
-
- var compilerSourceMapping = null;
- if (WebInspector.settings.sourceMapsEnabled.get() && script.sourceMapURL)
- compilerSourceMapping = new WebInspector.ClosureCompilerSourceMapping(script.sourceMapURL, script.sourceURL);
-
- var rawSourceCode = new WebInspector.RawSourceCode(script.scriptId, script, resource, this._formatter, this._formatSource, compilerSourceMapping);
- this._rawSourceCodes.push(rawSourceCode);
- this._bindScriptToRawSourceCode(script, rawSourceCode);
-
- if (isInlineScript)
- this._rawSourceCodeForDocumentURL[script.sourceURL] = rawSourceCode;
-
- if (rawSourceCode.uiSourceCodeList().length)
- this._uiSourceCodeListChanged(rawSourceCode, [], rawSourceCode.uiSourceCodeList());
- rawSourceCode.addEventListener(WebInspector.RawSourceCode.Events.UISourceCodeListChanged, this._handleUISourceCodeListChanged, this);
- },
-
- /**
- * @param {WebInspector.Event} event
- */
- _handleUISourceCodeListChanged: function(event)
- {
- var rawSourceCode = /** @type {WebInspector.RawSourceCode} */ event.target;
- var oldUISourceCodeList = /** @type {Array.<WebInspector.UISourceCode>} */ event.data["oldUISourceCodeList"];
- this._uiSourceCodeListChanged(rawSourceCode, oldUISourceCodeList, rawSourceCode.uiSourceCodeList());
- },
-
- /**
- * @param {WebInspector.RawSourceCode} rawSourceCode
- * @param {Array.<WebInspector.UISourceCode>} removedItems
- * @param {Array.<WebInspector.UISourceCode>} addedItems
- */
- _uiSourceCodeListChanged: function(rawSourceCode, removedItems, addedItems)
- {
- for (var i = 0; i < removedItems.length; ++i)
- this._rawSourceCodeForUISourceCode.remove(removedItems[i]);
- for (var i = 0; i < addedItems.length; ++i)
- this._rawSourceCodeForUISourceCode.put(addedItems[i], rawSourceCode);
-
- var scriptIds = [];
- for (var i = 0; i < rawSourceCode._scripts.length; ++i)
- scriptIds.push(rawSourceCode._scripts[i].scriptId);
- var data = { removedItems: removedItems, addedItems: addedItems, scriptIds: scriptIds };
- this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeListChanged, data);
- },
-
- /**
- * @param {WebInspector.Script} script
- * @param {WebInspector.RawSourceCode} rawSourceCode
- */
- _bindScriptToRawSourceCode: function(script, rawSourceCode)
- {
- this._rawSourceCodeForScriptId[script.scriptId] = rawSourceCode;
- this._rawSourceCodeForURL[script.sourceURL] = rawSourceCode;
- },
-
- /**
- * @param {boolean} formatSource
- */
- setFormatSource: function(formatSource)
- {
- if (this._formatSource === formatSource)
- return;
-
- this._formatSource = formatSource;
- for (var i = 0; i < this._rawSourceCodes.length; ++i)
- this._rawSourceCodes[i].setFormatted(this._formatSource);
- },
-
- /**
- * @param {DebuggerAgent.Location} rawLocation
- */
- forceUpdateSourceMapping: function(rawLocation)
- {
- var rawSourceCode = this._rawSourceCodeForScriptId[rawLocation.scriptId];
- rawSourceCode.forceUpdateSourceMapping();
- },
-
- reset: function()
- {
- for (var i = 0; i < this._rawSourceCodes.length; ++i) {
- var rawSourceCode = this._rawSourceCodes[i];
- this._uiSourceCodeListChanged(rawSourceCode, rawSourceCode.uiSourceCodeList(), []);
- rawSourceCode.removeAllListeners();
- }
- this._rawSourceCodes = [];
- this._rawSourceCodeForScriptId = {};
- this._rawSourceCodeForURL = {};
- this._rawSourceCodeForDocumentURL = {};
- this._rawSourceCodeForUISourceCode.clear();
- }
-}
-
-WebInspector.ResourceScriptMapping.prototype.__proto__ = WebInspector.ScriptMapping.prototype;
-
-/**
- * @constructor
* @extends {WebInspector.Object}
*/
WebInspector.MainScriptMapping = function()
Modified: trunk/Source/WebCore/inspector/front-end/WebKit.qrc (110548 => 110549)
--- trunk/Source/WebCore/inspector/front-end/WebKit.qrc 2012-03-13 08:56:17 UTC (rev 110548)
+++ trunk/Source/WebCore/inspector/front-end/WebKit.qrc 2012-03-13 09:10:42 UTC (rev 110549)
@@ -109,6 +109,7 @@
<file>ResourceHeadersView.js</file>
<file>ResourcePreviewView.js</file>
<file>ResourceResponseView.js</file>
+ <file>ResourceScriptMapping.js</file>
<file>ResourceTimingView.js</file>
<file>ResourceTreeModel.js</file>
<file>ResourceUtils.js</file>
Modified: trunk/Source/WebCore/inspector/front-end/inspector.html (110548 => 110549)
--- trunk/Source/WebCore/inspector/front-end/inspector.html 2012-03-13 08:56:17 UTC (rev 110548)
+++ trunk/Source/WebCore/inspector/front-end/inspector.html 2012-03-13 09:10:42 UTC (rev 110549)
@@ -174,6 +174,7 @@
<script type="text/_javascript_" src=""
<script type="text/_javascript_" src=""
<script type="text/_javascript_" src=""
+ <script type="text/_javascript_" src=""
<script type="text/_javascript_" src=""
<script type="text/_javascript_" src=""
<script type="text/_javascript_" src=""