| 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/files/file_path.h" | 10 #include "base/files/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_network_session.h" | 21 #include "net/http/http_network_session.h" |
| 22 #include "net/http/http_server_properties_impl.h" | 22 #include "net/http/http_server_properties_impl.h" |
| 23 #include "net/proxy/proxy_config_service.h" | 23 #include "net/proxy/proxy_config_service.h" |
| 24 #include "net/proxy/proxy_config_service_fixed.h" | 24 #include "net/proxy/proxy_config_service_fixed.h" |
| 25 #include "net/proxy/proxy_service.h" | 25 #include "net/proxy/proxy_service.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_context.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" |
| 36 #include "webkit/user_agent/user_agent.h" | 36 #include "webkit/user_agent/user_agent.h" |
| 37 | 37 |
| 38 class TestShellHttpUserAgentSettings : public net::HttpUserAgentSettings { | 38 class TestShellHttpUserAgentSettings : public net::HttpUserAgentSettings { |
| 39 public: | 39 public: |
| 40 TestShellHttpUserAgentSettings() {} | 40 TestShellHttpUserAgentSettings() {} |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 network_session_params.host_resolver = host_resolver(); | 113 network_session_params.host_resolver = host_resolver(); |
| 114 | 114 |
| 115 net::HttpCache* cache = new net::HttpCache( | 115 net::HttpCache* cache = new net::HttpCache( |
| 116 network_session_params, backend); | 116 network_session_params, backend); |
| 117 cache->set_mode(cache_mode); | 117 cache->set_mode(cache_mode); |
| 118 storage_.set_http_transaction_factory(cache); | 118 storage_.set_http_transaction_factory(cache); |
| 119 | 119 |
| 120 storage_.set_ftp_transaction_factory( | 120 storage_.set_ftp_transaction_factory( |
| 121 new net::FtpNetworkLayer(host_resolver())); | 121 new net::FtpNetworkLayer(host_resolver())); |
| 122 | 122 |
| 123 blob_storage_controller_.reset(new webkit_blob::BlobStorageController()); | 123 blob_storage_context_.reset(new webkit_blob::BlobStorageContext()); |
| 124 file_system_context_ = static_cast<SimpleFileSystem*>( | 124 file_system_context_ = static_cast<SimpleFileSystem*>( |
| 125 WebKit::Platform::current()->fileSystem())->file_system_context(); | 125 WebKit::Platform::current()->fileSystem())->file_system_context(); |
| 126 | 126 |
| 127 net::URLRequestJobFactoryImpl* job_factory = | 127 net::URLRequestJobFactoryImpl* job_factory = |
| 128 new net::URLRequestJobFactoryImpl(); | 128 new net::URLRequestJobFactoryImpl(); |
| 129 job_factory->SetProtocolHandler( | 129 job_factory->SetProtocolHandler( |
| 130 "blob", | 130 "blob", |
| 131 new webkit_blob::BlobProtocolHandler( | 131 new webkit_blob::BlobProtocolHandler( |
| 132 blob_storage_controller_.get(), | 132 blob_storage_context_.get(), |
| 133 file_system_context_, | 133 file_system_context_, |
| 134 SimpleResourceLoaderBridge::GetIoThread())); | 134 SimpleResourceLoaderBridge::GetIoThread())); |
| 135 job_factory->SetProtocolHandler( | 135 job_factory->SetProtocolHandler( |
| 136 "filesystem", | 136 "filesystem", |
| 137 fileapi::CreateFileSystemProtocolHandler(file_system_context_.get())); | 137 fileapi::CreateFileSystemProtocolHandler(file_system_context_.get())); |
| 138 storage_.set_job_factory(job_factory); | 138 storage_.set_job_factory(job_factory); |
| 139 } | 139 } |
| 140 | 140 |
| 141 TestShellRequestContext::~TestShellRequestContext() { | 141 TestShellRequestContext::~TestShellRequestContext() { |
| 142 } | 142 } |
| OLD | NEW |