| 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 #include "webkit/tools/test_shell/test_shell_request_context.h" | 5 #include "webkit/tools/test_shell/test_shell_request_context.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| 11 #include "base/thread_task_runner_handle.h" | 11 #include "base/thread_task_runner_handle.h" |
| 12 #include "base/threading/worker_pool.h" | 12 #include "base/threading/worker_pool.h" |
| 13 #include "net/base/cert_verifier.h" | 13 #include "net/base/cert_verifier.h" |
| 14 #include "net/base/default_server_bound_cert_store.h" | 14 #include "net/base/default_server_bound_cert_store.h" |
| 15 #include "net/base/host_resolver.h" | 15 #include "net/base/host_resolver.h" |
| 16 #include "net/base/server_bound_cert_service.h" | 16 #include "net/base/server_bound_cert_service.h" |
| 17 #include "net/base/ssl_config_service_defaults.h" | 17 #include "net/base/ssl_config_service_defaults.h" |
| 18 #include "net/cookies/cookie_monster.h" | 18 #include "net/cookies/cookie_monster.h" |
| 19 #include "net/ftp/ftp_network_layer.h" | 19 #include "net/ftp/ftp_network_layer.h" |
| 20 #include "net/http/http_auth_handler_factory.h" | 20 #include "net/http/http_auth_handler_factory.h" |
| 21 #include "net/http/http_server_properties_impl.h" | 21 #include "net/http/http_server_properties_impl.h" |
| 22 #include "net/proxy/proxy_config_service.h" | 22 #include "net/proxy/proxy_config_service.h" |
| 23 #include "net/proxy/proxy_config_service_fixed.h" | 23 #include "net/proxy/proxy_config_service_fixed.h" |
| 24 #include "net/proxy/proxy_service.h" | 24 #include "net/proxy/proxy_service.h" |
| 25 #include "net/url_request/url_request_job_factory.h" | 25 #include "net/url_request/url_request_job_factory_impl.h" |
| 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
| 27 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebKitPlatfo
rmSupport.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebKitPlatfo
rmSupport.h" |
| 28 #include "webkit/blob/blob_storage_controller.h" | 28 #include "webkit/blob/blob_storage_controller.h" |
| 29 #include "webkit/blob/blob_url_request_job_factory.h" | 29 #include "webkit/blob/blob_url_request_job_factory.h" |
| 30 #include "webkit/fileapi/file_system_context.h" | 30 #include "webkit/fileapi/file_system_context.h" |
| 31 #include "webkit/fileapi/file_system_url_request_job_factory.h" | 31 #include "webkit/fileapi/file_system_url_request_job_factory.h" |
| 32 #include "webkit/glue/webkit_glue.h" | 32 #include "webkit/glue/webkit_glue.h" |
| 33 #include "webkit/tools/test_shell/simple_file_system.h" | 33 #include "webkit/tools/test_shell/simple_file_system.h" |
| 34 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" | 34 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" |
| 35 | 35 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 cache->set_mode(cache_mode); | 113 cache->set_mode(cache_mode); |
| 114 storage_.set_http_transaction_factory(cache); | 114 storage_.set_http_transaction_factory(cache); |
| 115 | 115 |
| 116 storage_.set_ftp_transaction_factory( | 116 storage_.set_ftp_transaction_factory( |
| 117 new net::FtpNetworkLayer(host_resolver())); | 117 new net::FtpNetworkLayer(host_resolver())); |
| 118 | 118 |
| 119 blob_storage_controller_.reset(new webkit_blob::BlobStorageController()); | 119 blob_storage_controller_.reset(new webkit_blob::BlobStorageController()); |
| 120 file_system_context_ = static_cast<SimpleFileSystem*>( | 120 file_system_context_ = static_cast<SimpleFileSystem*>( |
| 121 WebKit::webKitPlatformSupport()->fileSystem())->file_system_context(); | 121 WebKit::webKitPlatformSupport()->fileSystem())->file_system_context(); |
| 122 | 122 |
| 123 net::URLRequestJobFactory* job_factory = new net::URLRequestJobFactory; | 123 net::URLRequestJobFactory* job_factory = new net::URLRequestJobFactoryImpl(); |
| 124 job_factory->SetProtocolHandler( | 124 job_factory->SetProtocolHandler( |
| 125 "blob", | 125 "blob", |
| 126 new webkit_blob::BlobProtocolHandler( | 126 new webkit_blob::BlobProtocolHandler( |
| 127 blob_storage_controller_.get(), | 127 blob_storage_controller_.get(), |
| 128 SimpleResourceLoaderBridge::GetIoThread())); | 128 SimpleResourceLoaderBridge::GetIoThread())); |
| 129 job_factory->SetProtocolHandler( | 129 job_factory->SetProtocolHandler( |
| 130 "filesystem", | 130 "filesystem", |
| 131 fileapi::CreateFileSystemProtocolHandler(file_system_context_.get())); | 131 fileapi::CreateFileSystemProtocolHandler(file_system_context_.get())); |
| 132 storage_.set_job_factory(job_factory); | 132 storage_.set_job_factory(job_factory); |
| 133 } | 133 } |
| 134 | 134 |
| 135 TestShellRequestContext::~TestShellRequestContext() { | 135 TestShellRequestContext::~TestShellRequestContext() { |
| 136 } | 136 } |
| 137 | 137 |
| 138 const std::string& TestShellRequestContext::GetUserAgent( | 138 const std::string& TestShellRequestContext::GetUserAgent( |
| 139 const GURL& url) const { | 139 const GURL& url) const { |
| 140 return webkit_glue::GetUserAgent(url); | 140 return webkit_glue::GetUserAgent(url); |
| 141 } | 141 } |
| OLD | NEW |