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 FINAL : public url::CharsetConverter { | 96 class KURLCharsetConverter final : public url::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::UTF16Char* input, int inputLength,
url::CanonOutput* output) override | 104 virtual void ConvertFromUTF16(const url::UTF16Char* input, int inputLength,
url::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); |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 m_string = AtomicString::fromUTF8(output.data(), output.length()); | 913 m_string = AtomicString::fromUTF8(output.data(), output.length()); |
914 } | 914 } |
915 | 915 |
916 bool KURL::isSafeToSendToAnotherThread() const | 916 bool KURL::isSafeToSendToAnotherThread() const |
917 { | 917 { |
918 return m_string.isSafeToSendToAnotherThread() | 918 return m_string.isSafeToSendToAnotherThread() |
919 && (!m_innerURL || m_innerURL->isSafeToSendToAnotherThread()); | 919 && (!m_innerURL || m_innerURL->isSafeToSendToAnotherThread()); |
920 } | 920 } |
921 | 921 |
922 } // namespace blink | 922 } // namespace blink |
OLD | NEW |