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

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

Issue 874393006: Clear username and password from location.href when basic HTTP (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add LayoutTests. Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/weborigin/KURL.h ('k') | no next file » | 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 if (m_parsed.username.is_nonempty() || m_parsed.password.is_nonempty() || m_ parsed.ref.is_nonempty()) { 136 if (m_parsed.username.is_nonempty() || m_parsed.password.is_nonempty() || m_ parsed.ref.is_nonempty()) {
137 KURL referrer(*this); 137 KURL referrer(*this);
138 referrer.setUser(String()); 138 referrer.setUser(String());
139 referrer.setPass(String()); 139 referrer.setPass(String());
140 referrer.removeFragmentIdentifier(); 140 referrer.removeFragmentIdentifier();
141 return referrer.string(); 141 return referrer.string();
142 } 142 }
143 return string(); 143 return string();
144 } 144 }
145 145
146 String KURL::strippedForUseAsHref() const
147 {
148 if (m_parsed.username.is_nonempty() || m_parsed.password.is_nonempty()) {
149 KURL href(*this);
150 href.setUser(String());
151 href.setPass(String());
152 return href.string();
153 }
154 return string();
155 }
156
146 bool KURL::isLocalFile() const 157 bool KURL::isLocalFile() const
147 { 158 {
148 // Including feed here might be a bad idea since drag and drop uses this che ck 159 // Including feed here might be a bad idea since drag and drop uses this che ck
149 // and including feed would allow feeds to potentially let someone's blog 160 // and including feed would allow feeds to potentially let someone's blog
150 // read the contents of the clipboard on a drag, even without a drop. 161 // read the contents of the clipboard on a drag, even without a drop.
151 // Likewise with using the FrameLoader::shouldTreatURLAsLocal() function. 162 // Likewise with using the FrameLoader::shouldTreatURLAsLocal() function.
152 return protocolIs("file"); 163 return protocolIs("file");
153 } 164 }
154 165
155 bool protocolIsJavaScript(const String& url) 166 bool protocolIsJavaScript(const String& url)
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 m_string = AtomicString::fromUTF8(output.data(), output.length()); 896 m_string = AtomicString::fromUTF8(output.data(), output.length());
886 } 897 }
887 898
888 bool KURL::isSafeToSendToAnotherThread() const 899 bool KURL::isSafeToSendToAnotherThread() const
889 { 900 {
890 return m_string.isSafeToSendToAnotherThread() 901 return m_string.isSafeToSendToAnotherThread()
891 && (!m_innerURL || m_innerURL->isSafeToSendToAnotherThread()); 902 && (!m_innerURL || m_innerURL->isSafeToSendToAnotherThread());
892 } 903 }
893 904
894 } // namespace blink 905 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/weborigin/KURL.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698