| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |