| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2007, 2008, 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2007, 2008, 2011, 2012 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved. | 3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved. |
| 4 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved. | 4 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 return isSchemeFirstChar(c) || (c >= '0' && c <= '9') || c == '.' || c == '-
' || c == '+'; | 86 return isSchemeFirstChar(c) || (c >= '0' && c <= '9') || c == '.' || c == '-
' || c == '+'; |
| 87 } | 87 } |
| 88 | 88 |
| 89 static bool isUnicodeEncoding(const WTF::TextEncoding* encoding) | 89 static bool isUnicodeEncoding(const WTF::TextEncoding* encoding) |
| 90 { | 90 { |
| 91 return encoding->encodingForFormSubmission() == UTF8Encoding(); | 91 return encoding->encodingForFormSubmission() == UTF8Encoding(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 namespace { | 94 namespace { |
| 95 | 95 |
| 96 class KURLCharsetConverter : public url_canon::CharsetConverter { | 96 class KURLCharsetConverter FINAL : public url_canon::CharsetConverter { |
| 97 public: | 97 public: |
| 98 // The encoding parameter may be 0, but in this case the object must not be
called. | 98 // The encoding parameter may be 0, but in this case the object must not be
called. |
| 99 explicit KURLCharsetConverter(const WTF::TextEncoding* encoding) | 99 explicit KURLCharsetConverter(const WTF::TextEncoding* encoding) |
| 100 : m_encoding(encoding) | 100 : m_encoding(encoding) |
| 101 { | 101 { |
| 102 } | 102 } |
| 103 | 103 |
| 104 virtual void ConvertFromUTF16(const url_parse::UTF16Char* input, int inputLe
ngth, url_canon::CanonOutput* output) | 104 virtual void ConvertFromUTF16(const url_parse::UTF16Char* input, int inputLe
ngth, url_canon::CanonOutput* output) OVERRIDE |
| 105 { | 105 { |
| 106 CString encoded = m_encoding->normalizeAndEncode(String(input, inputLeng
th), WTF::URLEncodedEntitiesForUnencodables); | 106 CString encoded = m_encoding->normalizeAndEncode(String(input, inputLeng
th), WTF::URLEncodedEntitiesForUnencodables); |
| 107 output->Append(encoded.data(), static_cast<int>(encoded.length())); | 107 output->Append(encoded.data(), static_cast<int>(encoded.length())); |
| 108 } | 108 } |
| 109 | 109 |
| 110 private: | 110 private: |
| 111 const WTF::TextEncoding* m_encoding; | 111 const WTF::TextEncoding* m_encoding; |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 } // namespace | 114 } // namespace |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 m_string = AtomicString::fromUTF8(output.data(), output.length()); | 879 m_string = AtomicString::fromUTF8(output.data(), output.length()); |
| 880 } | 880 } |
| 881 | 881 |
| 882 bool KURL::isSafeToSendToAnotherThread() const | 882 bool KURL::isSafeToSendToAnotherThread() const |
| 883 { | 883 { |
| 884 return m_string.isSafeToSendToAnotherThread() | 884 return m_string.isSafeToSendToAnotherThread() |
| 885 && (!m_innerURL || m_innerURL->isSafeToSendToAnotherThread()); | 885 && (!m_innerURL || m_innerURL->isSafeToSendToAnotherThread()); |
| 886 } | 886 } |
| 887 | 887 |
| 888 } // namespace WebCore | 888 } // namespace WebCore |
| OLD | NEW |