| 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 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 void KURL::init(const KURL& base, | 717 void KURL::init(const KURL& base, |
| 718 const String& relative, | 718 const String& relative, |
| 719 const WTF::TextEncoding* queryEncoding) { | 719 const WTF::TextEncoding* queryEncoding) { |
| 720 if (!relative.isNull() && relative.is8Bit()) { | 720 if (!relative.isNull() && relative.is8Bit()) { |
| 721 StringUTF8Adaptor relativeUTF8(relative); | 721 StringUTF8Adaptor relativeUTF8(relative); |
| 722 init(base, relativeUTF8.data(), relativeUTF8.length(), queryEncoding); | 722 init(base, relativeUTF8.data(), relativeUTF8.length(), queryEncoding); |
| 723 } else | 723 } else |
| 724 init(base, relative.characters16(), relative.length(), queryEncoding); | 724 init(base, relative.characters16(), relative.length(), queryEncoding); |
| 725 initProtocolIsInHTTPFamily(); | 725 initProtocolIsInHTTPFamily(); |
| 726 initInnerURL(); | 726 initInnerURL(); |
| 727 DCHECK_EQ(protocol(), protocol().lower()); |
| 727 } | 728 } |
| 728 | 729 |
| 729 template <typename CHAR> | 730 template <typename CHAR> |
| 730 void KURL::init(const KURL& base, | 731 void KURL::init(const KURL& base, |
| 731 const CHAR* relative, | 732 const CHAR* relative, |
| 732 int relativeLength, | 733 int relativeLength, |
| 733 const WTF::TextEncoding* queryEncoding) { | 734 const WTF::TextEncoding* queryEncoding) { |
| 734 // As a performance optimization, we do not use the charset converter | 735 // As a performance optimization, we do not use the charset converter |
| 735 // if encoding is UTF-8 or other Unicode encodings. Note that this is | 736 // if encoding is UTF-8 or other Unicode encodings. Note that this is |
| 736 // per HTML5 2.5.3 (resolving URL). The URL canonicalizer will be more | 737 // per HTML5 2.5.3 (resolving URL). The URL canonicalizer will be more |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 m_parsed = newParsed; | 869 m_parsed = newParsed; |
| 869 m_string = AtomicString::fromUTF8(output.data(), output.length()); | 870 m_string = AtomicString::fromUTF8(output.data(), output.length()); |
| 870 } | 871 } |
| 871 | 872 |
| 872 bool KURL::isSafeToSendToAnotherThread() const { | 873 bool KURL::isSafeToSendToAnotherThread() const { |
| 873 return m_string.isSafeToSendToAnotherThread() && | 874 return m_string.isSafeToSendToAnotherThread() && |
| 874 (!m_innerURL || m_innerURL->isSafeToSendToAnotherThread()); | 875 (!m_innerURL || m_innerURL->isSafeToSendToAnotherThread()); |
| 875 } | 876 } |
| 876 | 877 |
| 877 } // namespace blink | 878 } // namespace blink |
| OLD | NEW |