| 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 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 | 826 |
| 827 bool KURL::ProtocolIs(const StringView protocol) const { | 827 bool KURL::ProtocolIs(const StringView protocol) const { |
| 828 #if DCHECK_IS_ON() | 828 #if DCHECK_IS_ON() |
| 829 AssertProtocolIsGood(protocol); | 829 AssertProtocolIsGood(protocol); |
| 830 #endif | 830 #endif |
| 831 | 831 |
| 832 // JavaScript URLs are "valid" and should be executed even if KURL decides | 832 // JavaScript URLs are "valid" and should be executed even if KURL decides |
| 833 // they are invalid. The free function protocolIsJavaScript() should be used | 833 // they are invalid. The free function protocolIsJavaScript() should be used |
| 834 // instead. | 834 // instead. |
| 835 // FIXME: Chromium code needs to be fixed for this assert to be enabled. | 835 // FIXME: Chromium code needs to be fixed for this assert to be enabled. |
| 836 // ASSERT(strcmp(protocol, "javascript")); | 836 // DCHECK(strcmp(protocol, "javascript")); |
| 837 return protocol_ == protocol; | 837 return protocol_ == protocol; |
| 838 } | 838 } |
| 839 | 839 |
| 840 StringView KURL::StringViewForInvalidComponent() const { | 840 StringView KURL::StringViewForInvalidComponent() const { |
| 841 return string_.IsNull() ? StringView() : StringView(StringImpl::empty_); | 841 return string_.IsNull() ? StringView() : StringView(StringImpl::empty_); |
| 842 } | 842 } |
| 843 | 843 |
| 844 StringView KURL::ComponentStringView(const url::Component& component) const { | 844 StringView KURL::ComponentStringView(const url::Component& component) const { |
| 845 if (!is_valid_ || component.len <= 0) | 845 if (!is_valid_ || component.len <= 0) |
| 846 return StringViewForInvalidComponent(); | 846 return StringViewForInvalidComponent(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 875 string_ = AtomicString::FromUTF8(output.data(), output.length()); | 875 string_ = AtomicString::FromUTF8(output.data(), output.length()); |
| 876 InitProtocolMetadata(); | 876 InitProtocolMetadata(); |
| 877 } | 877 } |
| 878 | 878 |
| 879 bool KURL::IsSafeToSendToAnotherThread() const { | 879 bool KURL::IsSafeToSendToAnotherThread() const { |
| 880 return string_.IsSafeToSendToAnotherThread() && | 880 return string_.IsSafeToSendToAnotherThread() && |
| 881 (!inner_url_ || inner_url_->IsSafeToSendToAnotherThread()); | 881 (!inner_url_ || inner_url_->IsSafeToSendToAnotherThread()); |
| 882 } | 882 } |
| 883 | 883 |
| 884 } // namespace blink | 884 } // namespace blink |
| OLD | NEW |