OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_WRITER_H_ | 5 #ifndef WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_WRITER_H_ |
6 #define WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_WRITER_H_ | 6 #define WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_WRITER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "webkit/fileapi/webfilewriter_base.h" | 10 #include "webkit/fileapi/webfilewriter_base.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // created and destroyed. | 31 // created and destroyed. |
32 static void InitializeOnIOThread(net::URLRequestContext* request_context) { | 32 static void InitializeOnIOThread(net::URLRequestContext* request_context) { |
33 request_context_ = request_context; | 33 request_context_ = request_context; |
34 } | 34 } |
35 static void CleanupOnIOThread() { | 35 static void CleanupOnIOThread() { |
36 request_context_ = NULL; | 36 request_context_ = NULL; |
37 } | 37 } |
38 | 38 |
39 protected: | 39 protected: |
40 // WebFileWriterBase overrides | 40 // WebFileWriterBase overrides |
41 virtual void DoTruncate(const GURL& path, int64 offset); | 41 virtual void DoTruncate(const GURL& path, int64 offset) OVERRIDE; |
42 virtual void DoWrite(const GURL& path, const GURL& blob_url, | 42 virtual void DoWrite(const GURL& path, const GURL& blob_url, |
43 int64 offset); | 43 int64 offset) OVERRIDE; |
44 virtual void DoCancel(); | 44 virtual void DoCancel() OVERRIDE; |
45 | 45 |
46 private: | 46 private: |
47 class IOThreadProxy; | 47 class IOThreadProxy; |
48 scoped_refptr<IOThreadProxy> io_thread_proxy_; | 48 scoped_refptr<IOThreadProxy> io_thread_proxy_; |
49 static net::URLRequestContext* request_context_; | 49 static net::URLRequestContext* request_context_; |
50 }; | 50 }; |
51 | 51 |
52 #endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_WRITER_H_ | 52 #endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_FILE_WRITER_H_ |
OLD | NEW |