Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/shared/Utils.cpp

Issue 29351560: Issue 4395 - Setting page is loaded non-populated on some systems
Patch Set: Created Sept. 7, 2016, 7:44 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/shared/Utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/shared/Utils.cpp
===================================================================
--- a/src/shared/Utils.cpp
+++ b/src/shared/Utils.cpp
@@ -21,6 +21,7 @@
#include <Windows.h>
#include <ShlObj.h>
+#include <Shlwapi.h>
#include "Utils.h"
@@ -204,3 +205,24 @@
}
return url.substr(queryStringBeginsAt, endQueryStringPos - queryStringBeginsAt);
}
+
+std::wstring CanonicalizeUrl(const std::wstring& url)
+{
+ std::wstring urlCanonicalized;
+ urlCanonicalized.resize(url.length() * 2);
+ DWORD urlSize = urlCanonicalized.length();
+ UrlCanonicalizeW(url.c_str(), &urlCanonicalized[0], &urlSize, NULL);
sergei 2016/09/07 08:23:31 What about using of 0 instead of NULL for dwFlags
Oleksandr 2016/09/07 09:13:43 Done.
+ urlCanonicalized.resize(urlSize);
+ return urlCanonicalized;
+}
+
+std::wstring EscapeUrl(const std::wstring& url)
+{
+ std::wstring urlEscaped;
+ urlEscaped.resize(url.length() * 2);
+ DWORD urlSize = urlEscaped.length();
+ UrlEscapeW(url.c_str(), &urlEscaped[0], &urlSize, NULL);
+ urlEscaped.resize(urlSize);
+ return urlEscaped;
+}
+
« no previous file with comments | « src/shared/Utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld