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

Commit

Permalink
Implement GetInitatorSchemeBypassingDocumentBlocking to avoid CORB
Browse files Browse the repository at this point in the history
checking on extensions from CrossSiteDocumentResourceHandler::ShouldBlockBasedOnHeaders

fix brave/browser-laptop#14841

Auditors: @bridiver, @bbondy
  • Loading branch information
darkdh committed Aug 29, 2018
1 parent b3b9488 commit 2f4d786
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions brave/browser/brave_content_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,21 @@ bool BraveContentBrowserClient::ShouldUseSpareRenderProcessHost(
#endif
}

const char*
BraveContentBrowserClient::GetInitatorSchemeBypassingDocumentBlocking() {
#if BUILDFLAG(ENABLE_EXTENSIONS)
// Don't block responses for extension processes or for content scripts.
// TODO(creis): When every extension fetch (including content scripts) has
// been made to go through an extension-specific URLLoaderFactory, this
// mechanism ought to work by enumerating the host permissions from the
// extension manifest, and forwarding them on to the network service while
// brokering the URLLoaderFactory.
return extensions::kExtensionScheme;
#else
return nullptr;
#endif
}

void BraveContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem(
std::vector<std::string>* additional_allowed_schemes) {
AtomBrowserClient::GetAdditionalAllowedSchemesForFileSystem(
Expand Down
1 change: 1 addition & 0 deletions brave/browser/brave_content_browser_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class BraveContentBrowserClient : public atom::AtomBrowserClient {
content::BrowserContext* browser_context,
const GURL& url) override;

const char* GetInitatorSchemeBypassingDocumentBlocking() override;
void GetAdditionalAllowedSchemesForFileSystem(
std::vector<std::string>* additional_allowed_schemes) override;
void GetAdditionalWebUISchemes(
Expand Down

0 comments on commit 2f4d786

Please sign in to comment.