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

Issue 838949 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 26
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 1
Type: Bug

Blocking:
issue 598073
issue 837333
issue 848871



Sign in to add a comment

Need to migrate kEnableNetBenchmarking (enable-net-benchmarking) to network service

Project Member Reported by xunji...@chromium.org, May 2 2018

Issue description

I am doing an audit of URLRequestContextGetter's users as a part of  Issue 837333 , and noticed this enable-net-benchmarking flag. 

Is it still being used? 

https://cs.chromium.org/chromium/src/chrome/browser/chrome_content_browser_client.cc?rcl=31e590f90804160b9e90575452006a3ded7e3bcb&l=3217

  if (NetBenchmarking::CheckBenchmarkingEnabled()) {
    Profile* profile =
        Profile::FromBrowserContext(render_process_host->GetBrowserContext());
    net::URLRequestContextGetter* context =
        render_process_host->GetStoragePartition()->GetURLRequestContext();
    registry->AddInterface(base::Bind(&NetBenchmarking::Create, profile,
                                      base::RetainedRef(context)));
  }
 
Cc: nedngu...@google.com
+nednguyen@: Ned, do you know if this benchmark flag is still being used? I see some bots have this flag set, but not sure if anyone is actively depending on this feature. 
Blocking: 837333
Telemetry uses it on all benchmark: https://cs.chromium.org/chromium/src/third_party/catapult/telemetry/telemetry/internal/backends/chrome/chrome_startup_args.py?rcl=86d3e79d8882670b4111b71eadf41072f98be34b&l=39

I am not sure what this is for? (probably was added way before I joined the team)
Cc: -nedngu...@google.com nednguyen@chromium.org
Ok. I will send out an email to chromium-dev@ to ask.
Status: Available (was: Untriaged)
Summary: Need to migrate kEnableNetBenchmarking (enable-net-benchmarking) to network service (was: Is kEnableNetBenchmarking (enable-net-benchmarking) still being used?)
davidben@ dug up the initial commit and crbug. 

https://codereview.chromium.org/119191
https://bugs.chromium.org/p/chromium/issues/detail?id=6754

This is used to inject chrome.benchmarking APIs to clear various caches and close connections. 

https://cs.chromium.org/chromium/src/tools/chrome_proxy/webdriver/common.py?q=chrome%5C.benchmarking&sq=package:chromium&l=381&dr=C
https://cs.chromium.org/chromium/src/third_party/catapult/telemetry/telemetry/internal/browser/web_contents.py?q=chrome%5C.benchmarking&sq=package:chromium&l=312&dr=C

We will need to migrate this to using Network Service's APIs.
Blocking: 598073
Helen, we may be able to deprecate the chrome.benchmarking APIs as another solution. I don't think they are heavily used.
Re#8: Can we deprecate chrome.benchmarking? My understanding is that Telemetry benchmark stories need to clear various caches between runs.
#8 we also use chrome.benchmarking API for simulate gesture in Telemetry. I think it's good to deprecate this but the effort gonna take multiple quarters
#10 I just meant the net benchmarking hooks. It looks like --enable-net-benchmarking just gives 4 methods:
1. Clear cache
2. Clear host resolver cache
3. Clear predictor cache
4. Close connections

These are implemented in https://cs.chromium.org/chromium/src/chrome/browser/net_benchmarking.h
Cc: alexilin@chromium.org
Oops just noticed that telemetry depends on some of these methods.

Just FYI that the clearPredictorCache method:
1. Kinda unsafely stores a Profile* on the IO thread and post tasks to the UI thread to deref it. Could it cause use after free?

2. alexilin is migrating predictor to a different service, so that method needs to change semantics and clear a different DB.

Comment 13 by dxie@chromium.org, May 15 2018

Labels: -Pri-3 Proj-Servicification-Canary OS-All Pri-1

Comment 14 by dxie@chromium.org, May 18 2018

Labels: -OS-All OS-Windows OS-Linux OS-Mac OS-Chrome OS-Android
Project Member

Comment 15 by bugdroid1@chromium.org, Jun 6 2018

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

commit 4909ec849b19c4a89caa4413e3e7cb9de9a8fab2
Author: Alexandr Ilin <alexilin@chromium.org>
Date: Wed Jun 06 10:22:48 2018

predictors: Update the NetBenchmarking to clear the LoadingPredictor DB

NetBenchmarking provides a method to clear network predictor cache. The
predictor is migrating to a different service, so this method should
clear a different DB.

This CL also removes unsafe storing a Profile* on the IO thread. The
NetBenchmarking stores weak pointers to predictors instead.

Bug:  838949 ,  623967 
Change-Id: Ie73d57555237aea4ebb7be1a324151e5ea190b68
Reviewed-on: https://chromium-review.googlesource.com/1085450
Commit-Queue: Alexandr Ilin <alexilin@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/master@{#564846}
[modify] https://crrev.com/4909ec849b19c4a89caa4413e3e7cb9de9a8fab2/chrome/browser/chrome_content_browser_client.cc
[modify] https://crrev.com/4909ec849b19c4a89caa4413e3e7cb9de9a8fab2/chrome/browser/net/predictor.h
[modify] https://crrev.com/4909ec849b19c4a89caa4413e3e7cb9de9a8fab2/chrome/browser/net_benchmarking.cc
[modify] https://crrev.com/4909ec849b19c4a89caa4413e3e7cb9de9a8fab2/chrome/browser/net_benchmarking.h
[modify] https://crrev.com/4909ec849b19c4a89caa4413e3e7cb9de9a8fab2/chrome/browser/predictors/resource_prefetch_predictor.cc
[modify] https://crrev.com/4909ec849b19c4a89caa4413e3e7cb9de9a8fab2/chrome/browser/predictors/resource_prefetch_predictor.h
[modify] https://crrev.com/4909ec849b19c4a89caa4413e3e7cb9de9a8fab2/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc

Comment 16 by dxie@chromium.org, Jun 7 2018

Labels: -Proj-Servicification-Canary Proj-Servicification

Comment 17 by dxie@chromium.org, Jun 12 2018

Labels: Hotlist-KnownIssue
Blocking: 848871

Comment 19 by dxie@google.com, Jun 25 2018

Labels: Proj-Servicification-Canary
Owner: cmumford@chromium.org
Status: Started (was: Available)
Cc: cmumford@chromium.org
Owner: rmcelrath@chromium.org
Status: Fixed (was: Started)
I think this is fixed by rmcelrath@ in https://chromium-review.googlesource.com/c/chromium/src/+/1135715

Sign in to add a comment