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

Side by Side Diff: third_party/WebKit/WebCore/page/Location.cpp

Issue 27342: Make KURLGoogle match webkit's query string parsing.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 9 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 | « no previous file | third_party/WebKit/WebCore/platform/KURLGoogle.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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 const KURL& url = this->url(); 116 const KURL& url = this->url();
117 return url.path().isEmpty() ? "/" : url.path(); 117 return url.path().isEmpty() ? "/" : url.path();
118 } 118 }
119 119
120 String Location::search() const 120 String Location::search() const
121 { 121 {
122 if (!m_frame) 122 if (!m_frame)
123 return String(); 123 return String();
124 124
125 const KURL& url = this->url(); 125 const KURL& url = this->url();
126 return url.query(); 126 return url.query().isEmpty() ? "" : "?" + url.query();
127 } 127 }
128 128
129 String Location::hash() const 129 String Location::hash() const
130 { 130 {
131 if (!m_frame) 131 if (!m_frame)
132 return String(); 132 return String();
133 133
134 const KURL& url = this->url(); 134 const KURL& url = this->url();
135 return url.ref().isEmpty() ? "" : "#" + url.ref(); 135 return url.ref().isEmpty() ? "" : "#" + url.ref();
136 } 136 }
137 137
138 String Location::toString() const 138 String Location::toString() const
139 { 139 {
140 if (!m_frame) 140 if (!m_frame)
141 return String(); 141 return String();
142 142
143 const KURL& url = this->url(); 143 const KURL& url = this->url();
144 return url.hasPath() ? url.prettyURL() : url.prettyURL() + "/"; 144 return url.hasPath() ? url.prettyURL() : url.prettyURL() + "/";
145 } 145 }
146 146
147 } // namespace WebCore 147 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/WebCore/platform/KURLGoogle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698