Changeset 122482 in webkit
- Timestamp:
- Jul 12, 2012 10:59:02 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r122474 r122482 1 2012-07-12 Vsevolod Vlasov <vsevik@chromium.org> 2 3 Web Inspector: Simplify UISourceCode code after moving revisions support inside it. 4 https://bugs.webkit.org/show_bug.cgi?id=91118 5 6 Reviewed by Pavel Feldman. 7 8 * inspector/front-end/UISourceCode.js: 9 (WebInspector.UISourceCode.prototype._setContent): 10 (WebInspector.UISourceCode.prototype.revertToOriginal): 11 (WebInspector.UISourceCode.prototype.revertAndClearHistory): 12 (WebInspector.UISourceCode.prototype.contentChanged): 13 (WebInspector.UISourceCode.prototype.commitWorkingCopy): 14 (WebInspector.Revision.prototype.revertToThis): 15 1 16 2012-07-12 Allan Sandfeld Jensen <allan.jensen@nokia.com> 2 17 -
trunk/Source/WebCore/inspector/front-end/UISourceCode.js
r122454 r122482 150 150 /** 151 151 * @param {string} newContent 152 * @param {function(?string)} callback 153 */ 154 _setContent: function(newContent, callback) 155 { 156 if (!this.isEditable()) 157 return; 152 */ 153 _setContent: function(newContent) 154 { 158 155 this.setWorkingCopy(newContent); 159 this.commitWorkingCopy( callback);156 this.commitWorkingCopy(function() {}); 160 157 }, 161 158 … … 207 204 revertToOriginal: function() 208 205 { 206 /** 207 * @param {?string} content 208 * @param {boolean} contentEncoded 209 * @param {string} mimeType 210 */ 211 function callback(content, contentEncoded, mimeType) 212 { 213 this._setContent(); 214 } 215 216 this.requestOriginalContent(callback.bind(this)); 217 }, 218 219 revertAndClearHistory: function(callback) 220 { 209 221 function revert(content) 210 222 { 211 this._setContent(content, function() {}); 212 } 213 this.requestOriginalContent(revert.bind(this)); 214 }, 215 216 revertAndClearHistory: function(callback) 217 { 218 function revert(content) 219 { 220 this._setContent(content, clearHistory.bind(this)); 221 } 222 223 function clearHistory() 224 { 223 this._setContent(content); 225 224 this._clearRevisionHistory(); 226 225 this.history = []; … … 237 236 contentChanged: function(newContent, mimeType) 238 237 { 239 if (this._committingWorkingCopy)240 return;241 242 238 this._content = newContent; 243 239 this._mimeType = mimeType; … … 295 291 296 292 var newContent = this._workingCopy; 297 this._committingWorkingCopy = true;298 293 this.workingCopyCommitted(callback); 299 294 this.addRevision(newContent); 300 delete this._committingWorkingCopy;301 this.contentChanged(newContent, this._mimeType);302 303 295 }, 304 296 … … 620 612 { 621 613 if (this._uiSourceCode._content !== content) 622 this._uiSourceCode._setContent(content , function() {});614 this._uiSourceCode._setContent(content); 623 615 } 624 616 this.requestContent(revert.bind(this));
Note: See TracChangeset
for help on using the changeset viewer.