OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2010 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 14 matching lines...) Expand all Loading... |
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 | 31 |
32 #include "config.h" | 32 #include "config.h" |
33 #include "platform/text/LineEnding.h" | 33 #include "platform/text/LineEnding.h" |
34 | 34 |
| 35 #include "wtf/Allocator.h" |
| 36 #include "wtf/Noncopyable.h" |
35 #include "wtf/text/CString.h" | 37 #include "wtf/text/CString.h" |
36 #include "wtf/text/WTFString.h" | 38 #include "wtf/text/WTFString.h" |
37 | 39 |
38 namespace { | 40 namespace { |
39 | 41 |
40 class OutputBuffer { | 42 class OutputBuffer { |
| 43 STACK_ALLOCATED(); |
| 44 WTF_MAKE_NONCOPYABLE(OutputBuffer); |
41 public: | 45 public: |
| 46 OutputBuffer() { } |
42 virtual char* allocate(size_t) = 0; | 47 virtual char* allocate(size_t) = 0; |
43 virtual void copy(const CString&) = 0; | 48 virtual void copy(const CString&) = 0; |
44 virtual ~OutputBuffer() { } | 49 virtual ~OutputBuffer() { } |
45 }; | 50 }; |
46 | 51 |
47 class CStringBuffer final : public OutputBuffer { | 52 class CStringBuffer final : public OutputBuffer { |
48 public: | 53 public: |
49 CStringBuffer(CString& buffer) | 54 CStringBuffer(CString& buffer) |
50 : m_buffer(buffer) | 55 : m_buffer(buffer) |
51 { | 56 { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 { | 220 { |
216 #if OS(WIN) | 221 #if OS(WIN) |
217 VectorCharAppendBuffer buffer(result); | 222 VectorCharAppendBuffer buffer(result); |
218 internalNormalizeLineEndingsToCRLF(from, buffer); | 223 internalNormalizeLineEndingsToCRLF(from, buffer); |
219 #else | 224 #else |
220 normalizeLineEndingsToLF(from, result); | 225 normalizeLineEndingsToLF(from, result); |
221 #endif | 226 #endif |
222 } | 227 } |
223 | 228 |
224 } // namespace blink | 229 } // namespace blink |
OLD | NEW |