| 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/file_util.h" | 8 #include "base/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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 // If the name field is empty, we'll skip this header | 268 // If the name field is empty, we'll skip this header |
| 269 // but we won't error out. | 269 // but we won't error out. |
| 270 if (!name.empty() && name != "content-length") { | 270 if (!name.empty() && name != "content-length") { |
| 271 names->push_back(name); | 271 names->push_back(name); |
| 272 values->push_back(value); | 272 values->push_back(value); |
| 273 } | 273 } |
| 274 start = ptr + 1; | 274 start = ptr + 1; |
| 275 break; | 275 break; |
| 276 case GETVALUE: | 276 case GETVALUE: |
| 277 // Got a header. | 277 // Got a header. |
| 278 name = StringToLowerASCII(std::string(start, ptr - start)); | 278 name = base::StringToLowerASCII(std::string(start, ptr - start)); |
| 279 base::TrimWhitespace(name, base::TRIM_ALL, &name); | 279 base::TrimWhitespace(name, base::TRIM_ALL, &name); |
| 280 start = ptr + 1; | 280 start = ptr + 1; |
| 281 break; | 281 break; |
| 282 case GETDATA: { | 282 case GETDATA: { |
| 283 // Finished headers, now get body | 283 // Finished headers, now get body |
| 284 if (*ptr) | 284 if (*ptr) |
| 285 start = ptr + 1; | 285 start = ptr + 1; |
| 286 size_t previous_size = body->size(); | 286 size_t previous_size = body->size(); |
| 287 size_t new_body_size = length - static_cast<int>(start - buf); | 287 size_t new_body_size = length - static_cast<int>(start - buf); |
| 288 body->resize(previous_size + new_body_size); | 288 body->resize(previous_size + new_body_size); |
| (...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1101 } | 1101 } |
| 1102 | 1102 |
| 1103 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) { | 1103 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) { |
| 1104 scoped_refptr<PluginInstance> plugin(FindInstance(instance)); | 1104 scoped_refptr<PluginInstance> plugin(FindInstance(instance)); |
| 1105 if (plugin.get()) { | 1105 if (plugin.get()) { |
| 1106 plugin->URLRedirectResponse(!!allow, notify_data); | 1106 plugin->URLRedirectResponse(!!allow, notify_data); |
| 1107 } | 1107 } |
| 1108 } | 1108 } |
| 1109 | 1109 |
| 1110 } // extern "C" | 1110 } // extern "C" |
| OLD | NEW |