Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Issue 2878062: Asynchronously open the temp file used for Pepper StreamToFile, and delete th... (Closed)

Created:
10 years, 4 months ago by darin (slow to review)
Modified:
9 years, 7 months ago
Reviewers:
brettw
CC:
chromium-reviews, ben+cc_chromium.org, darin-cc_chromium.org, brettw-cc_chromium.org
Visibility:
Public.

Description

Asynchronously open the temp file used for Pepper StreamToFile, and delete the temp file once we are done with it. We observe ResourceHandle::OnRequestClosed as a signal of when we should delete the temp file. This corresponds to the WebURLLoader being closed (or canceled). This patch also includes some helpers: base/scoped_callback_factory.h This class makes it easy to allocate Callbacks that hold a weak reference back to the owning class. It works just like ScopedRunnableMethodFactory but for Callbacks instead of RunnableMethods. base/platform_file.h Added a PassPlatformFile class that is useful for cases where a callback may decide not to take ownership of a PlatformFile (as can happen when using ScopedCallbackFactory). chrome/file_system_proxy.{h,cc} This class provides static methods for executing file system commands on the FILE thread. It routes callbacks back to the originating thread to deliver results (file handles, etc.). Note: this file declares a few functions that are not yet used. I anticipate that we'll make use of these and add more functions here to support the Pepper and OWP FileSystem APIs. chrome/chrome_thread_relay.{h,cc} This class is a helper class for proxying calls over to a background ChromeThread and then returning results to the originating ChromeThread. R=brettw BUG=49789 TEST=(more to be added in third_party/ppapi/tests) Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=54402

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Total comments: 1

Patch Set 6 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+539 lines, -17 lines) Patch
M base/base.gypi View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M base/platform_file.h View 3 4 5 1 chunk +38 lines, -0 lines 0 comments Download
A base/scoped_callback_factory.h View 1 2 3 4 5 1 chunk +133 lines, -0 lines 0 comments Download
A chrome/browser/chrome_thread_relay.h View 3 1 chunk +55 lines, -0 lines 0 comments Download
A chrome/browser/chrome_thread_relay.cc View 3 1 chunk +26 lines, -0 lines 0 comments Download
A chrome/browser/file_system_proxy.h View 3 1 chunk +49 lines, -0 lines 0 comments Download
A chrome/browser/file_system_proxy.cc View 3 1 chunk +180 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/redirect_to_file_resource_handler.h View 1 2 3 4 5 3 chunks +10 lines, -2 lines 0 comments Download
M chrome/browser/renderer_host/redirect_to_file_resource_handler.cc View 1 2 3 4 5 8 chunks +43 lines, -15 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 2 chunks +4 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
darin (slow to review)
10 years, 4 months ago (2010-07-28 23:57:41 UTC) #1
darin (slow to review)
Note: I plan on making use of FileSystemProxy to reduce some complexity in ResourceMessageFilter as ...
10 years, 4 months ago (2010-07-29 05:51:45 UTC) #2
darin (slow to review)
I think I'm going to redo this without the browser/base/ directory since it seems like ...
10 years, 4 months ago (2010-07-29 07:37:10 UTC) #3
brettw
LGTM http://codereview.chromium.org/2878062/diff/13004/29003 File base/platform_file.h (right): http://codereview.chromium.org/2878062/diff/13004/29003#newcode63 base/platform_file.h:63: // void MaybeProcessFile(PassPlatformFile platform_file); This took me a ...
10 years, 4 months ago (2010-07-30 16:43:01 UTC) #4
darin (slow to review)
10 years, 4 months ago (2010-07-30 17:07:06 UTC) #5
On Fri, Jul 30, 2010 at 9:43 AM, <[email protected]> wrote:

> LGTM
>
>
> http://codereview.chromium.org/2878062/diff/13004/29003
> File base/platform_file.h (right):
>
> http://codereview.chromium.org/2878062/diff/13004/29003#newcode63
> base/platform_file.h:63: //  void MaybeProcessFile(PassPlatformFile
> platform_file);
> This took me a while of staring at it to figure out. Can you add in your
> example here in MaybeProcessFile that it calls ReleaseValue() to get the
> handle out and use it. Can you also add a comment above ReleaseValue
> about what it does and how it marks the handle as "released"?



Good idea.  It took me a while to settle on this approach.  I hope it won't
be too complicated for users.

Thanks for the review!

-Darin


>
>
> http://codereview.chromium.org/2878062/show
>

Powered by Google App Engine
This is Rietveld 408576698