Changeset 87623 in webkit
- Timestamp:
- May 28, 2011 12:59:16 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r87622 r87623 1 2011-05-28 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Alexey Proskuryakov. 4 5 Audit all uses of KURL::prettyURL 6 https://bugs.webkit.org/show_bug.cgi?id=61201 7 8 As far as I can tell, all the callers of this API are confused. There 9 seems to be a cargo cult of using the "pretty" version of a URL, but in 10 reality folks just want the URL itself. The only case I'm unsure about 11 is location.href, which could have some compatibility constraints. 12 I've renamed prettyURL to deprecatedString to discourage folks from 13 further cargo-culting. 14 15 * WebCore.exp.in: 16 * page/Location.cpp: 17 (WebCore::Location::href): 18 (WebCore::Location::toString): 19 * platform/KURL.cpp: 20 (WebCore::KURL::deprecatedString): 21 * platform/KURL.h: 22 * platform/KURLGoogle.cpp: 23 (WebCore::KURL::deprecatedString): 24 * platform/network/soup/ResourceHandleSoup.cpp: 25 (WebCore::ResourceHandle::prepareForURL): 26 * workers/WorkerLocation.cpp: 27 (WebCore::WorkerLocation::href): 28 (WebCore::WorkerLocation::toString): 29 1 30 2011-05-28 Jer Noble <jer.noble@apple.com> 2 31 -
trunk/Source/WebCore/WebCore.exp.in
r87566 r87623 1615 1615 __ZNK7WebCore14SecurityOrigin9canAccessEPKS0_ 1616 1616 __ZNK7WebCore4KURL7hasPathEv 1617 __ZNK7WebCore4KURL9prettyURLEv1618 1617 #endif 1619 1618 -
trunk/Source/WebCore/page/Location.cpp
r86330 r87623 67 67 68 68 const KURL& url = this->url(); 69 return url.hasPath() ? url.prettyURL() : url.prettyURL() + "/"; 69 // FIXME: Stop using deprecatedString(): https://bugs.webkit.org/show_bug.cgi?id=30225 70 return url.hasPath() ? url.deprecatedString() : url.deprecatedString() + "/"; 70 71 } 71 72 … … 156 157 157 158 const KURL& url = this->url(); 158 return url.hasPath() ? url.prettyURL() : url.prettyURL() + "/"; 159 // FIXME: Stop using deprecatedString(): https://bugs.webkit.org/show_bug.cgi?id=30225 160 return url.hasPath() ? url.deprecatedString() : url.deprecatedString() + "/"; 159 161 } 160 162 -
trunk/Source/WebCore/platform/KURL.cpp
r85056 r87623 877 877 } 878 878 879 String KURL:: prettyURL() const879 String KURL::deprecatedString() const 880 880 { 881 881 if (!m_isValid) -
trunk/Source/WebCore/platform/KURL.h
r87312 r87623 151 151 String baseAsString() const; 152 152 153 String prettyURL() const; 153 // This function is only used by location.href. It's likely we shouldn't 154 // use it for that purpose, but more study is necessary before we remove it. 155 String deprecatedString() const; 154 156 String fileSystemPath() const; 155 157 -
trunk/Source/WebCore/platform/KURLGoogle.cpp
r85056 r87623 773 773 // file: URLs instead of file:///foo/bar. We don't bother with any of this, 774 774 // at least for now. 775 String KURL:: prettyURL() const775 String KURL::deprecatedString() const 776 776 { 777 777 if (!m_url.m_isValid) -
trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
r86064 r87623 181 181 } 182 182 183 void ResourceHandle::prepareForURL(const KURL &url)184 { 185 GOwnPtr<SoupURI> soupURI(soup_uri_new(url. prettyURL().utf8().data()));183 void ResourceHandle::prepareForURL(const KURL& url) 184 { 185 GOwnPtr<SoupURI> soupURI(soup_uri_new(url.string().utf8().data())); 186 186 if (!soupURI) 187 187 return; -
trunk/Source/WebCore/workers/WorkerLocation.cpp
r86330 r87623 37 37 String WorkerLocation::href() const 38 38 { 39 return m_url.hasPath() ? m_url.prettyURL() : m_url.prettyURL() + "/"; 39 // FIXME: Stop using deprecatedString(): https://bugs.webkit.org/show_bug.cgi?id=30225 40 return m_url.hasPath() ? m_url.deprecatedString() : m_url.deprecatedString() + "/"; 40 41 } 41 42 … … 77 78 String WorkerLocation::toString() const 78 79 { 79 return m_url.hasPath() ? m_url.prettyURL() : m_url.prettyURL() + "/"; 80 // FIXME: Stop using deprecatedString(): https://bugs.webkit.org/show_bug.cgi?id=30225 81 return m_url.hasPath() ? m_url.deprecatedString() : m_url.deprecatedString() + "/"; 80 82 } 81 83 -
trunk/Source/WebKit/efl/ChangeLog
r86584 r87623 1 2011-05-28 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Alexey Proskuryakov. 4 5 Audit all uses of KURL::prettyURL 6 https://bugs.webkit.org/show_bug.cgi?id=61201 7 8 Update callers of prettyURL to just call string. 9 10 * WebCoreSupport/ChromeClientEfl.cpp: 11 (WebCore::ChromeClientEfl::mouseDidMoveOverElement): 12 * WebCoreSupport/FrameLoaderClientEfl.cpp: 13 (WebCore::FrameLoaderClientEfl::dispatchWillSendRequest): 14 (WebCore::FrameLoaderClientEfl::assignIdentifierToInitialRequest): 15 (WebCore::FrameLoaderClientEfl::dispatchDecidePolicyForNavigationAction): 16 (WebCore::FrameLoaderClientEfl::download): 17 (WebCore::FrameLoaderClientEfl::cancelledError): 18 (WebCore::FrameLoaderClientEfl::blockedError): 19 * ewk/ewk_frame.cpp: 20 (ewk_frame_hit_test_new): 21 (ewk_frame_uri_changed): 22 * ewk/ewk_view.cpp: 23 (_ewk_view_priv_new): 24 (ewk_view_frame_create): 25 (ewk_view_plugin_create): 26 1 27 2011-05-16 Jon Lee <jonlee@apple.com> 2 28 -
trunk/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
r85581 r87623 361 361 const char* link[2]; 362 362 TextDirection dir; 363 CString urlStr = url. prettyURL().utf8();363 CString urlStr = url.string().utf8(); 364 364 CString titleStr = hit.title(dir).utf8(); 365 365 link[0] = urlStr.data(); -
trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
r85785 r87623 210 210 void FrameLoaderClientEfl::dispatchWillSendRequest(DocumentLoader* loader, unsigned long identifier, ResourceRequest& coreRequest, const ResourceResponse& coreResponse) 211 211 { 212 CString url = coreRequest.url(). prettyURL().utf8();212 CString url = coreRequest.url().string().utf8(); 213 213 DBG("Resource url=%s", url.data()); 214 214 … … 237 237 void FrameLoaderClientEfl::assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest& coreRequest) 238 238 { 239 CString url = coreRequest.url(). prettyURL().utf8();239 CString url = coreRequest.url().string().utf8(); 240 240 DBG("Resource url=%s", url.data()); 241 241 … … 310 310 // if not acceptNavigationRequest - look at Qt -> PolicyIgnore; 311 311 // FIXME: do proper check and only reset forms when on PolicyIgnore 312 char* url = strdup(resourceRequest.url(). prettyURL().utf8().data());312 char* url = strdup(resourceRequest.url().string().utf8().data()); 313 313 Ewk_Frame_Resource_Request request = { url, 0 }; 314 314 Eina_Bool ret = ewk_view_navigation_policy_decision(m_view, &request); … … 765 765 return; 766 766 767 CString url = request.url(). prettyURL().utf8();767 CString url = request.url().string().utf8(); 768 768 Ewk_Download download; 769 769 … … 785 785 ResourceError FrameLoaderClientEfl::cancelledError(const ResourceRequest& request) 786 786 { 787 ResourceError error("Error", -999, request.url(). prettyURL(),787 ResourceError error("Error", -999, request.url().string(), 788 788 "Request cancelled"); 789 789 error.setIsCancellation(true); … … 793 793 ResourceError FrameLoaderClientEfl::blockedError(const ResourceRequest& request) 794 794 { 795 return ResourceError("Error", WebKitErrorCannotUseRestrictedPort, request.url(). prettyURL(),795 return ResourceError("Error", WebKitErrorCannotUseRestrictedPort, request.url().string(), 796 796 "Request blocked"); 797 797 } -
trunk/Source/WebKit/efl/ewk/ewk_frame.cpp
r80771 r87623 1163 1163 1164 1164 hit_test->link.text = eina_stringshare_add(result.textContent().utf8().data()); 1165 hit_test->link.url = eina_stringshare_add(result.absoluteLinkURL(). prettyURL().utf8().data());1165 hit_test->link.url = eina_stringshare_add(result.absoluteLinkURL().string().utf8().data()); 1166 1166 hit_test->link.title = eina_stringshare_add(result.titleDisplayString().utf8().data()); 1167 1167 hit_test->link.target_frame = kit(result.targetFrame()); … … 2015 2015 EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); 2016 2016 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 2017 WTF::CString uri(sd->frame->document()->url(). prettyURL().utf8());2017 WTF::CString uri(sd->frame->document()->url().string().utf8()); 2018 2018 2019 2019 INF("uri=%s", uri.data()); -
trunk/Source/WebKit/efl/ewk/ewk_view.cpp
r86421 r87623 578 578 579 579 url = priv->page_settings->userStyleSheetLocation(); 580 priv->settings.user_stylesheet = eina_stringshare_add(url. prettyURL().utf8().data());580 priv->settings.user_stylesheet = eina_stringshare_add(url.string().utf8().data()); 581 581 582 582 priv->settings.encoding_default = eina_stringshare_add … … 4038 4038 DBG("o=%p, frame=%p, name=%s, ownerElement=%p, url=%s, referrer=%s", 4039 4039 o, frame, name.utf8().data(), ownerElement, 4040 url. prettyURL().utf8().data(), referrer.utf8().data());4040 url.string().utf8().data(), referrer.utf8().data()); 4041 4041 4042 4042 EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0); … … 4070 4070 DBG("o=%p, frame=%p, size=%dx%d, element=%p, url=%s, mimeType=%s", 4071 4071 o, frame, pluginSize.width(), pluginSize.height(), element, 4072 url. prettyURL().utf8().data(), mimeType.utf8().data());4072 url.string().utf8().data(), mimeType.utf8().data()); 4073 4073 4074 4074 EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0); -
trunk/Source/WebKit/gtk/ChangeLog
r87433 r87623 1 2011-05-28 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Alexey Proskuryakov. 4 5 Audit all uses of KURL::prettyURL 6 https://bugs.webkit.org/show_bug.cgi?id=61201 7 8 Update callers of prettyURL to just call string. 9 10 * WebCoreSupport/ChromeClientGtk.cpp: 11 (WebKit::ChromeClient::mouseDidMoveOverElement): 12 * WebCoreSupport/FrameLoaderClientGtk.cpp: 13 (WebKit::FrameLoaderClient::dispatchDidChangeLocationWithinPage): 14 (WebKit::FrameLoaderClient::dispatchDidCommitLoad): 15 * webkit/webkitwebview.cpp: 16 (webkit_web_view_get_icon_uri): 17 1 18 2011-05-26 Gustavo Noronha Silva <gustavo.noronha@collabora.com> 2 19 -
trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
r86627 r87623 542 542 TextDirection dir; 543 543 CString titleString = hit.title(dir).utf8(); 544 CString urlString = url. prettyURL().utf8();544 CString urlString = url.string().utf8(); 545 545 g_signal_emit_by_name(m_webView, "hovering-over-link", titleString.data(), urlString.data()); 546 546 m_hoveredLinkURL = url; -
trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
r87433 r87623 896 896 WebKitWebFramePrivate* priv = m_frame->priv; 897 897 g_free(priv->uri); 898 priv->uri = g_strdup(core(m_frame)->document()->url(). prettyURL().utf8().data());898 priv->uri = g_strdup(core(m_frame)->document()->url().string().utf8().data()); 899 899 g_object_notify(G_OBJECT(m_frame), "uri"); 900 900 WebKitWebView* webView = getViewFromFrame(m_frame); … … 987 987 WebKitWebFramePrivate* priv = m_frame->priv; 988 988 g_free(priv->uri); 989 priv->uri = g_strdup(core(m_frame)->loader()->activeDocumentLoader()->url(). prettyURL().utf8().data());989 priv->uri = g_strdup(core(m_frame)->loader()->activeDocumentLoader()->url().string().utf8().data()); 990 990 g_free(priv->title); 991 991 priv->title = NULL; -
trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp
r86118 r87623 4979 4979 { 4980 4980 g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0); 4981 String iconURL = iconDatabase().synchronousIconURLForPageURL(core(webView)->mainFrame()->document()->url(). prettyURL());4981 String iconURL = iconDatabase().synchronousIconURLForPageURL(core(webView)->mainFrame()->document()->url().string()); 4982 4982 webView->priv->iconURI = iconURL.utf8(); 4983 4983 return webView->priv->iconURI.data(); -
trunk/Source/WebKit/qt/ChangeLog
r87514 r87623 1 2011-05-28 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Alexey Proskuryakov. 4 5 Audit all uses of KURL::prettyURL 6 https://bugs.webkit.org/show_bug.cgi?id=61201 7 8 Update callers of prettyURL to just call string. 9 10 * WebCoreSupport/ChromeClientQt.cpp: 11 (WebCore::ChromeClientQt::mouseDidMoveOverElement): 12 * WebCoreSupport/FrameLoaderClientQt.cpp: 13 (WebCore::FrameLoaderClientQt::updateGlobalHistory): 14 (WebCore::FrameLoaderClientQt::cancelledError): 15 (WebCore::FrameLoaderClientQt::blockedError): 16 (WebCore::FrameLoaderClientQt::objectContentType): 17 (WebCore::FrameLoaderClientQt::createPlugin): 18 1 19 2011-05-27 Alexis Menard <alexis.menard@openbossa.org> 2 20 -
trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
r86949 r87623 507 507 lastHoverTitle = result.title(dir); 508 508 lastHoverContent = result.textContent(); 509 emit m_webPage->linkHovered(lastHoverURL. prettyURL(),509 emit m_webPage->linkHovered(lastHoverURL.string(), 510 510 lastHoverTitle, lastHoverContent); 511 511 } -
trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
r87315 r87623 803 803 WebCore::DocumentLoader* loader = m_frame->loader()->documentLoader(); 804 804 if (history) 805 history->addHistoryEntry(loader->urlForHistory(). prettyURL());805 history->addHistoryEntry(loader->urlForHistory().string()); 806 806 807 807 if (dumpHistoryCallbacks) { … … 927 927 WebCore::ResourceError FrameLoaderClientQt::cancelledError(const WebCore::ResourceRequest& request) 928 928 { 929 ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url(). prettyURL(),929 ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url().string(), 930 930 QCoreApplication::translate("QWebFrame", "Request cancelled", 0, QCoreApplication::UnicodeUTF8)); 931 931 error.setIsCancellation(true); … … 947 947 WebCore::ResourceError FrameLoaderClientQt::blockedError(const WebCore::ResourceRequest& request) 948 948 { 949 return ResourceError("WebKitErrorDomain", WebKitErrorCannotUseRestrictedPort, request.url(). prettyURL(),949 return ResourceError("WebKitErrorDomain", WebKitErrorCannotUseRestrictedPort, request.url().string(), 950 950 QCoreApplication::translate("QWebFrame", "Request blocked", 0, QCoreApplication::UnicodeUTF8)); 951 951 } … … 1361 1361 ObjectContentType FrameLoaderClientQt::objectContentType(const KURL& url, const String& mimeTypeIn, bool shouldPreferPlugInsForImages) 1362 1362 { 1363 // qDebug()<<" ++++++++++++++++ url is "<<url. prettyURL()<<", mime = "<<mimeTypeIn;1363 // qDebug()<<" ++++++++++++++++ url is "<<url.string()<<", mime = "<<mimeTypeIn; 1364 1364 QFileInfo fi(url.path()); 1365 1365 String extension = fi.suffix(); … … 1524 1524 const Vector<String>& paramValues, const String& mimeType, bool loadManually) 1525 1525 { 1526 // qDebug()<<"------ Creating plugin in FrameLoaderClientQt::createPlugin for "<<url. prettyURL() << mimeType;1527 // qDebug()<<"------\t url = "<<url. prettyURL();1526 // qDebug()<<"------ Creating plugin in FrameLoaderClientQt::createPlugin for "<<url.string() << mimeType; 1527 // qDebug()<<"------\t url = "<<url.string(); 1528 1528 1529 1529 if (!m_webFrame) -
trunk/Source/WebKit2/ChangeLog
r87599 r87623 1 2011-05-28 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Alexey Proskuryakov. 4 5 Audit all uses of KURL::prettyURL 6 https://bugs.webkit.org/show_bug.cgi?id=61201 7 8 Update callers of prettyURL to just call string. 9 10 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 11 (WebKit::WebFrameLoaderClient::createPlugin): 12 * WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp: 13 (WebKit::cancelledError): 14 (WebKit::blockedError): 15 1 16 2011-05-27 Stephanie Lewis <slewis@apple.com> 2 17 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r86516 r87623 1199 1199 } 1200 1200 1201 static String documentURL(Frame* frame)1202 {1203 const KURL& url = frame->document()->url();1204 return url.hasPath() ? url.prettyURL() : url.prettyURL() + "/";1205 }1206 1207 1201 PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize&, HTMLPlugInElement* pluginElement, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually) 1208 1202 { … … 1218 1212 parameters.mimeType = mimeType; 1219 1213 parameters.loadManually = loadManually; 1220 parameters.documentURL = documentURL(m_frame->coreFrame());1214 parameters.documentURL = m_frame->coreFrame()->document()->url().string(); 1221 1215 1222 1216 Frame* mainFrame = webPage->mainFrame()->coreFrame(); … … 1225 1219 else if (m_frame->coreFrame()->document()->securityOrigin()->canAccess(mainFrame->document()->securityOrigin())) { 1226 1220 // We only want to set the toplevel document URL if the plug-in has access to it. 1227 parameters.toplevelDocumentURL = documentURL(mainFrame);1221 parameters.toplevelDocumentURL = mainFrame->document()->url().string(); 1228 1222 } 1229 1223 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp
r76916 r87623 52 52 ResourceError cancelledError(const ResourceRequest& request) 53 53 { 54 ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url(). prettyURL(),54 ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url().string(), 55 55 QCoreApplication::translate("QWebFrame", "Request cancelled", 0, QCoreApplication::UnicodeUTF8)); 56 56 error.setIsCancellation(true); … … 60 60 ResourceError blockedError(const ResourceRequest& request) 61 61 { 62 return ResourceError("WebKit", WebKitErrorCannotUseRestrictedPort, request.url(). prettyURL(),62 return ResourceError("WebKit", WebKitErrorCannotUseRestrictedPort, request.url().string(), 63 63 QCoreApplication::translate("QWebFrame", "Request blocked", 0, QCoreApplication::UnicodeUTF8)); 64 64 }
Note: See TracChangeset
for help on using the changeset viewer.