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 "content/shell/shell_url_request_context_getter.h" | 5 #include "content/shell/shell_url_request_context_getter.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_split.h" | 8 #include "base/string_split.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "net/base/cert_verifier.h" | 10 #include "net/base/cert_verifier.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 } | 45 } |
46 | 46 |
47 net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { | 47 net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { |
48 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 48 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
49 | 49 |
50 if (!url_request_context_) { | 50 if (!url_request_context_) { |
51 url_request_context_ = new net::URLRequestContext(); | 51 url_request_context_ = new net::URLRequestContext(); |
52 storage_.reset(new net::URLRequestContextStorage(url_request_context_)); | 52 storage_.reset(new net::URLRequestContextStorage(url_request_context_)); |
53 | 53 |
54 storage_->set_cookie_store(new net::CookieMonster(NULL, NULL)); | 54 storage_->set_cookie_store(new net::CookieMonster(NULL, NULL)); |
55 storage_->set_origin_bound_cert_service(new net::OriginBoundCertService( | 55 storage_->set_server_bound_cert_service(new net::ServerBoundCertService( |
56 new net::DefaultOriginBoundCertStore(NULL))); | 56 new net::DefaultServerBoundCertStore(NULL))); |
57 url_request_context_->set_accept_language("en-us,en"); | 57 url_request_context_->set_accept_language("en-us,en"); |
58 url_request_context_->set_accept_charset("iso-8859-1,*,utf-8"); | 58 url_request_context_->set_accept_charset("iso-8859-1,*,utf-8"); |
59 | 59 |
60 storage_->set_host_resolver( | 60 storage_->set_host_resolver( |
61 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, | 61 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, |
62 net::HostResolver::kDefaultRetryAttempts, | 62 net::HostResolver::kDefaultRetryAttempts, |
63 NULL)); | 63 NULL)); |
64 storage_->set_cert_verifier(new net::CertVerifier); | 64 storage_->set_cert_verifier(new net::CertVerifier); |
65 // TODO(jam): use v8 if possible, look at chrome code. | 65 // TODO(jam): use v8 if possible, look at chrome code. |
66 storage_->set_proxy_service( | 66 storage_->set_proxy_service( |
(...skipping 12 matching lines...) Expand all Loading... |
79 new net::HttpCache::DefaultBackend( | 79 new net::HttpCache::DefaultBackend( |
80 net::DISK_CACHE, | 80 net::DISK_CACHE, |
81 cache_path, | 81 cache_path, |
82 0, | 82 0, |
83 BrowserThread::GetMessageLoopProxyForThread( | 83 BrowserThread::GetMessageLoopProxyForThread( |
84 BrowserThread::CACHE)); | 84 BrowserThread::CACHE)); |
85 | 85 |
86 net::HttpCache* main_cache = new net::HttpCache( | 86 net::HttpCache* main_cache = new net::HttpCache( |
87 url_request_context_->host_resolver(), | 87 url_request_context_->host_resolver(), |
88 url_request_context_->cert_verifier(), | 88 url_request_context_->cert_verifier(), |
89 url_request_context_->origin_bound_cert_service(), | 89 url_request_context_->server_bound_cert_service(), |
90 NULL, // tranport_security_state | 90 NULL, // tranport_security_state |
91 url_request_context_->proxy_service(), | 91 url_request_context_->proxy_service(), |
92 "", // ssl_session_cache_shard | 92 "", // ssl_session_cache_shard |
93 url_request_context_->ssl_config_service(), | 93 url_request_context_->ssl_config_service(), |
94 url_request_context_->http_auth_handler_factory(), | 94 url_request_context_->http_auth_handler_factory(), |
95 NULL, // network_delegate | 95 NULL, // network_delegate |
96 url_request_context_->http_server_properties(), | 96 url_request_context_->http_server_properties(), |
97 NULL, | 97 NULL, |
98 main_backend); | 98 main_backend); |
99 storage_->set_http_transaction_factory(main_cache); | 99 storage_->set_http_transaction_factory(main_cache); |
(...skipping 14 matching lines...) Expand all Loading... |
114 scoped_refptr<base::MessageLoopProxy> | 114 scoped_refptr<base::MessageLoopProxy> |
115 ShellURLRequestContextGetter::GetIOMessageLoopProxy() const { | 115 ShellURLRequestContextGetter::GetIOMessageLoopProxy() const { |
116 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 116 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
117 } | 117 } |
118 | 118 |
119 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { | 119 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { |
120 return url_request_context_->host_resolver(); | 120 return url_request_context_->host_resolver(); |
121 } | 121 } |
122 | 122 |
123 } // namespace content | 123 } // namespace content |
OLD | NEW |