| 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" | |
| 20 #include "net/http/http_auth_handler_factory.h" | 19 #include "net/http/http_auth_handler_factory.h" |
| 21 #include "net/http/http_network_session.h" | 20 #include "net/http/http_network_session.h" |
| 22 #include "net/http/http_server_properties_impl.h" | 21 #include "net/http/http_server_properties_impl.h" |
| 23 #include "net/proxy/proxy_config_service.h" | 22 #include "net/proxy/proxy_config_service.h" |
| 24 #include "net/proxy/proxy_config_service_fixed.h" | 23 #include "net/proxy/proxy_config_service_fixed.h" |
| 25 #include "net/proxy/proxy_service.h" | 24 #include "net/proxy/proxy_service.h" |
| 25 #include "net/url_request/file_protocol_handler.h" |
| 26 #include "net/url_request/http_user_agent_settings.h" | 26 #include "net/url_request/http_user_agent_settings.h" |
| 27 #include "net/url_request/url_request_job_factory_impl.h" | 27 #include "net/url_request/url_request_job_factory_impl.h" |
| 28 #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" | 28 #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" |
| 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
| 30 #include "webkit/blob/blob_storage_controller.h" | 30 #include "webkit/blob/blob_storage_controller.h" |
| 31 #include "webkit/blob/blob_url_request_job_factory.h" | 31 #include "webkit/blob/blob_url_request_job_factory.h" |
| 32 #include "webkit/fileapi/file_system_context.h" | 32 #include "webkit/fileapi/file_system_context.h" |
| 33 #include "webkit/fileapi/file_system_url_request_job_factory.h" | 33 #include "webkit/fileapi/file_system_url_request_job_factory.h" |
| 34 #include "webkit/tools/test_shell/simple_file_system.h" | 34 #include "webkit/tools/test_shell/simple_file_system.h" |
| 35 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" | 35 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 network_session_params.http_auth_handler_factory = | 123 network_session_params.http_auth_handler_factory = |
| 124 http_auth_handler_factory(); | 124 http_auth_handler_factory(); |
| 125 network_session_params.http_server_properties = http_server_properties(); | 125 network_session_params.http_server_properties = http_server_properties(); |
| 126 network_session_params.host_resolver = host_resolver(); | 126 network_session_params.host_resolver = host_resolver(); |
| 127 | 127 |
| 128 net::HttpCache* cache = new net::HttpCache( | 128 net::HttpCache* cache = new net::HttpCache( |
| 129 network_session_params, backend); | 129 network_session_params, backend); |
| 130 cache->set_mode(cache_mode); | 130 cache->set_mode(cache_mode); |
| 131 storage_.set_http_transaction_factory(cache); | 131 storage_.set_http_transaction_factory(cache); |
| 132 | 132 |
| 133 storage_.set_ftp_transaction_factory( | |
| 134 new net::FtpNetworkLayer(host_resolver())); | |
| 135 | |
| 136 blob_storage_controller_.reset(new webkit_blob::BlobStorageController()); | 133 blob_storage_controller_.reset(new webkit_blob::BlobStorageController()); |
| 137 file_system_context_ = static_cast<SimpleFileSystem*>( | 134 file_system_context_ = static_cast<SimpleFileSystem*>( |
| 138 WebKit::Platform::current()->fileSystem())->file_system_context(); | 135 WebKit::Platform::current()->fileSystem())->file_system_context(); |
| 139 | 136 |
| 140 net::URLRequestJobFactoryImpl* job_factory = | 137 net::URLRequestJobFactoryImpl* job_factory = |
| 141 new net::URLRequestJobFactoryImpl(); | 138 new net::URLRequestJobFactoryImpl(); |
| 142 job_factory->SetProtocolHandler( | 139 job_factory->SetProtocolHandler( |
| 143 "blob", | 140 "blob", |
| 144 new webkit_blob::BlobProtocolHandler( | 141 new webkit_blob::BlobProtocolHandler( |
| 145 blob_storage_controller_.get(), | 142 blob_storage_controller_.get(), |
| 146 file_system_context_, | 143 file_system_context_, |
| 147 SimpleResourceLoaderBridge::GetIoThread())); | 144 SimpleResourceLoaderBridge::GetIoThread())); |
| 148 job_factory->SetProtocolHandler( | 145 job_factory->SetProtocolHandler( |
| 149 "filesystem", | 146 "filesystem", |
| 150 fileapi::CreateFileSystemProtocolHandler(file_system_context_.get())); | 147 fileapi::CreateFileSystemProtocolHandler(file_system_context_.get())); |
| 148 job_factory->SetProtocolHandler("file", new net::FileProtocolHandler); |
| 151 storage_.set_job_factory(job_factory); | 149 storage_.set_job_factory(job_factory); |
| 152 } | 150 } |
| 153 | 151 |
| 154 TestShellRequestContext::~TestShellRequestContext() { | 152 TestShellRequestContext::~TestShellRequestContext() { |
| 155 } | 153 } |
| OLD | NEW |