| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 *q++ = '\n'; | 142 *q++ = '\n'; |
| 143 } else { | 143 } else { |
| 144 // Leave other characters alone. | 144 // Leave other characters alone. |
| 145 *q++ = c; | 145 *q++ = c; |
| 146 } | 146 } |
| 147 } | 147 } |
| 148 } | 148 } |
| 149 | 149 |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 namespace WebCore { | 152 namespace blink { |
| 153 | 153 |
| 154 void normalizeToCROrLF(const CString& from, Vector<char>& result, bool toCR); | 154 void normalizeToCROrLF(const CString& from, Vector<char>& result, bool toCR); |
| 155 | 155 |
| 156 // Normalize all line-endings to CR or LF. | 156 // Normalize all line-endings to CR or LF. |
| 157 void normalizeToCROrLF(const CString& from, Vector<char>& result, bool toCR) | 157 void normalizeToCROrLF(const CString& from, Vector<char>& result, bool toCR) |
| 158 { | 158 { |
| 159 // Compute the new length. | 159 // Compute the new length. |
| 160 size_t newLen = 0; | 160 size_t newLen = 0; |
| 161 bool needFix = false; | 161 bool needFix = false; |
| 162 const char* p = from.data(); | 162 const char* p = from.data(); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 void normalizeLineEndingsToNative(const CString& from, Vector<char>& result) | 227 void normalizeLineEndingsToNative(const CString& from, Vector<char>& result) |
| 228 { | 228 { |
| 229 #if OS(WIN) | 229 #if OS(WIN) |
| 230 VectorCharAppendBuffer buffer(result); | 230 VectorCharAppendBuffer buffer(result); |
| 231 internalNormalizeLineEndingsToCRLF(from, buffer); | 231 internalNormalizeLineEndingsToCRLF(from, buffer); |
| 232 #else | 232 #else |
| 233 normalizeLineEndingsToLF(from, result); | 233 normalizeLineEndingsToLF(from, result); |
| 234 #endif | 234 #endif |
| 235 } | 235 } |
| 236 | 236 |
| 237 } // namespace WebCore | 237 } // namespace blink |
| OLD | NEW |