Bug 46028 - [FileSystem] Fix Flags handling in DirectoryEntry custom binding code
Summary: [FileSystem] Fix Flags handling in DirectoryEntry custom binding code
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 42903
  Show dependency treegraph
 
Reported: 2010-09-17 22:57 PDT by Kinuko Yasuda
Modified: 2010-09-30 13:39 PDT (History)
2 users (show)

See Also:


Attachments
Patch (11.54 KB, patch)
2010-09-17 23:03 PDT, Kinuko Yasuda
dumi: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kinuko Yasuda 2010-09-17 22:57:42 PDT
DirectoryEntry's custom code added by issue 45724 for FileSystem API has wrong RefPtr handling.

When the given flags argument is an instance of Flags object, the custom code calls adoptRef to get a RefPtr from a raw Flags pointer returned by toFlags/toNative.
However, toFlags/toNative returns an already adopted pointer so it should just assign the returned pointer rather than adopt assignment (the latter doesn't increment refCount).
Comment 1 Kinuko Yasuda 2010-09-17 23:03:28 PDT
Created attachment 67997 [details]
Patch
Comment 2 Dumitru Daniliuc 2010-09-20 13:52:06 PDT
Comment on attachment 67997 [details]
Patch

r=me.

toFlags() returns a ref-counted object, because WebCore::Flags is ref-counted, right? if this is correct, it might be nice to mention this in the ChangeLog file (to make sure we don't copy-paste this code for some other class, and automatically assume that toNewClass() will be ref-counted too, when it might not be).
Comment 3 Kinuko Yasuda 2010-09-22 17:59:12 PDT
Committed r68105: <http://trac.webkit.org/changeset/68105>