Add preliminary support for POST requests in the NavigationURLLoaderNetworkService class

Desktop / Chromium - ananta [chromium.org] - 20 April 2017 20:01 EDT

While at it, I found that pages on jsfiddle were not rendering fully. Turned out to be issues with some of the fields in the ResourceRequest not being set. These include fields like request_initiator, referrer, policy, the headers, etc. I used ResourceDispatcherHostImpl as a reference and basically mimiced/copied the code to set these fields. With these fields being set jsfiddle rendered correctly.

The next set of changes is to support POST. For that we need to set the request body and use the method name in CommonNavigationParams() instead of hardcoding it to "GET". I also moved the helper functions used to set blob handles to chrome_blob_storage_context.h/.cc

The POST functionality is handled by a new class NavigationPostDataHandler whose lifetime is dependent on the NavigationURLLoaderNetworkService class. This class is created and destroyed on the UI thread and the rest of the functionality is invoked on the IO thread.

BUG=598073

Review-Url: https://codereview.chromium.org/2835523002 Cr-Commit-Position: refs/heads/master@{#466193}

5149d8e Add preliminary support for POST requests in the NavigationURLLoaderNetworkService class.
.../blob_storage/chrome_blob_storage_context.cc | 31 +++++++++
.../blob_storage/chrome_blob_storage_context.h | 12 ++++
.../navigation_url_loader_network_service.cc | 80 +++++++++++++++++++---
.../loader/navigation_url_loader_network_service.h | 7 ++
.../loader/resource_dispatcher_host_impl.cc | 34 +--------
5 files changed, 125 insertions(+), 39 deletions(-)

Upstream: git.chromium.org


  • Share