OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 24 matching lines...) Expand all Loading... |
35 * @param {string=} sourceMapURL | 35 * @param {string=} sourceMapURL |
36 */ | 36 */ |
37 WebInspector.Script = function(scriptId, sourceURL, startLine, startColumn, endL
ine, endColumn, isContentScript, sourceMapURL) | 37 WebInspector.Script = function(scriptId, sourceURL, startLine, startColumn, endL
ine, endColumn, isContentScript, sourceMapURL) |
38 { | 38 { |
39 this.scriptId = scriptId; | 39 this.scriptId = scriptId; |
40 this.sourceURL = sourceURL; | 40 this.sourceURL = sourceURL; |
41 this.lineOffset = startLine; | 41 this.lineOffset = startLine; |
42 this.columnOffset = startColumn; | 42 this.columnOffset = startColumn; |
43 this.endLine = endLine; | 43 this.endLine = endLine; |
44 this.endColumn = endColumn; | 44 this.endColumn = endColumn; |
45 this.isContentScript = isContentScript; | 45 // M19 band-aid that treats whitelist of short file names as content scripts
. These are not valid URLs, so it is safe to assume these are likely to be conte
nt scripts. |
| 46 this.isContentScript = isContentScript || sourceURL === "apitest" || sourceU
RL === "event_bindings" || sourceURL === "extension" || sourceURL === "i18n" ||
sourceURL === "json_schema" || sourceURL === "miscellaneous_bindings" || sourceU
RL === "schema_generated_bindings" || sourceURL === "sendRequest"; |
46 this.sourceMapURL = sourceMapURL; | 47 this.sourceMapURL = sourceMapURL; |
47 } | 48 } |
48 | 49 |
49 WebInspector.Script.prototype = { | 50 WebInspector.Script.prototype = { |
50 /** | 51 /** |
51 * @param {function(string)} callback | 52 * @param {function(string)} callback |
52 */ | 53 */ |
53 requestSource: function(callback) | 54 requestSource: function(callback) |
54 { | 55 { |
55 if (this._source) { | 56 if (this._source) { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 }, | 132 }, |
132 | 133 |
133 /** | 134 /** |
134 * @return {boolean} | 135 * @return {boolean} |
135 */ | 136 */ |
136 isInlineScript: function() | 137 isInlineScript: function() |
137 { | 138 { |
138 return !!this.sourceURL && this.lineOffset !== 0 && this.columnOffset !=
= 0; | 139 return !!this.sourceURL && this.lineOffset !== 0 && this.columnOffset !=
= 0; |
139 } | 140 } |
140 } | 141 } |
OLD | NEW |