[webkit-reviews] review requested: [Bug 38711] [chromium] DragDataChromium::asURL() shouldn't do file validity checks : [Attachment 55632] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 10 18:10:12 PDT 2010


Daniel Cheng <dcheng at chromium.org> has asked  for review:
Bug 38711: [chromium] DragDataChromium::asURL() shouldn't do file validity
checks
https://bugs.webkit.org/show_bug.cgi?id=38711

Attachment 55632: Patch
https://bugs.webkit.org/attachment.cgi?id=55632&action=review

------- Additional Comments from Daniel Cheng <dcheng at chromium.org>
Just looking for comments for now. Dmitry commented that there might be some
rationale for DragData::asURL to try as hard as possible to not return file://
URLs pointing to things that are not files.

Here are my arguments for why DragData::asURL shouldn't bother trying so hard:
1. Checking the file exists doesn't help much, since the loader will end up
needing to do the check too.
2. File IO can be expensive. Why do it twice when you can do it once.
3. This code was never hit on Chromium anyway, due to the fact that we always
populate the URL field if we see a URL-like thing in the drag (where that
URL-like thing is plain text that happens to resemble a URL, a file object,
etc).
4. If the renderer is sandboxed (which more platforms are starting to move
towards), the calls will fail. This is already true of Chromium on Windows.
Might as well let something which is privileged like the loader handle it.


More information about the webkit-reviews mailing list