Chromium Code Reviews| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 body = decodeURLEscapeSequences(body.replaceWithLiteral('&', "\r\n").rep lace('+', ' ') + "\r\n"); | 68 body = decodeURLEscapeSequences(body.replaceWithLiteral('&', "\r\n").rep lace('+', ' ') + "\r\n"); |
| 69 } | 69 } |
| 70 | 70 |
| 71 Vector<char> bodyData; | 71 Vector<char> bodyData; |
| 72 bodyData.append("body=", 5); | 72 bodyData.append("body=", 5); |
| 73 FormDataBuilder::encodeStringAsFormData(bodyData, body.utf8()); | 73 FormDataBuilder::encodeStringAsFormData(bodyData, body.utf8()); |
| 74 body = String(bodyData.data(), bodyData.size()).replaceWithLiteral('+', "%20 "); | 74 body = String(bodyData.data(), bodyData.size()).replaceWithLiteral('+', "%20 "); |
| 75 | 75 |
| 76 String query = url.query(); | 76 String query = url.query(); |
| 77 if (!query.isEmpty()) | 77 if (!query.isEmpty()) |
| 78 query.append('&'); | 78 query = query + '&'; |
| 79 query.append(body); | 79 query = query + body; |
|
abarth-chromium
2014/01/15 17:50:18
Can we use StringBuilder here instead?
Sunil Ratnu
2014/01/16 05:49:56
Thanks abarth!
Yes we can use StringBuilder here
| |
| 80 url.setQuery(query); | 80 url.setQuery(query); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void FormSubmission::Attributes::parseAction(const String& action) | 83 void FormSubmission::Attributes::parseAction(const String& action) |
| 84 { | 84 { |
| 85 // FIXME: Can we parse into a KURL? | 85 // FIXME: Can we parse into a KURL? |
| 86 m_action = stripLeadingAndTrailingHTMLSpaces(action); | 86 m_action = stripLeadingAndTrailingHTMLSpaces(action); |
| 87 } | 87 } |
| 88 | 88 |
| 89 String FormSubmission::Attributes::parseEncodingType(const String& type) | 89 String FormSubmission::Attributes::parseEncodingType(const String& type) |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 270 frameRequest.resourceRequest().setHTTPContentType(m_contentType); | 270 frameRequest.resourceRequest().setHTTPContentType(m_contentType); |
| 271 else | 271 else |
| 272 frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary); | 272 frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary); |
| 273 } | 273 } |
| 274 | 274 |
| 275 frameRequest.resourceRequest().setURL(requestURL()); | 275 frameRequest.resourceRequest().setURL(requestURL()); |
| 276 FrameLoader::addHTTPOriginIfNeeded(frameRequest.resourceRequest(), m_origin) ; | 276 FrameLoader::addHTTPOriginIfNeeded(frameRequest.resourceRequest(), m_origin) ; |
| 277 } | 277 } |
| 278 | 278 |
| 279 } | 279 } |
| OLD | NEW |