OLD | NEW |
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 //------------------------------------------------------------------------------ | 5 //------------------------------------------------------------------------------ |
6 // Description of the life cycle of a instance of MetricsService. | 6 // Description of the life cycle of a instance of MetricsService. |
7 // | 7 // |
8 // OVERVIEW | 8 // OVERVIEW |
9 // | 9 // |
10 // A MetricsService instance is created at ChromeFrame startup in | 10 // A MetricsService instance is created at ChromeFrame startup in |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 #include "chrome_frame/html_utils.h" | 72 #include "chrome_frame/html_utils.h" |
73 #include "chrome_frame/http_negotiate.h" | 73 #include "chrome_frame/http_negotiate.h" |
74 #include "chrome_frame/utils.h" | 74 #include "chrome_frame/utils.h" |
75 #include "net/base/capturing_net_log.h" | 75 #include "net/base/capturing_net_log.h" |
76 #include "net/base/cert_verifier.h" | 76 #include "net/base/cert_verifier.h" |
77 #include "net/base/host_resolver.h" | 77 #include "net/base/host_resolver.h" |
78 #include "net/base/ssl_config_service_defaults.h" | 78 #include "net/base/ssl_config_service_defaults.h" |
79 #include "net/base/upload_data.h" | 79 #include "net/base/upload_data.h" |
80 #include "net/http/http_auth_handler_factory.h" | 80 #include "net/http/http_auth_handler_factory.h" |
81 #include "net/http/http_cache.h" | 81 #include "net/http/http_cache.h" |
82 #include "net/http/http_network_layer.h" | 82 #include "net/http/http_network_session.h" |
| 83 #include "net/socket/client_socket_factory.h" |
| 84 #include "net/spdy/spdy_session_pool.h" |
83 #include "net/url_request/url_request_context.h" | 85 #include "net/url_request/url_request_context.h" |
84 #include "net/url_request/url_request_status.h" | 86 #include "net/url_request/url_request_status.h" |
85 | 87 |
86 using base::Time; | 88 using base::Time; |
87 using base::TimeDelta; | 89 using base::TimeDelta; |
88 | 90 |
89 static const char kMetricsType[] = "application/vnd.mozilla.metrics.bz2"; | 91 static const char kMetricsType[] = "application/vnd.mozilla.metrics.bz2"; |
90 | 92 |
91 // The first UMA upload occurs after this interval. | 93 // The first UMA upload occurs after this interval. |
92 static const int kInitialUMAUploadTimeoutMilliSeconds = 30000; | 94 static const int kInitialUMAUploadTimeoutMilliSeconds = 30000; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 net::URLSecurityManager::Create(NULL, NULL)); | 173 net::URLSecurityManager::Create(NULL, NULL)); |
172 | 174 |
173 std::string csv_auth_schemes = "basic,digest,ntlm,negotiate"; | 175 std::string csv_auth_schemes = "basic,digest,ntlm,negotiate"; |
174 std::vector<std::string> supported_schemes; | 176 std::vector<std::string> supported_schemes; |
175 base::SplitString(csv_auth_schemes, ',', &supported_schemes); | 177 base::SplitString(csv_auth_schemes, ',', &supported_schemes); |
176 | 178 |
177 http_auth_handler_factory_ = net::HttpAuthHandlerRegistryFactory::Create( | 179 http_auth_handler_factory_ = net::HttpAuthHandlerRegistryFactory::Create( |
178 supported_schemes, url_security_manager_.get(), host_resolver_, | 180 supported_schemes, url_security_manager_.get(), host_resolver_, |
179 std::string(), false, false); | 181 std::string(), false, false); |
180 | 182 |
| 183 scoped_refptr<net::HttpNetworkSession> network_session = |
| 184 new net::HttpNetworkSession( |
| 185 host_resolver_, |
| 186 cert_verifier_, |
| 187 NULL /* dnsrr_resolver */, |
| 188 NULL /* dns_cert_checker*/, |
| 189 NULL /* ssl_host_info_factory */, |
| 190 proxy_service_, |
| 191 net::ClientSocketFactory::GetDefaultFactory(), |
| 192 ssl_config_service_, |
| 193 new net::SpdySessionPool(ssl_config_service_), |
| 194 http_auth_handler_factory_, |
| 195 network_delegate_, |
| 196 NULL); |
| 197 |
181 http_transaction_factory_ = new net::HttpCache( | 198 http_transaction_factory_ = new net::HttpCache( |
182 net::HttpNetworkLayer::CreateFactory(host_resolver_, | 199 network_session, |
183 cert_verifier_, | |
184 NULL /* dnsrr_resovler */, | |
185 NULL /* dns_cert_checker*/, | |
186 NULL /* ssl_host_info */, | |
187 proxy_service_, | |
188 ssl_config_service_, | |
189 http_auth_handler_factory_, | |
190 network_delegate_, | |
191 NULL), | |
192 NULL /* net_log */, | |
193 net::HttpCache::DefaultBackend::InMemory(0)); | 200 net::HttpCache::DefaultBackend::InMemory(0)); |
194 } | 201 } |
195 | 202 |
196 virtual const std::string& GetUserAgent(const GURL& url) const { | 203 virtual const std::string& GetUserAgent(const GURL& url) const { |
197 return user_agent_; | 204 return user_agent_; |
198 } | 205 } |
199 | 206 |
200 private: | 207 private: |
201 std::string user_agent_; | 208 std::string user_agent_; |
202 MessageLoop* io_loop_; | 209 MessageLoop* io_loop_; |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 version += "-F"; | 622 version += "-F"; |
616 if (!version_info.IsOfficialBuild()) | 623 if (!version_info.IsOfficialBuild()) |
617 version.append("-devel"); | 624 version.append("-devel"); |
618 return version; | 625 return version; |
619 } else { | 626 } else { |
620 NOTREACHED() << "Unable to retrieve version string."; | 627 NOTREACHED() << "Unable to retrieve version string."; |
621 } | 628 } |
622 | 629 |
623 return std::string(); | 630 return std::string(); |
624 } | 631 } |
OLD | NEW |