Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Unified Diff: Source/WebCore/inspector/front-end/UISourceCode.js

Issue 11039015: Merge 129648 - Web Inspector: [REGRESSION] Revision support problems: revert and apply original con… (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1271/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/inspector/uisourcecode-revisions-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/inspector/front-end/UISourceCode.js
===================================================================
--- Source/WebCore/inspector/front-end/UISourceCode.js (revision 130130)
+++ Source/WebCore/inspector/front-end/UISourceCode.js (working copy)
@@ -204,26 +204,42 @@
revertToOriginal: function()
{
/**
+ * @this {WebInspector.UISourceCode}
* @param {?string} content
* @param {boolean} contentEncoded
* @param {string} mimeType
*/
- function callback(content, contentEncoded, mimeType)
+ function callback(content, contentEncoded, mimeType)
{
- this._setContent();
+ if (typeof content === "undefined")
+ return;
+
+ this._setContent(/** @type {string} */ content);
}
this.requestOriginalContent(callback.bind(this));
},
+ /**
+ * @param {function(WebInspector.UISourceCode)} callback
+ */
revertAndClearHistory: function(callback)
{
- function revert(content)
+ /**
+ * @this {WebInspector.UISourceCode}
+ * @param {?string} content
+ * @param {boolean} contentEncoded
+ * @param {string} mimeType
+ */
+ function revert(content, contentEncoded, mimeType)
{
- this._setContent(content);
+ if (typeof content === "undefined")
+ return;
+
+ this._setContent(/** @type {string} */ content);
this._clearRevisionHistory();
this.history = [];
- callback();
+ callback(this);
}
this.requestOriginalContent(revert.bind(this));
« no previous file with comments | « LayoutTests/inspector/uisourcecode-revisions-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698