Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Chromium ContentBrowserclient Embedder api IsHandledUrl was not impl… #289

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gnanasekar-somanathan
Copy link

@gnanasekar-somanathan gnanasekar-somanathan commented Sep 2, 2017

Chromium ContentBrowserclient Embedder api IsHandledUrl was not implemented. Add the implementation for the same. This should be in sync with registered protocol handlers.

fix brave/browser-laptop#10644

return false;
// Keep in sync with ProtocolHandlers added by
// AtomBrowserContext::GetURLRequestContext().
static const char* const kProtocolList[] = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should call URLRequestJobFactory::IsHandledProtocol because we have some custom protocols registered in atom::api::Protocol

Copy link
Collaborator

@bridiver bridiver Sep 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it also needs net::URLRequest::IsHandledProtocol(scheme); and can remove the http/ws/ftp protocols. See ProfileIOData::IsHandledProtocol

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@darkdh, the atom_browser_client do not have access to URLRequestJobFactory or browsercontext so we cannot use URLRequestJobFactory::IsHandledProtocol. Thats the reason we need to keep them in sync manually with all protocol handlers added by embedder in AtomBrowserContext::CreateURLRequestJobFactory. I have no knowledge on electron/atom api, i request you to add more protocol in the list if the atom protocol api adds one.

@bridiver, added the change for net::URLRequest::IsHandledProtocol(scheme).
cannot remove the http/ws/ftp because these protocol handlers are added in AtomBrowserContext::CreateURLRequestJobFactory

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gnanasekar-somanathan http/https/ws/wss are included in net::URLRequest::IsHandledProtocol

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also need content::kChromeDevToolsScheme, extensions::kExtensionScheme, url::kAboutScheme and content::kChromeUIScheme

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should mostly match ProfileIOData::IsHandledProtocol, but we don't need the chromeos, android, dom_distiller::kDomDistillerScheme, or chrome::kChromeSearchScheme

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also please move to brave_content_browser_client. atom_browser_client is deprecated and will be merged into brave_content_browser_client

…mented.

This should be in sync with registered protocol handlers.
@gnanasekar-somanathan
Copy link
Author

Addressed all the review comments.

@darkdh
Copy link
Member

darkdh commented Sep 21, 2017

++

@bridiver
Copy link
Collaborator

forgot to merge this for 4.4.26, I'll get it in 4.4.27

extensions::kExtensionScheme,
#endif
content::kChromeUIScheme,
url::kAboutScheme,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this also have url::kDataScheme and url::kBlobScheme?

@bridiver bridiver removed this from the 4.6.0 milestone Jan 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[hackerone] download attribute allows downloading local files
3 participants