Add NetworkService support for chrome and chrome-devtools schemes (see issue #2622).

Known behavior changes:
- Unsupported chrome hosts no longer redirect to chrome://version.

To test: All tests pass with NetworkService disabled. WebUITest.* and V8Test.*
tests pass with NetworkService enabled.
This commit is contained in:
Marshall Greenblatt
2019-04-30 16:45:13 -04:00
parent 9fd6c8a1ee
commit 370cc028cb
11 changed files with 460 additions and 331 deletions

View File

@ -23,15 +23,16 @@ namespace content {
class BrowserURLHandler;
}
namespace url {
class Origin;
}
class CefURLRequestManager;
namespace scheme {
extern const char kChromeURL[];
// Register the chrome scheme handler.
void RegisterChromeHandler(CefURLRequestManager* request_manager);
// Register the WebUI controller factory.
void RegisterWebUIControllerFactory();
@ -41,6 +42,9 @@ void BrowserURLHandlerCreated(content::BrowserURLHandler* handler);
// Used to fire any asynchronous content updates.
void DidFinishChromeLoad(CefRefPtr<CefFrame> frame, const GURL& validated_url);
// Returns true if WebUI is allowed to make network requests.
bool IsWebUIAllowedToMakeNetworkRequests(const url::Origin& origin);
// Create a new ProtocolHandler that will filter the URLs passed to the default
// "chrome" protocol handler and forward the rest to CEF's handler.
std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>