| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 /** @type {?Promise<?string>} */ | 60 /** @type {?Promise<?string>} */ |
| 61 this._requestContentPromise = null; | 61 this._requestContentPromise = null; |
| 62 /** @type {!Map<string, !Map<number, !WebInspector.UISourceCode.LineMarker>>
} */ | 62 /** @type {!Map<string, !Map<number, !WebInspector.UISourceCode.LineMarker>>
} */ |
| 63 this._lineDecorations = new Map(); | 63 this._lineDecorations = new Map(); |
| 64 | 64 |
| 65 /** @type {!Array.<!WebInspector.Revision>} */ | 65 /** @type {!Array.<!WebInspector.Revision>} */ |
| 66 this.history = []; | 66 this.history = []; |
| 67 | 67 |
| 68 /** @type {!Array<!WebInspector.UISourceCode.Message>} */ | 68 /** @type {!Array<!WebInspector.UISourceCode.Message>} */ |
| 69 this._messages = []; | 69 this._messages = []; |
| 70 } | 70 }; |
| 71 | 71 |
| 72 /** @enum {symbol} */ | 72 /** @enum {symbol} */ |
| 73 WebInspector.UISourceCode.Events = { | 73 WebInspector.UISourceCode.Events = { |
| 74 WorkingCopyChanged: Symbol("WorkingCopyChanged"), | 74 WorkingCopyChanged: Symbol("WorkingCopyChanged"), |
| 75 WorkingCopyCommitted: Symbol("WorkingCopyCommitted"), | 75 WorkingCopyCommitted: Symbol("WorkingCopyCommitted"), |
| 76 TitleChanged: Symbol("TitleChanged"), | 76 TitleChanged: Symbol("TitleChanged"), |
| 77 SourceMappingChanged: Symbol("SourceMappingChanged"), | 77 SourceMappingChanged: Symbol("SourceMappingChanged"), |
| 78 MessageAdded: Symbol("MessageAdded"), | 78 MessageAdded: Symbol("MessageAdded"), |
| 79 MessageRemoved: Symbol("MessageRemoved"), | 79 MessageRemoved: Symbol("MessageRemoved"), |
| 80 LineDecorationAdded: Symbol("LineDecorationAdded"), | 80 LineDecorationAdded: Symbol("LineDecorationAdded"), |
| 81 LineDecorationRemoved: Symbol("LineDecorationRemoved") | 81 LineDecorationRemoved: Symbol("LineDecorationRemoved") |
| 82 } | 82 }; |
| 83 | 83 |
| 84 WebInspector.UISourceCode.prototype = { | 84 WebInspector.UISourceCode.prototype = { |
| 85 /** | 85 /** |
| 86 * @return {!Promise<?WebInspector.UISourceCodeMetadata>} | 86 * @return {!Promise<?WebInspector.UISourceCodeMetadata>} |
| 87 */ | 87 */ |
| 88 requestMetadata: function() | 88 requestMetadata: function() |
| 89 { | 89 { |
| 90 return this._project.requestMetadata(this); | 90 return this._project.requestMetadata(this); |
| 91 }, | 91 }, |
| 92 | 92 |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 /** | 706 /** |
| 707 * @param {string} type | 707 * @param {string} type |
| 708 * @return {?Map<number, !WebInspector.UISourceCode.LineMarker>} | 708 * @return {?Map<number, !WebInspector.UISourceCode.LineMarker>} |
| 709 */ | 709 */ |
| 710 lineDecorations: function(type) | 710 lineDecorations: function(type) |
| 711 { | 711 { |
| 712 return this._lineDecorations.get(type) || null; | 712 return this._lineDecorations.get(type) || null; |
| 713 }, | 713 }, |
| 714 | 714 |
| 715 __proto__: WebInspector.Object.prototype | 715 __proto__: WebInspector.Object.prototype |
| 716 } | 716 }; |
| 717 | 717 |
| 718 /** | 718 /** |
| 719 * @constructor | 719 * @constructor |
| 720 * @param {!WebInspector.UISourceCode} uiSourceCode | 720 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 721 * @param {number} lineNumber | 721 * @param {number} lineNumber |
| 722 * @param {number} columnNumber | 722 * @param {number} columnNumber |
| 723 */ | 723 */ |
| 724 WebInspector.UILocation = function(uiSourceCode, lineNumber, columnNumber) | 724 WebInspector.UILocation = function(uiSourceCode, lineNumber, columnNumber) |
| 725 { | 725 { |
| 726 this.uiSourceCode = uiSourceCode; | 726 this.uiSourceCode = uiSourceCode; |
| 727 this.lineNumber = lineNumber; | 727 this.lineNumber = lineNumber; |
| 728 this.columnNumber = columnNumber; | 728 this.columnNumber = columnNumber; |
| 729 } | 729 }; |
| 730 | 730 |
| 731 WebInspector.UILocation.prototype = { | 731 WebInspector.UILocation.prototype = { |
| 732 /** | 732 /** |
| 733 * @return {string} | 733 * @return {string} |
| 734 */ | 734 */ |
| 735 linkText: function() | 735 linkText: function() |
| 736 { | 736 { |
| 737 var linkText = this.uiSourceCode.displayName(); | 737 var linkText = this.uiSourceCode.displayName(); |
| 738 if (typeof this.lineNumber === "number") | 738 if (typeof this.lineNumber === "number") |
| 739 linkText += ":" + (this.lineNumber + 1); | 739 linkText += ":" + (this.lineNumber + 1); |
| 740 return linkText; | 740 return linkText; |
| 741 }, | 741 }, |
| 742 | 742 |
| 743 /** | 743 /** |
| 744 * @return {string} | 744 * @return {string} |
| 745 */ | 745 */ |
| 746 id: function() | 746 id: function() |
| 747 { | 747 { |
| 748 return this.uiSourceCode.project().id() + ":" + this.uiSourceCode.url()
+ ":" + this.lineNumber + ":" + this.columnNumber; | 748 return this.uiSourceCode.project().id() + ":" + this.uiSourceCode.url()
+ ":" + this.lineNumber + ":" + this.columnNumber; |
| 749 }, | 749 }, |
| 750 | 750 |
| 751 /** | 751 /** |
| 752 * @return {string} | 752 * @return {string} |
| 753 */ | 753 */ |
| 754 toUIString: function() | 754 toUIString: function() |
| 755 { | 755 { |
| 756 return this.uiSourceCode.url() + ":" + (this.lineNumber + 1); | 756 return this.uiSourceCode.url() + ":" + (this.lineNumber + 1); |
| 757 } | 757 } |
| 758 } | 758 }; |
| 759 | 759 |
| 760 /** | 760 /** |
| 761 * @constructor | 761 * @constructor |
| 762 * @implements {WebInspector.ContentProvider} | 762 * @implements {WebInspector.ContentProvider} |
| 763 * @param {!WebInspector.UISourceCode} uiSourceCode | 763 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 764 * @param {?string|undefined} content | 764 * @param {?string|undefined} content |
| 765 * @param {!Date} timestamp | 765 * @param {!Date} timestamp |
| 766 */ | 766 */ |
| 767 WebInspector.Revision = function(uiSourceCode, content, timestamp) | 767 WebInspector.Revision = function(uiSourceCode, content, timestamp) |
| 768 { | 768 { |
| 769 this._uiSourceCode = uiSourceCode; | 769 this._uiSourceCode = uiSourceCode; |
| 770 this._content = content; | 770 this._content = content; |
| 771 this._timestamp = timestamp; | 771 this._timestamp = timestamp; |
| 772 } | 772 }; |
| 773 | 773 |
| 774 WebInspector.Revision.prototype = { | 774 WebInspector.Revision.prototype = { |
| 775 /** | 775 /** |
| 776 * @return {!WebInspector.UISourceCode} | 776 * @return {!WebInspector.UISourceCode} |
| 777 */ | 777 */ |
| 778 get uiSourceCode() | 778 get uiSourceCode() |
| 779 { | 779 { |
| 780 return this._uiSourceCode; | 780 return this._uiSourceCode; |
| 781 }, | 781 }, |
| 782 | 782 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 * @override | 845 * @override |
| 846 * @param {string} query | 846 * @param {string} query |
| 847 * @param {boolean} caseSensitive | 847 * @param {boolean} caseSensitive |
| 848 * @param {boolean} isRegex | 848 * @param {boolean} isRegex |
| 849 * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} cal
lback | 849 * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} cal
lback |
| 850 */ | 850 */ |
| 851 searchInContent: function(query, caseSensitive, isRegex, callback) | 851 searchInContent: function(query, caseSensitive, isRegex, callback) |
| 852 { | 852 { |
| 853 callback([]); | 853 callback([]); |
| 854 } | 854 } |
| 855 } | 855 }; |
| 856 | 856 |
| 857 /** | 857 /** |
| 858 * @constructor | 858 * @constructor |
| 859 * @param {!WebInspector.UISourceCode} uiSourceCode | 859 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 860 * @param {!WebInspector.UISourceCode.Message.Level} level | 860 * @param {!WebInspector.UISourceCode.Message.Level} level |
| 861 * @param {string} text | 861 * @param {string} text |
| 862 * @param {!WebInspector.TextRange} range | 862 * @param {!WebInspector.TextRange} range |
| 863 */ | 863 */ |
| 864 WebInspector.UISourceCode.Message = function(uiSourceCode, level, text, range) | 864 WebInspector.UISourceCode.Message = function(uiSourceCode, level, text, range) |
| 865 { | 865 { |
| 866 this._uiSourceCode = uiSourceCode; | 866 this._uiSourceCode = uiSourceCode; |
| 867 this._level = level; | 867 this._level = level; |
| 868 this._text = text; | 868 this._text = text; |
| 869 this._range = range; | 869 this._range = range; |
| 870 } | 870 }; |
| 871 | 871 |
| 872 /** | 872 /** |
| 873 * @enum {string} | 873 * @enum {string} |
| 874 */ | 874 */ |
| 875 WebInspector.UISourceCode.Message.Level = { | 875 WebInspector.UISourceCode.Message.Level = { |
| 876 Error: "Error", | 876 Error: "Error", |
| 877 Warning: "Warning" | 877 Warning: "Warning" |
| 878 } | 878 }; |
| 879 | 879 |
| 880 WebInspector.UISourceCode.Message.prototype = { | 880 WebInspector.UISourceCode.Message.prototype = { |
| 881 /** | 881 /** |
| 882 * @return {!WebInspector.UISourceCode} | 882 * @return {!WebInspector.UISourceCode} |
| 883 */ | 883 */ |
| 884 uiSourceCode: function() | 884 uiSourceCode: function() |
| 885 { | 885 { |
| 886 return this._uiSourceCode; | 886 return this._uiSourceCode; |
| 887 }, | 887 }, |
| 888 | 888 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 */ | 932 */ |
| 933 isEqual: function(another) | 933 isEqual: function(another) |
| 934 { | 934 { |
| 935 return this._uiSourceCode === another._uiSourceCode && this.text() === a
nother.text() && this.level() === another.level() && this.range().equal(another.
range()); | 935 return this._uiSourceCode === another._uiSourceCode && this.text() === a
nother.text() && this.level() === another.level() && this.range().equal(another.
range()); |
| 936 }, | 936 }, |
| 937 | 937 |
| 938 remove: function() | 938 remove: function() |
| 939 { | 939 { |
| 940 this._uiSourceCode.removeMessage(this); | 940 this._uiSourceCode.removeMessage(this); |
| 941 } | 941 } |
| 942 } | 942 }; |
| 943 | 943 |
| 944 /** | 944 /** |
| 945 * @constructor | 945 * @constructor |
| 946 * @param {number} line | 946 * @param {number} line |
| 947 * @param {string} type | 947 * @param {string} type |
| 948 * @param {?} data | 948 * @param {?} data |
| 949 */ | 949 */ |
| 950 WebInspector.UISourceCode.LineMarker = function(line, type, data) | 950 WebInspector.UISourceCode.LineMarker = function(line, type, data) |
| 951 { | 951 { |
| 952 this._line = line; | 952 this._line = line; |
| 953 this._type = type; | 953 this._type = type; |
| 954 this._data = data; | 954 this._data = data; |
| 955 } | 955 }; |
| 956 | 956 |
| 957 WebInspector.UISourceCode.LineMarker.prototype = { | 957 WebInspector.UISourceCode.LineMarker.prototype = { |
| 958 /** | 958 /** |
| 959 * @return {number} | 959 * @return {number} |
| 960 */ | 960 */ |
| 961 line: function() | 961 line: function() |
| 962 { | 962 { |
| 963 return this._line; | 963 return this._line; |
| 964 }, | 964 }, |
| 965 | 965 |
| 966 /** | 966 /** |
| 967 * @return {string} | 967 * @return {string} |
| 968 */ | 968 */ |
| 969 type: function() | 969 type: function() |
| 970 { | 970 { |
| 971 return this._type; | 971 return this._type; |
| 972 }, | 972 }, |
| 973 | 973 |
| 974 /** | 974 /** |
| 975 * @return {*} | 975 * @return {*} |
| 976 */ | 976 */ |
| 977 data: function() | 977 data: function() |
| 978 { | 978 { |
| 979 return this._data; | 979 return this._data; |
| 980 } | 980 } |
| 981 } | 981 }; |
| 982 | 982 |
| 983 /** | 983 /** |
| 984 * @constructor | 984 * @constructor |
| 985 * @param {?Date} modificationTime | 985 * @param {?Date} modificationTime |
| 986 * @param {?number} contentSize | 986 * @param {?number} contentSize |
| 987 */ | 987 */ |
| 988 WebInspector.UISourceCodeMetadata = function(modificationTime, contentSize) | 988 WebInspector.UISourceCodeMetadata = function(modificationTime, contentSize) |
| 989 { | 989 { |
| 990 this.modificationTime = modificationTime; | 990 this.modificationTime = modificationTime; |
| 991 this.contentSize = contentSize; | 991 this.contentSize = contentSize; |
| 992 } | 992 }; |
| OLD | NEW |