| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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() + | 147 Time::Now() + |
| 148 TimeDelta::FromDays(kLifetimeDays)); | 148 TimeDelta::FromDays(kLifetimeDays)); |
| 149 info->ssl_info.cert_status = 0; | 149 info->ssl_info.cert_status = 0; |
| 150 info->ssl_info.security_bits = 0; | 150 info->ssl_info.security_bits = 0; |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 | 153 |
| 154 int URLRequestInterceptJob::GetResponseCode() { | 154 int URLRequestInterceptJob::GetResponseCode() const { |
| 155 if (!plugin_) | 155 if (!plugin_) |
| 156 return -1; | 156 return -1; |
| 157 | 157 |
| 158 int status = 200; | 158 int status = 200; |
| 159 plugin_->functions().request_funcs->get_response_info( | 159 plugin_->functions().request_funcs->get_response_info( |
| 160 cprequest_.get(), CPRESPONSEINFO_HTTP_STATUS, &status, sizeof(status)); | 160 cprequest_.get(), CPRESPONSEINFO_HTTP_STATUS, &status, sizeof(status)); |
| 161 | 161 |
| 162 return status; | 162 return status; |
| 163 } | 163 } |
| 164 | 164 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 } | 207 } |
| 208 | 208 |
| 209 void URLRequestInterceptJob::Observe(NotificationType type, | 209 void URLRequestInterceptJob::Observe(NotificationType type, |
| 210 const NotificationSource& source, | 210 const NotificationSource& source, |
| 211 const NotificationDetails& details) { | 211 const NotificationDetails& details) { |
| 212 DCHECK(type == NotificationType::CHROME_PLUGIN_UNLOADED); | 212 DCHECK(type == NotificationType::CHROME_PLUGIN_UNLOADED); |
| 213 DCHECK(plugin_ == Source<ChromePluginLib>(source).ptr()); | 213 DCHECK(plugin_ == Source<ChromePluginLib>(source).ptr()); |
| 214 | 214 |
| 215 DetachPlugin(); | 215 DetachPlugin(); |
| 216 } | 216 } |
| OLD | NEW |