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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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); |
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 798 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 |