Bug 85710 - Web Inspector: convert standalone functions save/append/savedURL/appendedToURL into WebInspector.FileManager object.
Summary: Web Inspector: convert standalone functions save/append/savedURL/appendedToUR...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Ilya Tikhonovsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-05 07:47 PDT by Ilya Tikhonovsky
Modified: 2012-05-05 08:35 PDT (History)
10 users (show)

See Also:


Attachments
Patch (14.69 KB, patch)
2012-05-05 07:49 PDT, Ilya Tikhonovsky
yurys: review+
Details | Formatted Diff | Diff
actually landed (18.12 KB, patch)
2012-05-05 08:35 PDT, Ilya Tikhonovsky
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Tikhonovsky 2012-05-05 07:47:18 PDT
The idea is to have an object and be able to add/remove event listeners from it.
Comment 1 Ilya Tikhonovsky 2012-05-05 07:49:24 PDT
Created attachment 140399 [details]
Patch
Comment 2 Yury Semikhatsky 2012-05-05 07:58:32 PDT
Comment on attachment 140399 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=140399&action=review

> Source/WebCore/inspector/front-end/HeapSnapshotView.js:872
> +        return this._loaded && !this._savedChunksCount && WebInspector.fileManager.canAppendTo();

canAppendTo -> canAppend as there is no argument.

> Source/WebCore/inspector/front-end/HeapSnapshotView.js:878
> +    _startWritingSnapshot: function(event)

I'd leave this function internal to save(), you should be able to remove it as WebInspector.fileManager.removeEventListener(WebInspector.FileManager.EventTypes.SavedURL, startWritingSnapshot, this);

> Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js:184
> +WebInspector.FileManager = function()

Move it to a separate file?
Comment 3 Ilya Tikhonovsky 2012-05-05 08:32:28 PDT
Committed r116222: <http://trac.webkit.org/changeset/116222>
Comment 4 Ilya Tikhonovsky 2012-05-05 08:35:08 PDT
(In reply to comment #2)
> (From update of attachment 140399 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=140399&action=review
> 
> > Source/WebCore/inspector/front-end/HeapSnapshotView.js:872
> > +        return this._loaded && !this._savedChunksCount && WebInspector.fileManager.canAppendTo();

done 

> 
> canAppendTo -> canAppend as there is no argument.
> 
> > Source/WebCore/inspector/front-end/HeapSnapshotView.js:878
> > +    _startWritingSnapshot: function(event)
> 
> I'd leave this function internal to save(), you should be able to remove it as WebInspector.fileManager.removeEventListener(WebInspector.FileManager.EventTypes.SavedURL, startWritingSnapshot, this);

done

> 
> > Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js:184
> > +WebInspector.FileManager = function()
> 
> Move it to a separate file?

done
Comment 5 Ilya Tikhonovsky 2012-05-05 08:35:55 PDT
Created attachment 140403 [details]
actually landed