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

Issue 607741 link

Starred by 4 users

Issue metadata

Status: WontFix
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature
Proj-Servicification

Blocking:
issue 598073



Sign in to add a comment

Removing dependency of content/browser/loader on content/browser/devtools/devtools_netlog_observer.h

Project Member Reported by scottmg@chromium.org, Apr 28 2016

Issue description

Hi all, (this is my fake "Network Service" mailing list for now!)

Now that we've got some DEPS entries added to c/b/loader/DEPS, I thought I'd try
looking at actually decoupling something. This is a bit long, partly I'm hoping
to have a discussion on how we should approach things in general.

I picked content/browser/devtools/devtools_netlog_observer.h arbitrarily as it
was used in a couple places, but not used everywhere. It's got direct calls from
a couple files:

https://code.google.com/p/chromium/codesearch#chromium/src/content/browser/loader/sync_resource_handler.cc&q=DevToolsNetLogObserver&sq=package:chromium&type=cs&l=54
https://code.google.com/p/chromium/codesearch#chromium/src/content/browser/loader/async_resource_handler.cc&l=304

DevToolsNetLogObserver::PopulateResponseInfo() sets a field in
ResourceResponseInfo (which will live itself in the network service eventually
[1]).

My naive understanding of this class is that it's responsible for mirroring
entries that net/ adds to NetLog back into ResourceResponseInfo in the
devtools_info field (for content/child devtools code to inspect later). This
data at the moment includes the status code, the request/response headers and
the request/response text.

Adding the "obvious" delegate interface would be one way. I think it'd have to
synchronously call from network->content to provide the netlog data, and then
synchronously again have content attach the data to the request. That seems
pretty heavy.

One alternative would be to move all of it into network and always attach that
information. I assume that's either expensive or undesirable for other reasons
(leaking something to renderers that shouldn't have it?). So maybe the delegate
should just be something like "bool ShouldIncludeExtraInformationForDevTools()"
(with a better name) but the actual information that's recorded is determined by
the network. So that would mean moving
content/public/common/resource_devtools_info.h and
content/browser/devtools/devtools_netlog_observer.(cc|h) to network (probably
renaming them), and then we have to have a translation of that data from the
network side to the content side when the renderer is accessing it. (This is
true of all of ResourceReponseInfo I guess though.)

Anyone get all that? These refactorings seem like they'll be a lot more work to
figure out and explain than they will be to actually do! Any thoughts?

(I may not be making a lot of sense here as I'm not knowledgable about this code
at all... I might just need to stare at it and try some things to understand
better tactics.)

[1] https://docs.google.com/spreadsheets/d/1ot0WOgC2TrMY5VADo2ijmx98Z792FojUKJncG5u3QRo/edit#gid=0

 

Comment 1 by jam@chromium.org, Apr 29 2016

Blocking: 598073
Cc: caseq@chromium.org
+caseq who added this in https://codereview.chromium.org/3133016

re always doing this: there are security concerns in sending the raw data (i.e. cookies when making CORS requests i think). however the flag is set by the calling process, and so we can do that check in services/network.  then we can move that method and resource_devtools_info to content/browser/loader (and later services/network). this is based on my reading of the code now, so if anyone has concerns please speak up as you probably know it more than me :)
Project Member

Comment 2 by bugdroid1@chromium.org, May 6 2016

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

commit 9d5bd76ba2a4ed19919a0f6b78e27b86ae64c9ee
Author: scottmg <scottmg@chromium.org>
Date: Fri May 06 00:05:11 2016

Move DevToolsNetLogObserver to content/browser/loader

Doesn't move resource_devtools_info.h yet, but I think we'll
want to do that.

R=jam@chromium.org
BUG=598073, 607741 

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

[modify] https://crrev.com/9d5bd76ba2a4ed19919a0f6b78e27b86ae64c9ee/content/browser/devtools/devtools_manager.cc
[delete] https://crrev.com/75c6ee446bfee7026eddea82481bace58c529ea1/content/browser/devtools/devtools_netlog_observer.h
[modify] https://crrev.com/9d5bd76ba2a4ed19919a0f6b78e27b86ae64c9ee/content/browser/loader/DEPS
[modify] https://crrev.com/9d5bd76ba2a4ed19919a0f6b78e27b86ae64c9ee/content/browser/loader/async_resource_handler.cc
[modify] https://crrev.com/9d5bd76ba2a4ed19919a0f6b78e27b86ae64c9ee/content/browser/loader/navigation_resource_handler.cc
[rename] https://crrev.com/9d5bd76ba2a4ed19919a0f6b78e27b86ae64c9ee/content/browser/loader/netlog_observer.cc
[add] https://crrev.com/9d5bd76ba2a4ed19919a0f6b78e27b86ae64c9ee/content/browser/loader/netlog_observer.h
[modify] https://crrev.com/9d5bd76ba2a4ed19919a0f6b78e27b86ae64c9ee/content/browser/loader/sync_resource_handler.cc
[modify] https://crrev.com/9d5bd76ba2a4ed19919a0f6b78e27b86ae64c9ee/content/content_browser.gypi

Comment 3 by yzshen@chromium.org, May 24 2017

Components: Internals>Network>Service

Comment 4 by jam@chromium.org, Jun 22 2017

Status: WontFix (was: Assigned)
Since we changed approaches for the network service, this isn't needed anymore.

Comment 5 by laforge@google.com, Nov 7 2017

Components: -Internals>Network>Service Internals>Services>Network
Apologies, applied the wrong component in bulk.

Sign in to add a comment