W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2011

[whatwg] Drag-and-drop folders/files support with directory structure using DirectoryEntry

From: Glenn Maynard <glenn@zewt.org>
Date: Thu, 17 Nov 2011 23:00:13 -0500
Message-ID: <CABirCh_yZzvMrhOvCvZJcpV8Q9eErA7GcWw+iXHSf_4dE0HSCA@mail.gmail.com>
On Thu, Nov 17, 2011 at 10:47 PM, Kinuko Yasuda <kinuko at chromium.org> wrote:

> I mean the URL would essentially be a weak reference to the backing
> file, but it won't keep the backing file alive.
> (At least in sandboxed cases) the filesystem URLs are more like
> 'public address' and not coupled with any particular Entry instances.
> One can make up a URL just by concatenating strings and then can get
> the Entry from the URL.
>

Right, but we're talking about the non-sandboxed case.

What I'm going to do is: create a set of capabilities upon drag event,
> give the capabilities to the context when it was dropped, and revoke
> the capabilities when the context gets deleted (i.e. the page is
> closed).  The lifetime of the Entry instance object doesn't matter in
> this case; Entry is yet another weak reference to the backing file but
> doesn't mean a live reference or access right.
>

This implies a memory leak, as each time you drag a file into a page, you
permanently (for the lifetime of the document) create a record that the
page is allowed to access that file.  If you drag lots of individual files
into the page, this leak could become nontrivial.  I don't think a design
with inherent memory leaks is a good direction.

-- 
Glenn Maynard
Received on Thursday, 17 November 2011 20:00:13 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:09 UTC