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_impl.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" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 std::vector<char> body; | 124 std::vector<char> body; |
125 if (method == "POST") { | 125 if (method == "POST") { |
126 bool content_type_found = false; | 126 bool content_type_found = false; |
127 std::vector<std::string> names; | 127 std::vector<std::string> names; |
128 std::vector<std::string> values; | 128 std::vector<std::string> values; |
129 PluginHost::SetPostData(buf, len, &names, &values, &body); | 129 PluginHost::SetPostData(buf, len, &names, &values, &body); |
130 for (size_t i = 0; i < names.size(); ++i) { | 130 for (size_t i = 0; i < names.size(); ++i) { |
131 if (!request_info.headers.empty()) | 131 if (!request_info.headers.empty()) |
132 request_info.headers += "\r\n"; | 132 request_info.headers += "\r\n"; |
133 request_info.headers += names[i] + ": " + values[i]; | 133 request_info.headers += names[i] + ": " + values[i]; |
134 if (LowerCaseEqualsASCII(names[i], "content-type")) | 134 if (base::LowerCaseEqualsASCII(names[i], "content-type")) |
135 content_type_found = true; | 135 content_type_found = true; |
136 } | 136 } |
137 | 137 |
138 if (!content_type_found) { | 138 if (!content_type_found) { |
139 if (!request_info.headers.empty()) | 139 if (!request_info.headers.empty()) |
140 request_info.headers += "\r\n"; | 140 request_info.headers += "\r\n"; |
141 request_info.headers += "Content-Type: application/x-www-form-urlencoded"; | 141 request_info.headers += "Content-Type: application/x-www-form-urlencoded"; |
142 } | 142 } |
143 } else { | 143 } else { |
144 if (!range.empty()) | 144 if (!range.empty()) |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 } | 371 } |
372 | 372 |
373 if (error_code == net::OK) { | 373 if (error_code == net::OK) { |
374 plugin_stream_->DidFinishLoading(resource_id_); | 374 plugin_stream_->DidFinishLoading(resource_id_); |
375 } else { | 375 } else { |
376 plugin_stream_->DidFail(resource_id_); | 376 plugin_stream_->DidFail(resource_id_); |
377 } | 377 } |
378 } | 378 } |
379 | 379 |
380 } // namespace content | 380 } // namespace content |
OLD | NEW |