Bug 34412 - [BREWMP] Port SharedBuffer::createWithContentsOfFile
: [BREWMP] Port SharedBuffer::createWithContentsOfFile
Status: RESOLVED FIXED
Product: WebKit
Classification: Unclassified
Component: Platform
: 528+ (Nightly build)
: Other Other
: P2 Normal
Assigned To: Nobody
:
Depends on:
Blocks: 33564
  Show dependency treegraph
 
Reported: 2010-02-01 02:02 PST by Kwang Yul Seo
Modified: 2010-08-29 19:07 PDT (History)
4 users (show)

See Also:


Attachments
Port SharedBuffer (4.05 KB, patch)
2010-02-01 02:05 PST, Kwang Yul Seo
no flags Details | Formatted Diff | Diff
Port SharedBuffer (4.01 KB, application/octet-stream)
2010-02-03 03:09 PST, Kwang Yul Seo
no flags Details
Port SharedBuffer (4.01 KB, patch)
2010-02-03 03:10 PST, Kwang Yul Seo
no flags Details | Formatted Diff | Diff
Port SharedBuffer (4.02 KB, patch)
2010-02-03 03:16 PST, Kwang Yul Seo
no flags Details | Formatted Diff | Diff
Revised patch (3.73 KB, patch)
2010-05-21 06:12 PDT, Kwang Yul Seo
no flags Details | Formatted Diff | Diff
Revised patch (3.71 KB, patch)
2010-06-08 22:38 PDT, Kwang Yul Seo
no flags Details | Formatted Diff | Diff
Revised patch (3.72 KB, patch)
2010-06-14 20:58 PDT, Kwang Yul Seo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kwang Yul Seo 2010-02-01 02:02:25 PST
Implement SharedBuffer::createWithContentsOfFile with IFileMgr.
Comment 1 Kwang Yul Seo 2010-02-01 02:05:27 PST
Created attachment 47820 [details]
Port SharedBuffer
Comment 2 Eric Seidel 2010-02-01 16:00:17 PST
Comment on attachment 47820 [details]
Port SharedBuffer

Seems we're going to need a smart pointer for Brew, like how GOwnPtr or RetainPtr works.

Manual calls to: IFILEMGR_Release just end in sadness.
Comment 3 Kwang Yul Seo 2010-02-01 16:58:10 PST
It sounds like a good idea. I will create a smart pointer for Brew.
Comment 4 Kwang Yul Seo 2010-02-03 03:09:04 PST
Created attachment 48008 [details]
Port SharedBuffer

Make sure the local variable fileMgr and file are released in every path. Use OwnPtrBrew submitted in https://bugs.webkit.org/show_bug.cgi?id=34518
Comment 5 Kwang Yul Seo 2010-02-03 03:10:28 PST
Created attachment 48009 [details]
Port SharedBuffer

Ooops. Forgot to check patch checkbox.
Comment 6 Kwang Yul Seo 2010-02-03 03:16:00 PST
Created attachment 48011 [details]
Port SharedBuffer

Fix a small mistake.
Comment 7 Eric Seidel 2010-02-03 13:01:42 PST
Comment on attachment 48011 [details]
Port SharedBuffer

Isn't there a rawPtr() accessor (or similar) on OwnPtrBrew which would allow you to avoid ever having the IFileMgr* local variable?

     IFileMgr* p;
 58     ISHELL_CreateInstance(shell, AEECLSID_FILEMGR, reinterpret_cast<void**>(&p));
 59 
 60     OwnPtrBrew<IFileMgr> fileMgr(p);
Comment 8 Kwang Yul Seo 2010-02-08 08:11:05 PST
(In reply to comment #7)
> (From update of attachment 48011 [details])
> Isn't there a rawPtr() accessor (or similar) on OwnPtrBrew which would allow
> you to avoid ever having the IFileMgr* local variable?
> 
>      IFileMgr* p;
>  58     ISHELL_CreateInstance(shell, AEECLSID_FILEMGR,
> reinterpret_cast<void**>(&p));
>  59 
>  60     OwnPtrBrew<IFileMgr> fileMgr(p);

I filed a bug for this. Please check https://bugs.webkit.org/show_bug.cgi?id=34705  I will update the patch once 34705 is landed.
Comment 9 Kwang Yul Seo 2010-02-08 08:12:09 PST
Comment on attachment 48011 [details]
Port SharedBuffer
Comment 10 Kwang Yul Seo 2010-05-21 06:12:38 PDT
Created attachment 56702 [details]
Revised patch

Use ShellBrew's createInstance to create an OwnPtr-ed IFileMgr.
Comment 11 Kwang Yul Seo 2010-06-07 06:45:31 PDT
Comment on attachment 56702 [details]
Revised patch

Cancel the patch as I found a bug. I will resubmit the patch after fixing the bug.
Comment 12 Kwang Yul Seo 2010-06-08 22:38:15 PDT
Created attachment 58212 [details]
Revised patch

Patch
Comment 13 Kwang Yul Seo 2010-06-14 20:58:16 PDT
Created attachment 58750 [details]
Revised patch

Use fileSystemRepresentation instead of filenameFromString due to the change in bug 40201
Comment 14 Kwang Yul Seo 2010-08-27 08:47:33 PDT
Ping.
Comment 15 Kent Tamura 2010-08-29 18:24:53 PDT
Comment on attachment 58750 [details]
Revised patch

I'm not familiar with SharedBuffer, but the change looks to have no problem. I'm setting r+.
Comment 16 WebKit Commit Bot 2010-08-29 19:07:46 PDT
Comment on attachment 58750 [details]
Revised patch

Clearing flags on attachment: 58750

Committed r66348: <http://trac.webkit.org/changeset/66348>
Comment 17 WebKit Commit Bot 2010-08-29 19:07:52 PDT
All reviewed patches have been landed.  Closing bug.