Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(527)

Issue 2695923010: Add Network.setSendRequestIdHeader and use it in headless (Closed)

Created:
3 years, 10 months ago by alex clarke (OOO till 29th)
Modified:
3 years, 9 months ago
Reviewers:
dgozman, jam, Sami, pfeldman
CC:
chromium-reviews, caseq+blink_chromium.org, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, apavlov+blink_chromium.org, devtools-reviews_chromium.org, blink-reviews, kozyatinskiy+blink_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add Network.setSendRequestIdHeader and use it in headless This lets us correlate fetches seen by a UrlRequest handler with DevTools network domain events. BUG=546953 Review-Url: https://codereview.chromium.org/2695923010 Cr-Commit-Position: refs/heads/master@{#453945} Committed: https://chromium.googlesource.com/chromium/src/+/3aa690e2c0e98d3274c8e988b85f28cf304c0320

Patch Set 1 #

Patch Set 2 : Fix linker issue #

Patch Set 3 : Add the header unconditionally #

Total comments: 14

Patch Set 4 : Changes for Sami #

Total comments: 2

Patch Set 5 : remove unwanted file #

Patch Set 6 : Fix test #

Patch Set 7 : Fix the layout test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+339 lines, -10 lines) Patch
M chrome/browser/devtools/devtools_network_transaction.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/devtools/devtools_network_transaction.cc View 1 2 3 2 chunks +6 lines, -1 line 0 comments Download
M headless/BUILD.gn View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M headless/public/util/deterministic_http_protocol_handler.cc View 2 chunks +3 lines, -0 lines 0 comments Download
M headless/public/util/generic_url_request_job.h View 2 chunks +21 lines, -3 lines 0 comments Download
M headless/public/util/generic_url_request_job.cc View 1 2 3 6 chunks +55 lines, -3 lines 0 comments Download
A headless/public/util/protocol_handler_request_id_browsertest.cc View 1 2 3 1 chunk +218 lines, -0 lines 0 comments Download
M headless/public/util/testing/generic_url_request_mocks.h View 1 chunk +3 lines, -0 lines 0 comments Download
M headless/public/util/testing/generic_url_request_mocks.cc View 3 chunks +3 lines, -0 lines 0 comments Download
M headless/test/headless_browser_test.h View 1 chunk +4 lines, -0 lines 0 comments Download
M headless/test/headless_browser_test.cc View 2 chunks +8 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/loader/fetch/FetchUtils.cpp View 1 2 3 4 5 6 1 chunk +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/loader/fetch/RawResource.cpp View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/loader/fetch/RawResourceTest.cpp View 1 2 3 4 5 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/network/HTTPNames.json5 View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 58 (42 generated)
alex clarke (OOO till 29th)
PTAL
3 years, 10 months ago (2017-02-16 17:28:46 UTC) #2
alex clarke (OOO till 29th)
PTAL. I've changed the header to be added unconditionally.
3 years, 9 months ago (2017-02-27 12:33:40 UTC) #21
Sami
Thanks. So if I understood right, the extra header lives from when DevTools inserts it ...
3 years, 9 months ago (2017-02-27 12:39:07 UTC) #22
alex clarke (OOO till 29th)
https://codereview.chromium.org/2695923010/diff/40001/chrome/browser/devtools/devtools_network_transaction.cc File chrome/browser/devtools/devtools_network_transaction.cc (right): https://codereview.chromium.org/2695923010/diff/40001/chrome/browser/devtools/devtools_network_transaction.cc#newcode25 chrome/browser/devtools/devtools_network_transaction.cc:25: // Keep in sync with X_DevTools_Requestt_Id defined in HTTPNames.json5. ...
3 years, 9 months ago (2017-02-27 13:51:16 UTC) #23
pfeldman
devtools lgtm
3 years, 9 months ago (2017-02-27 17:30:17 UTC) #24
pfeldman
https://codereview.chromium.org/2695923010/diff/60001/content/browser/devtools/devtools_url_request_interceptor.h File content/browser/devtools/devtools_url_request_interceptor.h (right): https://codereview.chromium.org/2695923010/diff/60001/content/browser/devtools/devtools_url_request_interceptor.h#newcode13 content/browser/devtools/devtools_url_request_interceptor.h:13: class DevtoolsUrlRequestInterceptor : public net::URLRequestInterceptor { nuke this one.
3 years, 9 months ago (2017-02-27 17:30:22 UTC) #25
alex clarke (OOO till 29th)
Sami, PTAL https://codereview.chromium.org/2695923010/diff/60001/content/browser/devtools/devtools_url_request_interceptor.h File content/browser/devtools/devtools_url_request_interceptor.h (right): https://codereview.chromium.org/2695923010/diff/60001/content/browser/devtools/devtools_url_request_interceptor.h#newcode13 content/browser/devtools/devtools_url_request_interceptor.h:13: class DevtoolsUrlRequestInterceptor : public net::URLRequestInterceptor { On ...
3 years, 9 months ago (2017-02-27 22:20:27 UTC) #26
Sami
lgtm, thanks!
3 years, 9 months ago (2017-02-28 13:40:49 UTC) #31
alex clarke (OOO till 29th)
Made a few changes to fix tests. PTAL.
3 years, 9 months ago (2017-03-01 13:23:36 UTC) #42
Sami
Still lgtm.
3 years, 9 months ago (2017-03-01 14:50:15 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2695923010/120001
3 years, 9 months ago (2017-03-01 16:09:26 UTC) #48
commit-bot: I haz the power
Committed patchset #7 (id:120001) as https://chromium.googlesource.com/chromium/src/+/3aa690e2c0e98d3274c8e988b85f28cf304c0320
3 years, 9 months ago (2017-03-01 16:14:45 UTC) #51
jam
This broke with PlzNavigate (see my earlier change in https://codereview.chromium.org/2720543002/ to get it to pass). ...
3 years, 9 months ago (2017-03-03 19:38:46 UTC) #55
dgozman
On 2017/03/03 19:38:46, jam wrote: > This broke with PlzNavigate (see my earlier change in ...
3 years, 9 months ago (2017-03-03 19:54:36 UTC) #56
jam
On 2017/03/03 19:54:36, dgozman wrote: > On 2017/03/03 19:38:46, jam wrote: > > This broke ...
3 years, 9 months ago (2017-03-03 20:36:08 UTC) #57
alex clarke (OOO till 29th)
3 years, 9 months ago (2017-03-07 12:53:26 UTC) #58
Message was sent while issue was closed.
On 2017/03/03 20:36:08, jam wrote:
> On 2017/03/03 19:54:36, dgozman wrote:
> > On 2017/03/03 19:38:46, jam wrote:
> > > This broke with PlzNavigate (see my earlier change in
> > > https://codereview.chromium.org/2720543002/ to get it to pass). I'll add
> this
> > to
> > > the CQ so that it's easier to catch in the future.
> > > 
> > > In the meantime, I spent some time trying to figure out how to solve this.
> In
> > > navigation_request.cc's AddAdditionalRequestHeaders, we could add code to
> add
> > > the new header. The problem is that the request identifier would have to
be
> > > generated in the browser since we don't have a renderer yet, and we'd need
> to
> > > send this to the renderer so that it can replace the generated one there.
> > WDYT?
> > 
> > Sounds like the only possible solution, unless we actually notify about the
> > navigation request from the browser (but that has more problems with
redirects
> > and initiators).
> 
> Alex/Sami: can someone from headless team take care of this?

This seems quite a complex problem :)  I'll see what we can do.  One idea we had
is to move the generation of the RequestWillBeSent and ResponseReceived events
over to the browser, letting us use a consistent browser generated frame ID. I'm
not entirely sure how feasible that is but it feels like it might dovetail with
the idea of adding devtools protocol command and events to allow programmatic
blocking & rewriting of network fetches and responses.

Powered by Google App Engine
This is Rietveld 408576698