Add NetworkService support for extensions and downloads (see issue #2622).

To test:
- All tests pass with NetworkService disabled. DownloadTest.*, ExtensionTest.*
  and PluginTest.* tests pass with NetworkService enabled.
- The PDF extension displays a file, and the download and print buttons work.
This commit is contained in:
Marshall Greenblatt
2019-05-01 15:09:59 -04:00
parent 0193a3fe54
commit 5ce52bd775
10 changed files with 181 additions and 37 deletions

View File

@@ -191,6 +191,7 @@ void CefExtensionSystem::Init() {
// 3. A page requests a resource with the "application/pdf" mime type. For
// example, by loading a PDF file.
// 4. CefResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream
// or PluginResponseInterceptorURLLoaderThrottle (NetworkService)
// intercepts the PDF resource load in the browser process, generates a
// unique View ID that is associated with the resource request for later
// retrieval via MimeHandlerStreamManager and the
@@ -212,8 +213,10 @@ void CefExtensionSystem::Init() {
// 8. Access to PDF extension resources is checked by
// CefExtensionsBrowserClient::AllowCrossRendererResourceLoad.
// 9. PDF extension resources are provided from bundle via
// CefExtensionsBrowserClient::MaybeCreateResourceBundleRequestJob and
// CefComponentExtensionResourceManager.
// CefExtensionsBrowserClient::MaybeCreateResourceBundleRequestJob or
// CefExtensionsBrowserClient::LoadResourceFromResourceBundle,
// CefContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories
// (NetworkService) and CefComponentExtensionResourceManager.
// 10.The PDF extension (chrome/browser/resources/pdf/browser_api.js) calls
// chrome.mimeHandlerPrivate.getStreamInfo to retrieve the PDF resource
// stream. This API is implemented using Mojo as described in