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

Side by Side Diff: webkit/support/simple_file_writer.h

Issue 17476002: delete webkit/support/simple_xxx's (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android Created 7 years, 5 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
« no previous file with comments | « webkit/support/simple_file_system.cc ('k') | webkit/support/simple_file_writer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 WEBKIT_SUPPORT_SIMPLE_FILE_WRITER_H_
6 #define WEBKIT_SUPPORT_SIMPLE_FILE_WRITER_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/weak_ptr.h"
10 #include "webkit/renderer/fileapi/webfilewriter_base.h"
11
12 namespace net {
13 class URLRequestContext;
14 } // namespace net
15
16 namespace fileapi {
17 class FileSystemContext;
18 }
19
20 // An implementation of WebFileWriter for use in test_shell and DRT.
21 class SimpleFileWriter : public fileapi::WebFileWriterBase,
22 public base::SupportsWeakPtr<SimpleFileWriter> {
23 public:
24 SimpleFileWriter(
25 const GURL& path,
26 WebKit::WebFileWriterClient* client,
27 fileapi::FileSystemContext* file_system_context);
28 virtual ~SimpleFileWriter();
29
30 // Called by SimpleResourceLoaderBridge when the context is
31 // created and destroyed.
32 static void InitializeOnIOThread(net::URLRequestContext* request_context) {
33 request_context_ = request_context;
34 }
35 static void CleanupOnIOThread() {
36 request_context_ = NULL;
37 }
38
39 protected:
40 // WebFileWriterBase overrides
41 virtual void DoTruncate(const GURL& path, int64 offset) OVERRIDE;
42 virtual void DoWrite(const GURL& path, const GURL& blob_url,
43 int64 offset) OVERRIDE;
44 virtual void DoCancel() OVERRIDE;
45
46 private:
47 class IOThreadProxy;
48 scoped_refptr<fileapi::FileSystemContext> file_system_context_;
49 scoped_refptr<IOThreadProxy> io_thread_proxy_;
50 static net::URLRequestContext* request_context_;
51 };
52
53 #endif // WEBKIT_SUPPORT_SIMPLE_FILE_WRITER_H_
OLDNEW
« no previous file with comments | « webkit/support/simple_file_system.cc ('k') | webkit/support/simple_file_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698