WRT should use protocol for app:// scheme or widget:// scheme.
So we added the new alternativeURL variable to resourceRequestBase class to support app:// and widget:// protocol loading.
Also the changed data:// protocol from file:// protocol is supported.
[Title] Support loading for app:// and widget:// scheme.
[Issue#] N/A
[Problem] The app:// , widget:// protocol is not supported.
[Cause] app:// , widget:// scheme is not supported protocol in webkit.
[Solution] Add the new alternativeURL variable to resourceRequestBase class and if the original url is app:// scheme then replace it to file:// or data:// scheme before request.
[SCMRequest] N/A
Change-Id: I0adf59337a17be36cb65e8ffad13642659fce48a
if (url.isEmpty())
url = responseURL();
#if ENABLE(TIZEN_WRT_APP_URI_SCHEME)
- if (equalIgnoringCase(originalRequest().url().protocol(), "app")) {
- if (equalIgnoringCase(url.protocol(), "file") || equalIgnoringCase(url.protocol(), "data"))
- url = originalRequest().url();
- }
+ if (isChangedURLProtocolForWebAppOrigin(originalRequest().url(), url))
+ url = originalRequest().url();
#endif
if (url.isEmpty())
url = blankURL();
return url;
}
+#if ENABLE(TIZEN_WRT_APP_URI_SCHEME)
+bool DocumentLoader::isChangedURLProtocolForWebAppOrigin(const KURL& originalUrl, const KURL& url) const
+{
+ if (equalIgnoringCase(originalUrl.protocol(), "app") || equalIgnoringCase(originalUrl.protocol(), "widget")) {
+ if (equalIgnoringCase(url.protocol(), "file") || equalIgnoringCase(url.protocol(), "data"))
+ return true;
+ }
+ else if (equalIgnoringCase(originalUrl.protocol(), "file") && equalIgnoringCase(url.protocol(), "data"))
+ return true;
+
+ return false;
+}
+#endif
+
const String& DocumentLoader::responseMIMEType() const
{
return m_response.mimeType();
// The URL of the document resulting from this DocumentLoader.
KURL documentURL() const;
+#if ENABLE(TIZEN_WRT_APP_URI_SCHEME)
+ bool isChangedURLProtocolForWebAppOrigin(const KURL& originalUrl, const KURL& url) const;
+#endif
const KURL& originalURL() const;
const KURL& requestURL() const;
// So we need to have the backup original request url and restore after willSendRequestForFrame().
KURL originalUrl = request.url();
webPage->injectedBundleResourceLoadClient().willSendRequestForFrame(webPage, m_frame, identifier, request, redirectResponse);
- if (equalIgnoringCase(originalUrl.protocol(), "app")) {
- if (equalIgnoringCase(request.url().protocol(), "file") || equalIgnoringCase(request.url().protocol(), "data")) {
- request.setAlternativeURL(request.url());
- request.setURL(originalUrl);
- }
- else
- ASSERT_NOT_REACHED();
+ if (m_frame->coreFrame()->loader()->documentLoader()->isChangedURLProtocolForWebAppOrigin(originalUrl, request.url())) {
+ request.setAlternativeURL(request.url());
+ request.setURL(originalUrl);
}
#else
webPage->injectedBundleResourceLoadClient().willSendRequestForFrame(webPage, m_frame, identifier, request, redirectResponse);