Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: webkit/tools/test_shell/test_shell_request_context.cc

Issue 7036004: Remove more URLRequest::RegisterProtocolFactory calls. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/tools/test_shell/simple_resource_loader_bridge.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 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 #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 "net/base/cert_verifier.h" 11 #include "net/base/cert_verifier.h"
12 #include "net/base/cookie_monster.h" 12 #include "net/base/cookie_monster.h"
13 #include "net/base/host_resolver.h" 13 #include "net/base/host_resolver.h"
14 #include "net/base/ssl_config_service_defaults.h" 14 #include "net/base/ssl_config_service_defaults.h"
15 #include "net/ftp/ftp_network_layer.h" 15 #include "net/ftp/ftp_network_layer.h"
16 #include "net/http/http_auth_handler_factory.h" 16 #include "net/http/http_auth_handler_factory.h"
17 #include "net/proxy/proxy_config_service.h" 17 #include "net/proxy/proxy_config_service.h"
18 #include "net/proxy/proxy_config_service_fixed.h" 18 #include "net/proxy/proxy_config_service_fixed.h"
19 #include "net/proxy/proxy_service.h" 19 #include "net/proxy/proxy_service.h"
20 #include "net/url_request/url_request_job_factory.h"
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h" 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h"
22 #include "webkit/blob/blob_storage_controller.h" 23 #include "webkit/blob/blob_storage_controller.h"
24 #include "webkit/blob/blob_url_request_job_factory.h"
23 #include "webkit/fileapi/file_system_context.h" 25 #include "webkit/fileapi/file_system_context.h"
26 #include "webkit/fileapi/file_system_url_request_job_factory.h"
24 #include "webkit/glue/webkit_glue.h" 27 #include "webkit/glue/webkit_glue.h"
25 #include "webkit/tools/test_shell/simple_file_system.h" 28 #include "webkit/tools/test_shell/simple_file_system.h"
26 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" 29 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h"
27 30
28 TestShellRequestContext::TestShellRequestContext() 31 TestShellRequestContext::TestShellRequestContext()
29 : ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) { 32 : ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) {
30 Init(FilePath(), net::HttpCache::NORMAL, false); 33 Init(FilePath(), net::HttpCache::NORMAL, false);
31 } 34 }
32 35
33 TestShellRequestContext::TestShellRequestContext( 36 TestShellRequestContext::TestShellRequestContext(
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 91
89 cache->set_mode(cache_mode); 92 cache->set_mode(cache_mode);
90 storage_.set_http_transaction_factory(cache); 93 storage_.set_http_transaction_factory(cache);
91 94
92 storage_.set_ftp_transaction_factory( 95 storage_.set_ftp_transaction_factory(
93 new net::FtpNetworkLayer(host_resolver())); 96 new net::FtpNetworkLayer(host_resolver()));
94 97
95 blob_storage_controller_.reset(new webkit_blob::BlobStorageController()); 98 blob_storage_controller_.reset(new webkit_blob::BlobStorageController());
96 file_system_context_ = static_cast<SimpleFileSystem*>( 99 file_system_context_ = static_cast<SimpleFileSystem*>(
97 WebKit::webKitClient()->fileSystem())->file_system_context(); 100 WebKit::webKitClient()->fileSystem())->file_system_context();
101
102 net::URLRequestJobFactory* job_factory = new net::URLRequestJobFactory;
tony 2011/05/17 17:01:00 Do we need to do something with this job_factory?
willchan no longer on Chromium 2011/05/17 18:09:50 Oops, yeah. I've set it now.
103 job_factory->SetProtocolHandler(
104 "blob",
105 new webkit_blob::BlobProtocolHandler(
106 blob_storage_controller_.get(),
107 SimpleResourceLoaderBridge::GetIoThread()));
108 job_factory->SetProtocolHandler(
109 "filesystem",
110 fileapi::CreateFileSystemProtocolHandler(
111 file_system_context_.get(),
112 SimpleResourceLoaderBridge::GetIoThread()));
98 } 113 }
99 114
100 TestShellRequestContext::~TestShellRequestContext() { 115 TestShellRequestContext::~TestShellRequestContext() {
101 } 116 }
102 117
103 const std::string& TestShellRequestContext::GetUserAgent( 118 const std::string& TestShellRequestContext::GetUserAgent(
104 const GURL& url) const { 119 const GURL& url) const {
105 return webkit_glue::GetUserAgent(url); 120 return webkit_glue::GetUserAgent(url);
106 } 121 }
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/simple_resource_loader_bridge.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698