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 12 matching lines...) Expand all Loading... |
23 // | 23 // |
24 // URLRequestInterceptJob | 24 // URLRequestInterceptJob |
25 // | 25 // |
26 | 26 |
27 URLRequestInterceptJob::URLRequestInterceptJob(URLRequest* request, | 27 URLRequestInterceptJob::URLRequestInterceptJob(URLRequest* request, |
28 ChromePluginLib* plugin, | 28 ChromePluginLib* plugin, |
29 ScopableCPRequest* cprequest) | 29 ScopableCPRequest* cprequest) |
30 : URLRequestJob(request), | 30 : URLRequestJob(request), |
31 cprequest_(cprequest), | 31 cprequest_(cprequest), |
32 plugin_(plugin), | 32 plugin_(plugin), |
33 got_headers_(false), | |
34 read_buffer_(NULL) { | 33 read_buffer_(NULL) { |
35 cprequest_->data = this; // see FromCPRequest(). | 34 cprequest_->data = this; // see FromCPRequest(). |
36 | 35 |
37 registrar_.Add(this, NotificationType::CHROME_PLUGIN_UNLOADED, | 36 registrar_.Add(this, NotificationType::CHROME_PLUGIN_UNLOADED, |
38 Source<ChromePluginLib>(plugin_)); | 37 Source<ChromePluginLib>(plugin_)); |
39 } | 38 } |
40 | 39 |
41 URLRequestInterceptJob::~URLRequestInterceptJob() { | 40 URLRequestInterceptJob::~URLRequestInterceptJob() { |
42 if (plugin_) { | 41 if (plugin_) { |
43 plugin_->functions().request_funcs->end_request(cprequest_.get(), | 42 plugin_->functions().request_funcs->end_request(cprequest_.get(), |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 NotifyReadComplete(bytes_read); | 217 NotifyReadComplete(bytes_read); |
219 } | 218 } |
220 | 219 |
221 void URLRequestInterceptJob::Observe(NotificationType type, | 220 void URLRequestInterceptJob::Observe(NotificationType type, |
222 const NotificationSource& source, | 221 const NotificationSource& source, |
223 const NotificationDetails& details) { | 222 const NotificationDetails& details) { |
224 DCHECK(type == NotificationType::CHROME_PLUGIN_UNLOADED); | 223 DCHECK(type == NotificationType::CHROME_PLUGIN_UNLOADED); |
225 DCHECK(plugin_ == Source<ChromePluginLib>(source).ptr()); | 224 DCHECK(plugin_ == Source<ChromePluginLib>(source).ptr()); |
226 DetachPlugin(); | 225 DetachPlugin(); |
227 } | 226 } |
OLD | NEW |