| 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" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::URLRequestJobFactoryImpl(); | 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 file_system_context_, |
| 128 SimpleResourceLoaderBridge::GetIoThread())); | 129 SimpleResourceLoaderBridge::GetIoThread())); |
| 129 job_factory->SetProtocolHandler( | 130 job_factory->SetProtocolHandler( |
| 130 "filesystem", | 131 "filesystem", |
| 131 fileapi::CreateFileSystemProtocolHandler(file_system_context_.get())); | 132 fileapi::CreateFileSystemProtocolHandler(file_system_context_.get())); |
| 132 storage_.set_job_factory(job_factory); | 133 storage_.set_job_factory(job_factory); |
| 133 } | 134 } |
| 134 | 135 |
| 135 TestShellRequestContext::~TestShellRequestContext() { | 136 TestShellRequestContext::~TestShellRequestContext() { |
| 136 } | 137 } |
| 137 | 138 |
| 138 const std::string& TestShellRequestContext::GetUserAgent( | 139 const std::string& TestShellRequestContext::GetUserAgent( |
| 139 const GURL& url) const { | 140 const GURL& url) const { |
| 140 return webkit_glue::GetUserAgent(url); | 141 return webkit_glue::GetUserAgent(url); |
| 141 } | 142 } |
| OLD | NEW |