Title: [122482] trunk/Source/WebCore
Revision
122482
Author
vse...@chromium.org
Date
2012-07-12 10:59:02 -0700 (Thu, 12 Jul 2012)

Log Message

Web Inspector: Simplify UISourceCode code after moving revisions support inside it.
https://bugs.webkit.org/show_bug.cgi?id=91118

Reviewed by Pavel Feldman.

* inspector/front-end/UISourceCode.js:
(WebInspector.UISourceCode.prototype._setContent):
(WebInspector.UISourceCode.prototype.revertToOriginal):
(WebInspector.UISourceCode.prototype.revertAndClearHistory):
(WebInspector.UISourceCode.prototype.contentChanged):
(WebInspector.UISourceCode.prototype.commitWorkingCopy):
(WebInspector.Revision.prototype.revertToThis):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (122481 => 122482)


--- trunk/Source/WebCore/ChangeLog	2012-07-12 17:57:41 UTC (rev 122481)
+++ trunk/Source/WebCore/ChangeLog	2012-07-12 17:59:02 UTC (rev 122482)
@@ -1,3 +1,18 @@
+2012-07-12  Vsevolod Vlasov  <vse...@chromium.org>
+
+        Web Inspector: Simplify UISourceCode code after moving revisions support inside it.
+        https://bugs.webkit.org/show_bug.cgi?id=91118
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/front-end/UISourceCode.js:
+        (WebInspector.UISourceCode.prototype._setContent):
+        (WebInspector.UISourceCode.prototype.revertToOriginal):
+        (WebInspector.UISourceCode.prototype.revertAndClearHistory):
+        (WebInspector.UISourceCode.prototype.contentChanged):
+        (WebInspector.UISourceCode.prototype.commitWorkingCopy):
+        (WebInspector.Revision.prototype.revertToThis):
+
 2012-07-12  Allan Sandfeld Jensen  <allan.jen...@nokia.com>
 
         Unreviewed. Build fix for r122462.

Modified: trunk/Source/WebCore/inspector/front-end/UISourceCode.js (122481 => 122482)


--- trunk/Source/WebCore/inspector/front-end/UISourceCode.js	2012-07-12 17:57:41 UTC (rev 122481)
+++ trunk/Source/WebCore/inspector/front-end/UISourceCode.js	2012-07-12 17:59:02 UTC (rev 122482)
@@ -149,14 +149,11 @@
 
     /**
      * @param {string} newContent
-     * @param {function(?string)} callback
      */
-    _setContent: function(newContent, callback)
+    _setContent: function(newContent)
     {
-        if (!this.isEditable())
-            return;
         this.setWorkingCopy(newContent);
-        this.commitWorkingCopy(callback);
+        this.commitWorkingCopy(function() {});
     },
 
     /**
@@ -206,22 +203,24 @@
    
     revertToOriginal: function()
     {
-        function revert(content)
+        /**
+         * @param {?string} content
+         * @param {boolean} contentEncoded
+         * @param {string} mimeType
+         */
+      function callback(content, contentEncoded, mimeType)
         {
-            this._setContent(content, function() {});
+            this._setContent();
         }
-        this.requestOriginalContent(revert.bind(this));
+
+        this.requestOriginalContent(callback.bind(this));
     },
 
     revertAndClearHistory: function(callback)
     {
         function revert(content)
         {
-            this._setContent(content, clearHistory.bind(this));
-        }
-
-        function clearHistory()
-        {
+            this._setContent(content);
             this._clearRevisionHistory();
             this.history = [];
             callback();
@@ -236,9 +235,6 @@
      */
     contentChanged: function(newContent, mimeType)
     {
-        if (this._committingWorkingCopy)
-            return;
-
         this._content = newContent;
         this._mimeType = mimeType;
         this._contentLoaded = true;
@@ -294,12 +290,8 @@
         }
 
         var newContent = this._workingCopy;
-        this._committingWorkingCopy = true;
         this.workingCopyCommitted(callback);
         this.addRevision(newContent);
-        delete this._committingWorkingCopy;
-        this.contentChanged(newContent, this._mimeType);
-
     },
 
     /**
@@ -619,7 +611,7 @@
         function revert(content)
         {
             if (this._uiSourceCode._content !== content)
-                this._uiSourceCode._setContent(content, function() {});
+                this._uiSourceCode._setContent(content);
         }
         this.requestContent(revert.bind(this));
     },
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to