OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This job type handles Chrome plugin network interception. When a plugin | 5 // This job type handles Chrome plugin network interception. When a plugin |
6 // wants to intercept a request, a job of this type is created. The intercept | 6 // wants to intercept a request, a job of this type is created. The intercept |
7 // job communicates with the plugin to retrieve the response headers and data. | 7 // job communicates with the plugin to retrieve the response headers and data. |
8 | 8 |
9 #include "chrome/common/net/url_request_intercept_job.h" | 9 #include "chrome/common/net/url_request_intercept_job.h" |
10 | 10 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 const char* kCertIssuer = "Chrome Internal"; | 137 const char* kCertIssuer = "Chrome Internal"; |
138 const int kLifetimeDays = 100; | 138 const int kLifetimeDays = 100; |
139 | 139 |
140 DLOG(WARNING) << "Issuing a fake SSL certificate for interception of URL " | 140 DLOG(WARNING) << "Issuing a fake SSL certificate for interception of URL " |
141 << request_->url(); | 141 << request_->url(); |
142 | 142 |
143 info->ssl_info.cert = | 143 info->ssl_info.cert = |
144 new net::X509Certificate(request_->url().GetWithEmptyPath().spec(), | 144 new net::X509Certificate(request_->url().GetWithEmptyPath().spec(), |
145 kCertIssuer, | 145 kCertIssuer, |
146 Time::Now(), | 146 Time::Now(), |
147 Time::Now() + TimeDelta::FromDays(kLifetimeDays
)); | 147 Time::Now() + |
| 148 TimeDelta::FromDays(kLifetimeDays)); |
148 info->ssl_info.cert_status = 0; | 149 info->ssl_info.cert_status = 0; |
149 info->ssl_info.security_bits = 0; | 150 info->ssl_info.security_bits = 0; |
150 } | 151 } |
151 } | 152 } |
152 | 153 |
153 int URLRequestInterceptJob::GetResponseCode() { | 154 int URLRequestInterceptJob::GetResponseCode() { |
154 if (!plugin_) | 155 if (!plugin_) |
155 return -1; | 156 return -1; |
156 | 157 |
157 int status = 200; | 158 int status = 200; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 } | 207 } |
207 | 208 |
208 void URLRequestInterceptJob::Observe(NotificationType type, | 209 void URLRequestInterceptJob::Observe(NotificationType type, |
209 const NotificationSource& source, | 210 const NotificationSource& source, |
210 const NotificationDetails& details) { | 211 const NotificationDetails& details) { |
211 DCHECK(type == NotificationType::CHROME_PLUGIN_UNLOADED); | 212 DCHECK(type == NotificationType::CHROME_PLUGIN_UNLOADED); |
212 DCHECK(plugin_ == Source<ChromePluginLib>(source).ptr()); | 213 DCHECK(plugin_ == Source<ChromePluginLib>(source).ptr()); |
213 | 214 |
214 DetachPlugin(); | 215 DetachPlugin(); |
215 } | 216 } |
OLD | NEW |