OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_host.h" | 5 #include "content/child/npapi/plugin_host.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 // If the name field is empty, we'll skip this header | 264 // If the name field is empty, we'll skip this header |
265 // but we won't error out. | 265 // but we won't error out. |
266 if (!name.empty() && name != "content-length") { | 266 if (!name.empty() && name != "content-length") { |
267 names->push_back(name); | 267 names->push_back(name); |
268 values->push_back(value); | 268 values->push_back(value); |
269 } | 269 } |
270 start = ptr + 1; | 270 start = ptr + 1; |
271 break; | 271 break; |
272 case GETVALUE: | 272 case GETVALUE: |
273 // Got a header. | 273 // Got a header. |
274 name = base::StringToLowerASCII(std::string(start, ptr - start)); | 274 name = base::ToLowerASCII(base::StringPiece(start, ptr - start)); |
275 base::TrimWhitespace(name, base::TRIM_ALL, &name); | 275 base::TrimWhitespace(name, base::TRIM_ALL, &name); |
276 start = ptr + 1; | 276 start = ptr + 1; |
277 break; | 277 break; |
278 case GETDATA: { | 278 case GETDATA: { |
279 // Finished headers, now get body | 279 // Finished headers, now get body |
280 if (*ptr) | 280 if (*ptr) |
281 start = ptr + 1; | 281 start = ptr + 1; |
282 size_t previous_size = body->size(); | 282 size_t previous_size = body->size(); |
283 size_t new_body_size = length - static_cast<int>(start - buf); | 283 size_t new_body_size = length - static_cast<int>(start - buf); |
284 body->resize(previous_size + new_body_size); | 284 body->resize(previous_size + new_body_size); |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1098 } | 1098 } |
1099 | 1099 |
1100 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) { | 1100 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) { |
1101 scoped_refptr<PluginInstance> plugin(FindInstance(instance)); | 1101 scoped_refptr<PluginInstance> plugin(FindInstance(instance)); |
1102 if (plugin.get()) { | 1102 if (plugin.get()) { |
1103 plugin->URLRedirectResponse(!!allow, notify_data); | 1103 plugin->URLRedirectResponse(!!allow, notify_data); |
1104 } | 1104 } |
1105 } | 1105 } |
1106 | 1106 |
1107 } // extern "C" | 1107 } // extern "C" |
OLD | NEW |