| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 m_items.append(BlobDataItem(dataHandle, offset, length)); | 119 m_items.append(BlobDataItem(dataHandle, offset, length)); |
| 120 } | 120 } |
| 121 | 121 |
| 122 void BlobData::appendFileSystemURL(const KURL& url, long long offset, long long
length, double expectedModificationTime) | 122 void BlobData::appendFileSystemURL(const KURL& url, long long offset, long long
length, double expectedModificationTime) |
| 123 { | 123 { |
| 124 m_items.append(BlobDataItem(url, offset, length, expectedModificationTime)); | 124 m_items.append(BlobDataItem(url, offset, length, expectedModificationTime)); |
| 125 } | 125 } |
| 126 | 126 |
| 127 void BlobData::appendText(const String& text, bool doNormalizeLineEndingsToNativ
e) | 127 void BlobData::appendText(const String& text, bool doNormalizeLineEndingsToNativ
e) |
| 128 { | 128 { |
| 129 CString utf8Text = UTF8Encoding().normalizeAndEncode(text, WTF::EntitiesForU
nencodables); | 129 CString utf8Text = UTF8Encoding().encode(text, WTF::EntitiesForUnencodables)
; |
| 130 RefPtr<RawData> data = nullptr; | 130 RefPtr<RawData> data = nullptr; |
| 131 Vector<char>* buffer; | 131 Vector<char>* buffer; |
| 132 if (canConsolidateData(text.length())) { | 132 if (canConsolidateData(text.length())) { |
| 133 buffer = m_items.last().data->mutableData(); | 133 buffer = m_items.last().data->mutableData(); |
| 134 } else { | 134 } else { |
| 135 data = RawData::create(); | 135 data = RawData::create(); |
| 136 buffer = data->mutableData(); | 136 buffer = data->mutableData(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 if (doNormalizeLineEndingsToNative) { | 139 if (doNormalizeLineEndingsToNative) { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 { | 219 { |
| 220 BlobRegistry::addBlobDataRef(m_uuid); | 220 BlobRegistry::addBlobDataRef(m_uuid); |
| 221 } | 221 } |
| 222 | 222 |
| 223 BlobDataHandle::~BlobDataHandle() | 223 BlobDataHandle::~BlobDataHandle() |
| 224 { | 224 { |
| 225 BlobRegistry::removeBlobDataRef(m_uuid); | 225 BlobRegistry::removeBlobDataRef(m_uuid); |
| 226 } | 226 } |
| 227 | 227 |
| 228 } // namespace blink | 228 } // namespace blink |
| OLD | NEW |