Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Side by Side Diff: Source/web/WebPageSerializerImpl.cpp

Issue 19845004: Do not normalize into NFC the values of form fields (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add normalizeAndEncode() without memory safety problem Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/xml/XMLHttpRequest.cpp ('k') | Source/weborigin/KURL.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 SerializeDomParam* param, 278 SerializeDomParam* param,
279 FlushOption flushOption) 279 FlushOption flushOption)
280 { 280 {
281 // Data buffer is not full nor do we want to force flush. 281 // Data buffer is not full nor do we want to force flush.
282 if (flushOption != ForceFlush && m_dataBuffer.length() <= dataBufferCapacity ) 282 if (flushOption != ForceFlush && m_dataBuffer.length() <= dataBufferCapacity )
283 return; 283 return;
284 284
285 String content = m_dataBuffer.toString(); 285 String content = m_dataBuffer.toString();
286 m_dataBuffer.clear(); 286 m_dataBuffer.clear();
287 287
288 CString encodedContent = param->textEncoding.encode(content, WTF::EntitiesFo rUnencodables); 288 CString encodedContent = param->textEncoding.normalizeAndEncode(content, WTF ::EntitiesForUnencodables);
289 289
290 // Send result to the client. 290 // Send result to the client.
291 m_client->didSerializeDataForFrame(param->url, 291 m_client->didSerializeDataForFrame(param->url,
292 WebCString(encodedContent.data(), encoded Content.length()), 292 WebCString(encodedContent.data(), encoded Content.length()),
293 status); 293 status);
294 } 294 }
295 295
296 void WebPageSerializerImpl::openTagToString(Element* element, 296 void WebPageSerializerImpl::openTagToString(Element* element,
297 SerializeDomParam* param) 297 SerializeDomParam* param)
298 { 298 {
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 521
522 encodeAndFlushBuffer(WebPageSerializerClient::CurrentFrameIsFinished, &p aram, ForceFlush); 522 encodeAndFlushBuffer(WebPageSerializerClient::CurrentFrameIsFinished, &p aram, ForceFlush);
523 } 523 }
524 524
525 ASSERT(m_dataBuffer.isEmpty()); 525 ASSERT(m_dataBuffer.isEmpty());
526 m_client->didSerializeDataForFrame(KURL(), WebCString("", 0), WebPageSeriali zerClient::AllFramesAreFinished); 526 m_client->didSerializeDataForFrame(KURL(), WebCString("", 0), WebPageSeriali zerClient::AllFramesAreFinished);
527 return didSerialization; 527 return didSerialization;
528 } 528 }
529 529
530 } // namespace WebKit 530 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/core/xml/XMLHttpRequest.cpp ('k') | Source/weborigin/KURL.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698