WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
89642
Web Inspector: Add requestFileContent command and fileContentReceived event
https://bugs.webkit.org/show_bug.cgi?id=89642
Summary
Web Inspector: Add requestFileContent command and fileContentReceived event
Taiju Tsuiki
Reported
2012-06-21 01:12:00 PDT
Preparing for adding FileContentView to Inspector, I'd like to add a command to read file content.
Attachments
Patch
(17.84 KB, patch)
2012-06-21 01:15 PDT
,
Taiju Tsuiki
no flags
Details
Formatted Diff
Diff
Patch
(17.66 KB, patch)
2012-06-24 20:50 PDT
,
Taiju Tsuiki
no flags
Details
Formatted Diff
Diff
Patch
(18.30 KB, patch)
2012-07-01 23:19 PDT
,
Taiju Tsuiki
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Taiju Tsuiki
Comment 1
2012-06-21 01:15:44 PDT
Created
attachment 148744
[details]
Patch
Taiju Tsuiki
Comment 2
2012-06-24 20:50:27 PDT
Created
attachment 149234
[details]
Patch
Vsevolod Vlasov
Comment 3
2012-06-28 12:19:17 PDT
Comment on
attachment 149234
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=149234&action=review
Could you please share your plans on using the data loaded as a dataURL on front-end? Why do think dataURL is the best format for passing it to front-end? We already have some methods for loading content (including base64 encoded) in InspectorPageAgent. Can we reuse something to make code simpler?
> Source/WebCore/inspector/Inspector.json:1479 > + { "name": "end", "type": "integer", "description": "Index of the next of last byte to read." }
next of last?
Taiju Tsuiki
Comment 4
2012-06-29 00:38:43 PDT
I (In reply to
comment #3
)
> (From update of
attachment 149234
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=149234&action=review
> > Could you please share your plans on using the data loaded as a dataURL on front-end? > Why do think dataURL is the best format for passing it to front-end? > > We already have some methods for loading content (including base64 encoded) in InspectorPageAgent. Can we reuse something to make code simpler? >
OK. I'd like to preview text files, images and fonts on Inspector, like other resources in initial version. And also as a next step, I want to add "save as". Considering remote debugging, we need to store whole file content in front-end to implement it, because filesystem: URL is available only on back-end. I'll use sliced retrieving to avoid blocking channel to backend. I don't have strong opinion for what format we should use. It's OK for me to use base64. # Of course, it's best to use binary format if we could. Data URL was from a old code when I tried to read it with XHR in earlier version, which not allowed in WebKit. InspectorPageAgent::getResourceContent() looks nice, but it can load only a resource on the frame, can't it? For my use, I need to load other resources, not already loaded nor on cache.
> > Source/WebCore/inspector/Inspector.json:1479 > > + { "name": "end", "type": "integer", "description": "Index of the next of last byte to read." } > > next of last?
Taiju Tsuiki
Comment 5
2012-06-29 00:39:13 PDT
Comment on
attachment 149234
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=149234&action=review
>> Source/WebCore/inspector/Inspector.json:1479 >> + { "name": "end", "type": "integer", "description": "Index of the next of last byte to read." } > > next of last?
I mean, the range to read does not include end'th byte, as {String,Array,Blob}.slice do. I'll replace it with "Specifies the end of range to read exclusively." in next patch.
Taiju Tsuiki
Comment 6
2012-07-01 23:19:03 PDT
Created
attachment 150361
[details]
Patch
Vsevolod Vlasov
Comment 7
2012-07-02 04:56:57 PDT
Comment on
attachment 150361
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=150361&action=review
> Source/WebCore/inspector/InspectorFileSystemAgent.cpp:528 > + String encodedResult = base64Encode(static_cast<char*>(result->data()), result->byteLength());
I think we will need to use FileReader::getAsText to deal with text files encodings at some point, but we can add it later.
WebKit Review Bot
Comment 8
2012-07-02 07:12:22 PDT
Comment on
attachment 150361
[details]
Patch Clearing flags on attachment: 150361 Committed
r121676
: <
http://trac.webkit.org/changeset/121676
>
WebKit Review Bot
Comment 9
2012-07-02 07:12:27 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug