Changeset 147227 in webkit


Ignore:
Timestamp:
Mar 29, 2013 10:24:52 AM (11 years ago)
Author:
vsevik@chromium.org
Message:

Web Inspector: Content should not be lost when uiSourceCode's file was removed externally on file system.
https://bugs.webkit.org/show_bug.cgi?id=113581

Reviewed by Pavel Feldman.

  • inspector/front-end/IsolatedFileSystem.js:

(WebInspector.IsolatedFileSystem.prototype.errorHandler):
(WebInspector.IsolatedFileSystem.prototype.requestFileContent):
(WebInspector.IsolatedFileSystem.prototype.fileSystemLoaded):

  • inspector/front-end/UISourceCode.js:

(WebInspector.UISourceCode.prototype.checkContentUpdated.contentLoaded):
(WebInspector.UISourceCode.prototype.checkContentUpdated):
(WebInspector.UISourceCode.prototype._commitContent):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r147226 r147227  
     12013-03-29  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Web Inspector: Content should not be lost when uiSourceCode's file was removed externally on file system.
     4        https://bugs.webkit.org/show_bug.cgi?id=113581
     5
     6        Reviewed by Pavel Feldman.
     7
     8        * inspector/front-end/IsolatedFileSystem.js:
     9        (WebInspector.IsolatedFileSystem.prototype.errorHandler):
     10        (WebInspector.IsolatedFileSystem.prototype.requestFileContent):
     11        (WebInspector.IsolatedFileSystem.prototype.fileSystemLoaded):
     12        * inspector/front-end/UISourceCode.js:
     13        (WebInspector.UISourceCode.prototype.checkContentUpdated.contentLoaded):
     14        (WebInspector.UISourceCode.prototype.checkContentUpdated):
     15        (WebInspector.UISourceCode.prototype._commitContent):
     16
    1172013-03-29  Vsevolod Vlasov  <vsevik@chromium.org>
    218
  • trunk/Source/WebCore/inspector/front-end/IsolatedFileSystem.js

    r145221 r147227  
    179179        function errorHandler(error)
    180180        {
     181            if (error.code === FileError.NOT_FOUND_ERR) {
     182                callback(null);
     183                return;
     184            }
     185
    181186            var errorMessage = WebInspector.IsolatedFileSystem.errorMessage(error);
    182187            console.error(errorMessage + " when getting content for file '" + (this._path + "/" + path) + "'");
     
    199204        function fileSystemLoaded(domFileSystem)
    200205        {
    201             domFileSystem.root.getFile(path, null, fileEntryLoaded, errorHandler);
     206            domFileSystem.root.getFile(path, { create: true }, fileEntryLoaded, errorHandler);
    202207        }
    203208
  • trunk/Source/WebCore/inspector/front-end/UISourceCode.js

    r147226 r147227  
    226226        function contentLoaded(updatedContent)
    227227        {
     228            if (updatedContent === null) {
     229                var workingCopy = this.workingCopy();
     230                this._commitContent("", false);
     231                this.setWorkingCopy(workingCopy);
     232                delete this._checkingContent;
     233                return;
     234            }
    228235            if (typeof this._lastAcceptedContent === "string" && this._lastAcceptedContent === updatedContent) {
    229236                delete this._checkingContent;
     
    231238            }
    232239            if (this._content === updatedContent) {
     240                delete this._lastAcceptedContent;
    233241                delete this._checkingContent;
    234242                return;
     
    264272    _commitContent: function(content, shouldSetContentInProject)
    265273    {
     274        delete this._lastAcceptedContent;
    266275        this._content = content;
    267276        this._contentLoaded = true;
Note: See TracChangeset for help on using the changeset viewer.