OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_TEST_SHELL_REQUEST_CONTEXT_H_ | 5 #ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_REQUEST_CONTEXT_H_ |
6 #define WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_REQUEST_CONTEXT_H_ | 6 #define WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_REQUEST_CONTEXT_H_ |
7 | 7 |
8 #include "base/threading/thread.h" | 8 #include "base/threading/thread.h" |
9 #include "net/http/http_cache.h" | 9 #include "net/http/http_cache.h" |
10 #include "net/url_request/url_request_context.h" | 10 #include "net/url_request/url_request_context.h" |
11 #include "net/url_request/url_request_context_storage.h" | 11 #include "net/url_request/url_request_context_storage.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class FilePath; | 14 class FilePath; |
15 } | 15 } |
16 | 16 |
17 namespace fileapi { | 17 namespace fileapi { |
18 class FileSystemContext; | 18 class FileSystemContext; |
19 } | 19 } |
20 | 20 |
21 namespace webkit_blob { | 21 namespace webkit_blob { |
22 class BlobStorageController; | 22 class BlobStorageContext; |
23 } | 23 } |
24 | 24 |
25 // A basic net::URLRequestContext that only provides an in-memory cookie store. | 25 // A basic net::URLRequestContext that only provides an in-memory cookie store. |
26 class TestShellRequestContext : public net::URLRequestContext { | 26 class TestShellRequestContext : public net::URLRequestContext { |
27 public: | 27 public: |
28 // Use an in-memory cache | 28 // Use an in-memory cache |
29 TestShellRequestContext(); | 29 TestShellRequestContext(); |
30 | 30 |
31 // Use an on-disk cache at the specified location. Optionally, use the cache | 31 // Use an on-disk cache at the specified location. Optionally, use the cache |
32 // in playback or record mode. | 32 // in playback or record mode. |
33 TestShellRequestContext(const base::FilePath& cache_path, | 33 TestShellRequestContext(const base::FilePath& cache_path, |
34 net::HttpCache::Mode cache_mode, | 34 net::HttpCache::Mode cache_mode, |
35 bool no_proxy); | 35 bool no_proxy); |
36 | 36 |
37 virtual ~TestShellRequestContext(); | 37 virtual ~TestShellRequestContext(); |
38 | 38 |
39 webkit_blob::BlobStorageController* blob_storage_controller() const { | 39 webkit_blob::BlobStorageContext* blob_storage_context() const { |
40 return blob_storage_controller_.get(); | 40 return blob_storage_context_.get(); |
41 } | 41 } |
42 | 42 |
43 fileapi::FileSystemContext* file_system_context() const { | 43 fileapi::FileSystemContext* file_system_context() const { |
44 return file_system_context_.get(); | 44 return file_system_context_.get(); |
45 } | 45 } |
46 | 46 |
47 private: | 47 private: |
48 void Init(const base::FilePath& cache_path, net::HttpCache::Mode cache_mode, | 48 void Init(const base::FilePath& cache_path, net::HttpCache::Mode cache_mode, |
49 bool no_proxy); | 49 bool no_proxy); |
50 | 50 |
51 net::URLRequestContextStorage storage_; | 51 net::URLRequestContextStorage storage_; |
52 scoped_ptr<webkit_blob::BlobStorageController> blob_storage_controller_; | 52 scoped_ptr<webkit_blob::BlobStorageContext> blob_storage_context_; |
53 scoped_refptr<fileapi::FileSystemContext> file_system_context_; | 53 scoped_refptr<fileapi::FileSystemContext> file_system_context_; |
54 }; | 54 }; |
55 | 55 |
56 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_REQUEST_CONTEXT_H_ | 56 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_REQUEST_CONTEXT_H_ |
OLD | NEW |