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

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

Issue 610493002: adjust blink::equalIgnoringFragmentIdentifier to work better for data: (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add test Created 6 years, 2 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
« no previous file with comments | « no previous file | Source/platform/weborigin/KURLTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 700
701 #ifndef NDEBUG 701 #ifndef NDEBUG
702 void KURL::print() const 702 void KURL::print() const
703 { 703 {
704 printf("%s\n", m_string.utf8().data()); 704 printf("%s\n", m_string.utf8().data());
705 } 705 }
706 #endif 706 #endif
707 707
708 bool equalIgnoringFragmentIdentifier(const KURL& a, const KURL& b) 708 bool equalIgnoringFragmentIdentifier(const KURL& a, const KURL& b)
709 { 709 {
710 if (a.protocolIsData() && b.protocolIsData())
711 return a.m_string == b.m_string;
712
710 // Compute the length of each URL without its ref. Note that the reference 713 // Compute the length of each URL without its ref. Note that the reference
711 // begin (if it exists) points to the character *after* the '#', so we need 714 // begin (if it exists) points to the character *after* the '#', so we need
712 // to subtract one. 715 // to subtract one.
713 int aLength = a.m_string.length(); 716 int aLength = a.m_string.length();
714 if (a.m_parsed.ref.len >= 0) 717 if (a.m_parsed.ref.len >= 0)
715 aLength = a.m_parsed.ref.begin - 1; 718 aLength = a.m_parsed.ref.begin - 1;
716 719
717 int bLength = b.m_string.length(); 720 int bLength = b.m_string.length();
718 if (b.m_parsed.ref.len >= 0) 721 if (b.m_parsed.ref.len >= 0)
719 bLength = b.m_parsed.ref.begin - 1; 722 bLength = b.m_parsed.ref.begin - 1;
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 m_string = AtomicString::fromUTF8(output.data(), output.length()); 916 m_string = AtomicString::fromUTF8(output.data(), output.length());
914 } 917 }
915 918
916 bool KURL::isSafeToSendToAnotherThread() const 919 bool KURL::isSafeToSendToAnotherThread() const
917 { 920 {
918 return m_string.isSafeToSendToAnotherThread() 921 return m_string.isSafeToSendToAnotherThread()
919 && (!m_innerURL || m_innerURL->isSafeToSendToAnotherThread()); 922 && (!m_innerURL || m_innerURL->isSafeToSendToAnotherThread());
920 } 923 }
921 924
922 } // namespace blink 925 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/platform/weborigin/KURLTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698