New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 690091 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature



Sign in to add a comment

Making GURL::inner_url() works with blob URL.

Project Member Reported by arthurso...@chromium.org, Feb 8 2017

Issue description

* GURL::inner_url() doesn't handle blob-url (only filesystem-url currently)
* KURL::innerUrl() does the job.

Does someone knows if there is something that prevent us to make it works?
Tomorrow, I will have to implement it for checking CSP on the browser-side.

 
Cc: nick@chromium.org alex...@chromium.org
I don't know if there are any historical reasons for why blob isn't handled in inner_url, but I would strongly support fixing this.  There are a couple of places where we had to use url::Origin when we wanted to uniformly handle filesystem: and blob: URLs (e.g., [1][2]), which is sad and would be nice to clean up.  Skimming the call sites of GURL::inner_url(), seems like all of them already check that the GURL scheme is filesystem: when using it, so it doesn't seem like this would be breaking anything.

[1] ChromeContentBrowserClientExtensionsPart::ShouldAllowOpenURL, https://cs.chromium.org/chromium/src/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc?l=550
[2] ExtensionNavigationThrottle::WillStartRequest, https://cs.chromium.org/chromium/src/extensions/browser/extension_navigation_throttle.cc?l=53
Owner: arthurso...@chromium.org
Status: Started (was: Available)
Blocking: -685074
Labels: -Proj-PlzNavigate-Blocking
Status: Available (was: Started)
I said something wrong: KURL::innerUrl() doesn't work with blob-url.
But static SecurityOrigin::extractInnerURL(KURL) does the job though.
Sorry if I confuse someone.

```
KURL SecurityOrigin::extractInnerURL(const KURL& url) {
  if (url.innerURL())
    return *url.innerURL();
  // FIXME: Update this callsite to use the innerURL member function when
  // we finish implementing it.
  return KURL(ParsedURLString, url.path());
}

```
I will probably use the same trick for the moment and come back later.

If we want to make GURL::inner_url working with blob-url, we will have to make something similar to 
void DoParseFileSystemURL(const CHAR* spec, int spec_len, Parsed* parsed) in url/third_party/mozzilla/url_parse.cc

Comment 4 by mkwst@chromium.org, Feb 9 2017

The historical reasons are basically that the person who implemented the inner URL functionality was working on `filesystem:` and didn't know/care about `blob:`. :)

We should indeed fill this gap.
#3: url::Origin handles blob URLs by using GURL::GetContent (https://cs.chromium.org/chromium/src/url/origin.cc?l=50), which is essentially everything after the scheme, so you could just use that, right?
Yes probably, but it might be slightly different, I don't know.

For instance if url = GURL("filesystem:http://example.com/path?query#ref) then
url.inner_url()->query() == "";
url.inner_url()->ref() == "";
url.inner_url()->path() == "/path%3Fquery%23ref"
which is not what you can expect if GURL::inner_url = function() { return GURL(GetContent()); }

Maybe blob-url are special, at least as much as filesystem-url?

N.B.#1 In your example, it is okay since only the scheme/host/port are used and not the path.
N.B.#2 For the moment, I will use a translation of SecurityOrigin::extractInnerURL for GURL, but GURL::GetContent would work too I think.
Project Member

Comment 7 by sheriffbot@chromium.org, Feb 12 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Archived (was: Untriaged)
I am archiving the bug because it is unlikely someone to be still interested in making GURL::inner_url() working with blob URL.

Sign in to add a comment