New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 895823 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

Move NEL report generation to HttpNetworkTransaction

Project Member Reported by dcreager@chromium.org, Oct 16

Issue description

From Julia's handoff doc:

Right now, we hook HTTP requests at the URLRequest layer, which isn't quite right – we end up with weird results for things like redirects and validated cache responses. Moving that hook into HttpNetworkTransaction would give us more direct access to better data.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 6

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3cb042059e0572d623853fcfa515e6b5e5cf19bc

commit 3cb042059e0572d623853fcfa515e6b5e5cf19bc
Author: Douglas Creager <dcreager@chromium.org>
Date: Tue Nov 06 23:08:52 2018

NEL: Process NEL headers in HTTPNetworkTransaction

Piece by piece, we are moving the Reporting and NEL processing code from
URLRequest and friends into HTTPNetworkTransaction, to make sure that we
produce reports for network requests as defined by the spec (e.g., for
redirects and cached responses).

This patch moves the processing of the NEL configuration header.

Bug: 895823
Change-Id: If4bee0b03f3d6d5868146578551b7362f933a890
Reviewed-on: https://chromium-review.googlesource.com/c/1291231
Reviewed-by: Misha Efimov <mef@chromium.org>
Commit-Queue: Douglas Creager <dcreager@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605866}
[modify] https://crrev.com/3cb042059e0572d623853fcfa515e6b5e5cf19bc/net/BUILD.gn
[modify] https://crrev.com/3cb042059e0572d623853fcfa515e6b5e5cf19bc/net/http/http_network_session.cc
[modify] https://crrev.com/3cb042059e0572d623853fcfa515e6b5e5cf19bc/net/http/http_network_session.h
[modify] https://crrev.com/3cb042059e0572d623853fcfa515e6b5e5cf19bc/net/http/http_network_transaction.cc
[modify] https://crrev.com/3cb042059e0572d623853fcfa515e6b5e5cf19bc/net/http/http_network_transaction.h
[modify] https://crrev.com/3cb042059e0572d623853fcfa515e6b5e5cf19bc/net/http/http_network_transaction_unittest.cc
[modify] https://crrev.com/3cb042059e0572d623853fcfa515e6b5e5cf19bc/net/network_error_logging/network_error_logging_service.cc
[modify] https://crrev.com/3cb042059e0572d623853fcfa515e6b5e5cf19bc/net/network_error_logging/network_error_logging_service.h
[add] https://crrev.com/3cb042059e0572d623853fcfa515e6b5e5cf19bc/net/network_error_logging/network_error_logging_test_util.cc
[add] https://crrev.com/3cb042059e0572d623853fcfa515e6b5e5cf19bc/net/network_error_logging/network_error_logging_test_util.h
[modify] https://crrev.com/3cb042059e0572d623853fcfa515e6b5e5cf19bc/net/spdy/spdy_test_util_common.cc
[modify] https://crrev.com/3cb042059e0572d623853fcfa515e6b5e5cf19bc/net/spdy/spdy_test_util_common.h
[modify] https://crrev.com/3cb042059e0572d623853fcfa515e6b5e5cf19bc/net/url_request/url_request_context_builder.cc
[modify] https://crrev.com/3cb042059e0572d623853fcfa515e6b5e5cf19bc/net/url_request/url_request_http_job.cc
[modify] https://crrev.com/3cb042059e0572d623853fcfa515e6b5e5cf19bc/net/url_request/url_request_http_job.h
[modify] https://crrev.com/3cb042059e0572d623853fcfa515e6b5e5cf19bc/net/url_request/url_request_unittest.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Nov 9

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/134b52eafe64a29308d4258df58418307ac21c51

commit 134b52eafe64a29308d4258df58418307ac21c51
Author: Douglas Creager <dcreager@chromium.org>
Date: Fri Nov 09 18:00:14 2018

Reporting: Process Report-To headers in HTTPNetworkTransaction

Piece by piece, we are moving the Reporting and NEL processing code from
URLRequest and friends into HTTPNetworkTransaction, to make sure that we
produce reports for network requests as defined by the spec (e.g., for
redirects and cached responses).

This patch moves the processing of the Report-To configuration header.

