| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 2 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 3 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 4 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
| 5 * Copyright (C) 2009 Google Inc. All rights reserved. | 5 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 6 * Copyright (C) 2011 Apple Inc. All Rights Reserved. | 6 * Copyright (C) 2011 Apple Inc. All Rights Reserved. |
| 7 * | 7 * |
| 8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
| 9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
| 10 * are met: | 10 * are met: |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 // attribute values. Further this function appears to process parameter names | 239 // attribute values. Further this function appears to process parameter names |
| 240 // in a case-sensitive manner. (There are likely other bugs as well.) | 240 // in a case-sensitive manner. (There are likely other bugs as well.) |
| 241 String filenameFromHTTPContentDisposition(const String& value) | 241 String filenameFromHTTPContentDisposition(const String& value) |
| 242 { | 242 { |
| 243 Vector<String> keyValuePairs; | 243 Vector<String> keyValuePairs; |
| 244 value.split(';', keyValuePairs); | 244 value.split(';', keyValuePairs); |
| 245 | 245 |
| 246 unsigned length = keyValuePairs.size(); | 246 unsigned length = keyValuePairs.size(); |
| 247 for (unsigned i = 0; i < length; i++) { | 247 for (unsigned i = 0; i < length; i++) { |
| 248 size_t valueStartPos = keyValuePairs[i].find('='); | 248 size_t valueStartPos = keyValuePairs[i].find('='); |
| 249 if (valueStartPos == notFound) | 249 if (valueStartPos == kNotFound) |
| 250 continue; | 250 continue; |
| 251 | 251 |
| 252 String key = keyValuePairs[i].left(valueStartPos).stripWhiteSpace(); | 252 String key = keyValuePairs[i].left(valueStartPos).stripWhiteSpace(); |
| 253 | 253 |
| 254 if (key.isEmpty() || key != "filename") | 254 if (key.isEmpty() || key != "filename") |
| 255 continue; | 255 continue; |
| 256 | 256 |
| 257 String value = keyValuePairs[i].substring(valueStartPos + 1).stripWhiteS
pace(); | 257 String value = keyValuePairs[i].substring(valueStartPos + 1).stripWhiteS
pace(); |
| 258 | 258 |
| 259 // Remove quotes if there are any | 259 // Remove quotes if there are any |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 void findCharsetInMediaType(const String& mediaType, unsigned int& charsetPos, u
nsigned int& charsetLen, unsigned int start) | 311 void findCharsetInMediaType(const String& mediaType, unsigned int& charsetPos, u
nsigned int& charsetLen, unsigned int start) |
| 312 { | 312 { |
| 313 charsetPos = start; | 313 charsetPos = start; |
| 314 charsetLen = 0; | 314 charsetLen = 0; |
| 315 | 315 |
| 316 size_t pos = start; | 316 size_t pos = start; |
| 317 unsigned length = mediaType.length(); | 317 unsigned length = mediaType.length(); |
| 318 | 318 |
| 319 while (pos < length) { | 319 while (pos < length) { |
| 320 pos = mediaType.find("charset", pos, false); | 320 pos = mediaType.find("charset", pos, false); |
| 321 if (pos == notFound || pos == 0) { | 321 if (pos == kNotFound || !pos) { |
| 322 charsetLen = 0; | 322 charsetLen = 0; |
| 323 return; | 323 return; |
| 324 } | 324 } |
| 325 | 325 |
| 326 // is what we found a beginning of a word? | 326 // is what we found a beginning of a word? |
| 327 if (mediaType[pos-1] > ' ' && mediaType[pos-1] != ';') { | 327 if (mediaType[pos-1] > ' ' && mediaType[pos-1] != ';') { |
| 328 pos += 7; | 328 pos += 7; |
| 329 continue; | 329 continue; |
| 330 } | 330 } |
| 331 | 331 |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 | 678 |
| 679 size_t parseHTTPRequestBody(const char* data, size_t length, Vector<unsigned cha
r>& body) | 679 size_t parseHTTPRequestBody(const char* data, size_t length, Vector<unsigned cha
r>& body) |
| 680 { | 680 { |
| 681 body.clear(); | 681 body.clear(); |
| 682 body.append(data, length); | 682 body.append(data, length); |
| 683 | 683 |
| 684 return length; | 684 return length; |
| 685 } | 685 } |
| 686 | 686 |
| 687 } | 687 } |
| OLD | NEW |