| OLD | NEW | 
|---|
| 1 // Copyright (c) 2010 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_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 | 11 | 
| 12 class FilePath; | 12 class FilePath; | 
| 13 | 13 | 
| 14 namespace webkit_blob { | 14 namespace webkit_blob { | 
| 15 class BlobStorageController; | 15 class BlobStorageController; | 
| 16 } | 16 } | 
| 17 | 17 | 
| 18 // A basic URLRequestContext that only provides an in-memory cookie store. | 18 // A basic net::URLRequestContext that only provides an in-memory cookie store. | 
| 19 class TestShellRequestContext : public URLRequestContext { | 19 class TestShellRequestContext : public net::URLRequestContext { | 
| 20  public: | 20  public: | 
| 21   // Use an in-memory cache | 21   // Use an in-memory cache | 
| 22   TestShellRequestContext(); | 22   TestShellRequestContext(); | 
| 23 | 23 | 
| 24   // Use an on-disk cache at the specified location.  Optionally, use the cache | 24   // Use an on-disk cache at the specified location.  Optionally, use the cache | 
| 25   // in playback or record mode. | 25   // in playback or record mode. | 
| 26   TestShellRequestContext(const FilePath& cache_path, | 26   TestShellRequestContext(const FilePath& cache_path, | 
| 27                           net::HttpCache::Mode cache_mode, | 27                           net::HttpCache::Mode cache_mode, | 
| 28                           bool no_proxy); | 28                           bool no_proxy); | 
| 29 | 29 | 
| 30   virtual const std::string& GetUserAgent(const GURL& url) const; | 30   virtual const std::string& GetUserAgent(const GURL& url) const; | 
| 31 | 31 | 
| 32   webkit_blob::BlobStorageController* blob_storage_controller() const { | 32   webkit_blob::BlobStorageController* blob_storage_controller() const { | 
| 33     return blob_storage_controller_.get(); | 33     return blob_storage_controller_.get(); | 
| 34   } | 34   } | 
| 35 | 35 | 
| 36  private: | 36  private: | 
| 37   ~TestShellRequestContext(); | 37   ~TestShellRequestContext(); | 
| 38 | 38 | 
| 39   void Init(const FilePath& cache_path, net::HttpCache::Mode cache_mode, | 39   void Init(const FilePath& cache_path, net::HttpCache::Mode cache_mode, | 
| 40             bool no_proxy); | 40             bool no_proxy); | 
| 41 | 41 | 
| 42   scoped_ptr<webkit_blob::BlobStorageController> blob_storage_controller_; | 42   scoped_ptr<webkit_blob::BlobStorageController> blob_storage_controller_; | 
| 43 }; | 43 }; | 
| 44 | 44 | 
| 45 #endif  // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_REQUEST_CONTEXT_H_ | 45 #endif  // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_REQUEST_CONTEXT_H_ | 
| OLD | NEW | 
|---|