Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: content/browser/loader/temporary_file_stream.h

Issue 82273002: Fix various issues in RedirectToFileResourceHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename test fixture Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_LOADER_TEMPORARY_FILE_STREAM_H_
6 #define CONTENT_BROWSER_LOADER_TEMPORARY_FILE_STREAM_H_
7
8 #include "base/callback_forward.h"
9 #include "base/files/file.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/platform_file.h"
12 #include "content/common/content_export.h"
13
14 namespace net {
15 class FileStream;
16 }
17
18 namespace webkit_blob {
19 class ShareableFileReference;
20 }
21
22 namespace content {
23
24 typedef base::Callback<void(base::File::Error,
25 scoped_ptr<net::FileStream>,
26 webkit_blob::ShareableFileReference*)>
27 CreateTemporaryFileStreamCallback;
28
29 // Creates a temporary file and asynchronously calls |callback| with a
30 // net::FileStream and webkit_blob::ShareableFileReference. The file is deleted
31 // when the webkit_blob::ShareableFileReference is deleted. Note it is the
32 // consumer's responsibility to ensure the webkit_blob::ShareableFileReference
33 // stays in scope until net::FileStream has finished closing the file. On error,
34 // |callback| is called with an error in the first parameter.
35 //
36 // This function may only be called on the IO thread.
37 //
38 // TODO(davidben): Juggling the net::FileStream and
39 // webkit_blob::ShareableFileReference lifetimes is a nuisance. The two should
40 // be tied together so the consumer need not deal with it.
41 CONTENT_EXPORT void CreateTemporaryFileStream(
42 const CreateTemporaryFileStreamCallback& callback);
43
44 } // namespace content
45
46 #endif // CONTENT_BROWSER_LOADER_TEMPORARY_FILE_STREAM_H_
OLDNEW
« no previous file with comments | « content/browser/loader/sync_resource_handler.cc ('k') | content/browser/loader/temporary_file_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698