Bug: 895823
Change-Id: Id6f51eefdb9afc43ad3841fb3c3f6d6b39fd2943
Reviewed-on: https://chromium-review.googlesource.com/c/1293555
Commit-Queue: Douglas Creager <dcreager@chromium.org>
Reviewed-by: Misha Efimov <mef@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606896}
[modify] https://crrev.com/134b52eafe64a29308d4258df58418307ac21c51/net/http/http_network_session.cc
[modify] https://crrev.com/134b52eafe64a29308d4258df58418307ac21c51/net/http/http_network_session.h
[modify] https://crrev.com/134b52eafe64a29308d4258df58418307ac21c51/net/http/http_network_transaction.cc
[modify] https://crrev.com/134b52eafe64a29308d4258df58418307ac21c51/net/http/http_network_transaction.h
[modify] https://crrev.com/134b52eafe64a29308d4258df58418307ac21c51/net/http/http_network_transaction_unittest.cc
[modify] https://crrev.com/134b52eafe64a29308d4258df58418307ac21c51/net/reporting/reporting_header_parser.cc
[modify] https://crrev.com/134b52eafe64a29308d4258df58418307ac21c51/net/reporting/reporting_header_parser.h
[modify] https://crrev.com/134b52eafe64a29308d4258df58418307ac21c51/net/reporting/reporting_service.cc
[modify] https://crrev.com/134b52eafe64a29308d4258df58418307ac21c51/net/spdy/spdy_test_util_common.cc
[modify] https://crrev.com/134b52eafe64a29308d4258df58418307ac21c51/net/spdy/spdy_test_util_common.h
[modify] https://crrev.com/134b52eafe64a29308d4258df58418307ac21c51/net/url_request/url_request_context_builder.cc
[modify] https://crrev.com/134b52eafe64a29308d4258df58418307ac21c51/net/url_request/url_request_http_job.cc
[modify] https://crrev.com/134b52eafe64a29308d4258df58418307ac21c51/net/url_request/url_request_http_job.h
[modify] https://crrev.com/134b52eafe64a29308d4258df58418307ac21c51/net/url_request/url_request_unittest.cc

Project Member

Comment 3 by bugdroid1@chromium.org, Nov 9

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ef5eecdcf7b0252322185cdd513d57962afde4d5

commit ef5eecdcf7b0252322185cdd513d57962afde4d5
Author: Douglas Creager <dcreager@chromium.org>
Date: Fri Nov 09 20:50:36 2018

NEL: Generate reports in HTTPNetworkTransaction

Piece by piece, we are moving the Reporting and NEL processing code from
URLRequest and friends into HTTPNetworkTransaction, to make sure that we
produce reports for network requests as defined by the spec.

This patch moves the generation of the actual NEL reports, and includes
some new WPT test cases that verify that we create reports correctly for
redirects and cached responses.

TBR=msramek@chromium.org

Bug: 895823
Change-Id: Ie8e17a2a2b3571a7cdfd39057da486f5ad2c9f6f
Reviewed-on: https://chromium-review.googlesource.com/c/1318169
Commit-Queue: Douglas Creager <dcreager@chromium.org>
Reviewed-by: Misha Efimov <mef@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606958}
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/net/http/http_network_transaction.cc
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/net/http/http_network_transaction.h
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/net/http/http_network_transaction_unittest.cc
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/net/http/http_request_info.cc
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/net/http/http_request_info.h
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/net/network_error_logging/network_error_logging_service.cc
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/net/network_error_logging/network_error_logging_service_unittest.cc
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/net/network_error_logging/network_error_logging_test_util.cc
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/net/reporting/reporting_service.cc
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/net/reporting/reporting_service.h
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/net/reporting/reporting_test_util.cc
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/net/reporting/reporting_test_util.h
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/net/reporting/reporting_uploader.cc
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/net/reporting/reporting_uploader.h
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/net/url_request/url_request.cc
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/net/url_request/url_request.h
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/net/url_request/url_request_http_job.cc
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/net/url_request/url_request_unittest.cc
[add] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/third_party/WebKit/LayoutTests/external/wpt/network-error-logging/no-report-on-unexpired-cached-response.https.html
[add] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/third_party/WebKit/LayoutTests/external/wpt/network-error-logging/sends-report-on-cache-validation.https.html
[add] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/third_party/WebKit/LayoutTests/external/wpt/network-error-logging/sends-report-on-redirect.https.html
[add] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/third_party/WebKit/LayoutTests/external/wpt/network-error-logging/support/cached-for-one-minute.png
[add] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/third_party/WebKit/LayoutTests/external/wpt/network-error-logging/support/cached-for-one-minute.png.sub.headers
[add] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/third_party/WebKit/LayoutTests/external/wpt/network-error-logging/support/cached-with-validation.py
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/third_party/WebKit/LayoutTests/external/wpt/network-error-logging/support/nel.sub.js
[add] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/third_party/WebKit/LayoutTests/external/wpt/network-error-logging/support/redirect.py
[modify] https://crrev.com/ef5eecdcf7b0252322185cdd513d57962afde4d5/third_party/WebKit/LayoutTests/external/wpt/network-error-logging/support/report.py

Cc: mmenke@chromium.org
NEL is sometimes being passed a positive "error code" from HttpNetworkTransaction::DoCallback() which indicates the number of bytes read, not a net error. This results in "unknown" errors being reported because the positive value won't match any net errors, which are all negative.

mmenke@ suggests that HttpNetworkTransaction::DoCallback() may not be the best place to hook into. It also misses cases where the request completes synchronously. We should maybe hook into individual states in HttpNetworkTransaction, or maybe its destructor.

Sign in to add a comment