OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/child/npapi/plugin_url_fetcher.h" | 5 #include "content/child/npapi/plugin_url_fetcher.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "content/child/child_thread.h" | 8 #include "content/child/child_thread_impl.h" |
9 #include "content/child/multipart_response_delegate.h" | 9 #include "content/child/multipart_response_delegate.h" |
10 #include "content/child/npapi/plugin_host.h" | 10 #include "content/child/npapi/plugin_host.h" |
11 #include "content/child/npapi/plugin_instance.h" | 11 #include "content/child/npapi/plugin_instance.h" |
12 #include "content/child/npapi/plugin_stream_url.h" | 12 #include "content/child/npapi/plugin_stream_url.h" |
13 #include "content/child/npapi/webplugin.h" | 13 #include "content/child/npapi/webplugin.h" |
14 #include "content/child/npapi/webplugin_resource_client.h" | 14 #include "content/child/npapi/webplugin_resource_client.h" |
15 #include "content/child/plugin_messages.h" | 15 #include "content/child/plugin_messages.h" |
16 #include "content/child/request_extra_data.h" | 16 #include "content/child/request_extra_data.h" |
17 #include "content/child/request_info.h" | 17 #include "content/child/request_info.h" |
18 #include "content/child/resource_dispatcher.h" | 18 #include "content/child/resource_dispatcher.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 if (!content_type_found) { | 139 if (!content_type_found) { |
140 if (!request_info.headers.empty()) | 140 if (!request_info.headers.empty()) |
141 request_info.headers += "\r\n"; | 141 request_info.headers += "\r\n"; |
142 request_info.headers += "Content-Type: application/x-www-form-urlencoded"; | 142 request_info.headers += "Content-Type: application/x-www-form-urlencoded"; |
143 } | 143 } |
144 } else { | 144 } else { |
145 if (!range.empty()) | 145 if (!range.empty()) |
146 request_info.headers = std::string("Range: ") + range; | 146 request_info.headers = std::string("Range: ") + range; |
147 } | 147 } |
148 | 148 |
149 bridge_.reset(ChildThread::current()->resource_dispatcher()->CreateBridge( | 149 bridge_.reset(ChildThreadImpl::current()->resource_dispatcher()->CreateBridge( |
150 request_info)); | 150 request_info)); |
151 if (!body.empty()) { | 151 if (!body.empty()) { |
152 scoped_refptr<ResourceRequestBody> request_body = | 152 scoped_refptr<ResourceRequestBody> request_body = |
153 new ResourceRequestBody; | 153 new ResourceRequestBody; |
154 request_body->AppendBytes(&body[0], body.size()); | 154 request_body->AppendBytes(&body[0], body.size()); |
155 bridge_->SetRequestBody(request_body.get()); | 155 bridge_->SetRequestBody(request_body.get()); |
156 } | 156 } |
157 | 157 |
158 bridge_->Start(this); | 158 bridge_->Start(this); |
159 | 159 |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 } | 368 } |
369 | 369 |
370 if (error_code == net::OK) { | 370 if (error_code == net::OK) { |
371 plugin_stream_->DidFinishLoading(resource_id_); | 371 plugin_stream_->DidFinishLoading(resource_id_); |
372 } else { | 372 } else { |
373 plugin_stream_->DidFail(resource_id_); | 373 plugin_stream_->DidFail(resource_id_); |
374 } | 374 } |
375 } | 375 } |
376 | 376 |
377 } // namespace content | 377 } // namespace content |
OLD | NEW |