summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-03-21 13:30:16 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-05-03 16:01:58 +0200
commit45c6628c136d135bac4f48d554a39e2bae061718 (patch)
tree32c66f480ffca4c62a66d6003f9c2107b070db25
parent4af928308f6a3bdbd161b476fd7aeb4d8e678bd7 (diff)
downloadqtwebengine-chromium-45c6628c136d135bac4f48d554a39e2bae061718.tar.gz
Fix assert on QRC urls
Treat qrc origins like file origins to work-around GURL being terrible at handling non-http urls. Change-Id: Ic41a620fb2616c0272c104e707a188b75f10ac0b Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
-rw-r--r--chromium/url/origin.cc6
-rw-r--r--chromium/url/url_constants.cc2
-rw-r--r--chromium/url/url_constants.h2
3 files changed, 10 insertions, 0 deletions
diff --git a/chromium/url/origin.cc b/chromium/url/origin.cc
index 53600b1dc96..99ec6a315ed 100644
--- a/chromium/url/origin.cc
+++ b/chromium/url/origin.cc
@@ -127,6 +127,9 @@ std::string Origin::Serialize() const {
if (scheme() == kFileScheme)
return "file://";
+ if (scheme() == kQrcScheme)
+ return "qrc://";
+
if (!suborigin_.empty()) {
GURL url_with_suborigin = AddSuboriginToUrl(tuple_.GetURL(), suborigin_);
return SchemeHostPort(url_with_suborigin).Serialize();
@@ -149,6 +152,9 @@ GURL Origin::GetURL() const {
if (scheme() == kFileScheme)
return GURL("file:///");
+ if (scheme() == kQrcScheme)
+ return GURL("qrc:///");
+
GURL tuple_url(tuple_.GetURL());
if (!suborigin_.empty())
diff --git a/chromium/url/url_constants.cc b/chromium/url/url_constants.cc
index 37fc82c1c45..76d4911dd94 100644
--- a/chromium/url/url_constants.cc
+++ b/chromium/url/url_constants.cc
@@ -27,6 +27,8 @@ const char kMailToScheme[] = "mailto";
const char kWsScheme[] = "ws";
const char kWssScheme[] = "wss";
+const char kQrcScheme[] = "qrc";
+
const char kHttpSuboriginScheme[] = "http-so";
const char kHttpsSuboriginScheme[] = "https-so";
diff --git a/chromium/url/url_constants.h b/chromium/url/url_constants.h
index 7e5cb53face..75f5e9c152e 100644
--- a/chromium/url/url_constants.h
+++ b/chromium/url/url_constants.h
@@ -33,6 +33,8 @@ URL_EXPORT extern const char kMailToScheme[];
URL_EXPORT extern const char kWsScheme[];
URL_EXPORT extern const char kWssScheme[];
+URL_EXPORT extern const char kQrcScheme[];
+
// Special HTTP and HTTPS schemes for serialization of suborigins. See
// https://w3c.github.io/webappsec-suborigins/.
URL_EXPORT extern const char kHttpSuboriginScheme[];