| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 static int64_t nextIdentifier = static_cast<int64_t>(currentTime() * 1000000
.0); | 59 static int64_t nextIdentifier = static_cast<int64_t>(currentTime() * 1000000
.0); |
| 60 return ++nextIdentifier; | 60 return ++nextIdentifier; |
| 61 } | 61 } |
| 62 | 62 |
| 63 static void appendMailtoPostFormDataToURL(KURL& url, const EncodedFormData& data
, const String& encodingType) | 63 static void appendMailtoPostFormDataToURL(KURL& url, const EncodedFormData& data
, const String& encodingType) |
| 64 { | 64 { |
| 65 String body = data.flattenToString(); | 65 String body = data.flattenToString(); |
| 66 | 66 |
| 67 if (equalIgnoringCase(encodingType, "text/plain")) { | 67 if (equalIgnoringCase(encodingType, "text/plain")) { |
| 68 // Convention seems to be to decode, and s/&/\r\n/. Also, spaces are enc
oded as %20. | 68 // Convention seems to be to decode, and s/&/\r\n/. Also, spaces are enc
oded as %20. |
| 69 body = decodeURLEscapeSequences(body.replaceWithLiteral('&', "\r\n").rep
lace('+', ' ') + "\r\n"); | 69 body = decodeURLEscapeSequences(body.replace('&', "\r\n").replace('+', '
') + "\r\n"); |
| 70 } | 70 } |
| 71 | 71 |
| 72 Vector<char> bodyData; | 72 Vector<char> bodyData; |
| 73 bodyData.append("body=", 5); | 73 bodyData.append("body=", 5); |
| 74 FormDataEncoder::encodeStringAsFormData(bodyData, body.utf8()); | 74 FormDataEncoder::encodeStringAsFormData(bodyData, body.utf8()); |
| 75 body = String(bodyData.data(), bodyData.size()).replaceWithLiteral('+', "%20
"); | 75 body = String(bodyData.data(), bodyData.size()).replace('+', "%20"); |
| 76 | 76 |
| 77 StringBuilder query; | 77 StringBuilder query; |
| 78 query.append(url.query()); | 78 query.append(url.query()); |
| 79 if (!query.isEmpty()) | 79 if (!query.isEmpty()) |
| 80 query.append('&'); | 80 query.append('&'); |
| 81 query.append(body); | 81 query.append(body); |
| 82 url.setQuery(query.toString()); | 82 url.setQuery(query.toString()); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void FormSubmission::Attributes::parseAction(const String& action) | 85 void FormSubmission::Attributes::parseAction(const String& action) |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 if (m_boundary.isEmpty()) | 274 if (m_boundary.isEmpty()) |
| 275 frameRequest.resourceRequest().setHTTPContentType(m_contentType); | 275 frameRequest.resourceRequest().setHTTPContentType(m_contentType); |
| 276 else | 276 else |
| 277 frameRequest.resourceRequest().setHTTPContentType(m_contentType + ";
boundary=" + m_boundary); | 277 frameRequest.resourceRequest().setHTTPContentType(m_contentType + ";
boundary=" + m_boundary); |
| 278 } | 278 } |
| 279 | 279 |
| 280 frameRequest.resourceRequest().setURL(requestURL()); | 280 frameRequest.resourceRequest().setURL(requestURL()); |
| 281 } | 281 } |
| 282 | 282 |
| 283 } // namespace blink | 283 } // namespace blink |
| OLD | NEW |