Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Side by Side Diff: third_party/WebKit/Source/platform/weborigin/KURL.cpp

Issue 2655853003: Replace StringImpl::empty{16Bit}() with a static member (Closed)
Patch Set: annotate race Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 829
830 // JavaScript URLs are "valid" and should be executed even if KURL decides 830 // JavaScript URLs are "valid" and should be executed even if KURL decides
831 // they are invalid. The free function protocolIsJavaScript() should be used 831 // they are invalid. The free function protocolIsJavaScript() should be used
832 // instead. 832 // instead.
833 // FIXME: Chromium code needs to be fixed for this assert to be enabled. 833 // FIXME: Chromium code needs to be fixed for this assert to be enabled.
834 // ASSERT(strcmp(protocol, "javascript")); 834 // ASSERT(strcmp(protocol, "javascript"));
835 return m_protocol == protocol; 835 return m_protocol == protocol;
836 } 836 }
837 837
838 StringView KURL::stringViewForInvalidComponent() const { 838 StringView KURL::stringViewForInvalidComponent() const {
839 return m_string.isNull() ? StringView() : StringView(StringImpl::empty()); 839 return m_string.isNull() ? StringView() : StringView(StringImpl::empty);
840 } 840 }
841 841
842 StringView KURL::componentStringView(const url::Component& component) const { 842 StringView KURL::componentStringView(const url::Component& component) const {
843 if (!m_isValid || component.len <= 0) 843 if (!m_isValid || component.len <= 0)
844 return stringViewForInvalidComponent(); 844 return stringViewForInvalidComponent();
845 // begin and len are in terms of bytes which do not match 845 // begin and len are in terms of bytes which do not match
846 // if string() is UTF-16 and input contains non-ASCII characters. 846 // if string() is UTF-16 and input contains non-ASCII characters.
847 // However, the only part in urlString that can contain non-ASCII 847 // However, the only part in urlString that can contain non-ASCII
848 // characters is 'ref' at the end of the string. In that case, 848 // characters is 'ref' at the end of the string. In that case,
849 // begin will always match the actual value and len (in terms of 849 // begin will always match the actual value and len (in terms of
(...skipping 23 matching lines...) Expand all
873 m_string = AtomicString::fromUTF8(output.data(), output.length()); 873 m_string = AtomicString::fromUTF8(output.data(), output.length());
874 initProtocolMetadata(); 874 initProtocolMetadata();
875 } 875 }
876 876
877 bool KURL::isSafeToSendToAnotherThread() const { 877 bool KURL::isSafeToSendToAnotherThread() const {
878 return m_string.isSafeToSendToAnotherThread() && 878 return m_string.isSafeToSendToAnotherThread() &&
879 (!m_innerURL || m_innerURL->isSafeToSendToAnotherThread()); 879 (!m_innerURL || m_innerURL->isSafeToSendToAnotherThread());
880 } 880 }
881 881
882 } // namespace blink 882 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutWordBreak.cpp ('k') | third_party/WebKit/Source/wtf/ThreadingPthreads.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698