| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 virtual ~OutputBuffer() {} | 49 virtual ~OutputBuffer() {} |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 class CStringBuffer final : public OutputBuffer { | 52 class CStringBuffer final : public OutputBuffer { |
| 53 public: | 53 public: |
| 54 CStringBuffer(CString& buffer) : m_buffer(buffer) {} | 54 CStringBuffer(CString& buffer) : m_buffer(buffer) {} |
| 55 ~CStringBuffer() override {} | 55 ~CStringBuffer() override {} |
| 56 | 56 |
| 57 char* allocate(size_t size) override { | 57 char* allocate(size_t size) override { |
| 58 char* ptr; | 58 char* ptr; |
| 59 m_buffer = CString::newUninitialized(size, ptr); | 59 m_buffer = CString::createUninitialized(size, ptr); |
| 60 return ptr; | 60 return ptr; |
| 61 } | 61 } |
| 62 | 62 |
| 63 void copy(const CString& source) override { m_buffer = source; } | 63 void copy(const CString& source) override { m_buffer = source; } |
| 64 | 64 |
| 65 const CString& buffer() const { return m_buffer; } | 65 const CString& buffer() const { return m_buffer; } |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 CString m_buffer; | 68 CString m_buffer; |
| 69 }; | 69 }; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 void normalizeLineEndingsToNative(const CString& from, Vector<char>& result) { | 205 void normalizeLineEndingsToNative(const CString& from, Vector<char>& result) { |
| 206 #if OS(WIN) | 206 #if OS(WIN) |
| 207 VectorCharAppendBuffer buffer(result); | 207 VectorCharAppendBuffer buffer(result); |
| 208 internalNormalizeLineEndingsToCRLF(from, buffer); | 208 internalNormalizeLineEndingsToCRLF(from, buffer); |
| 209 #else | 209 #else |
| 210 normalizeLineEndingsToLF(from, result); | 210 normalizeLineEndingsToLF(from, result); |
| 211 #endif | 211 #endif |
| 212 } | 212 } |
| 213 | 213 |
| 214 } // namespace blink | 214 } // namespace blink |
| OLD | NEW |