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

Issue 748728 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 775691
Owner:
Last visit > 30 days ago
Closed: Nov 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug



Sign in to add a comment

GRC: consider more strongly typed coordination unit interfaces

Project Member Reported by dcheng@chromium.org, Jul 25 2017

Issue description

Right now, coordination units are fairly generic property bags partitioned into namespaces. This can make it harder to understand the assumptions around certain properties and what type of base::Value they hold.

It also means that code like https://chromium-review.googlesource.com/c/578482/, which has to traverse all the frame coordination units, has to explicitly typecheck that the kURL property is, in fact, a string--and later that string has to be turned back into a GURL.

If we could just associate a GURL directly, that would at least save the cost of conversion and make the type of the property clear. There's a tradeoff here between tying things too closely to //content, but in practice, we already have an implicit coupling (see the coordination unit types here: https://cs.chromium.org/chromium/src/services/resource_coordinator/public/interfaces/coordination_unit.mojom?rcl=c81ebd0ecc1d3fe0318cf844cfa9d1d546d64eaf&l=14)
 

Comment 1 by nasko@chromium.org, Jul 26 2017

We also avoid cases like this (https://chromium-review.googlesource.com/c/580288/12/chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc) where we need to serialize int64 into a string, just to turn around and parse it back into int64. It leads to using more memory and CPU, something GRC is aiming to decrease.

Comment 2 by l...@chromium.org, Jul 26 2017

Cc: l...@chromium.org
Components: -Speed
Labels: Hotlist-GRC
I have a suggestion (which I brought up in a GRC meeting today and it sounds like people are onboard with): Changing the GRC properties from generic base::Value to int64. Right now the only need for strings is for the URL, and as the use-case for the URL is for UKM, we can just use UkmSourceId instead (like what's already done in nasko's link). It also avoids the security/performance implications of the generic types, and constrains the GRC properties more towards the intended performance metrics use-cases.

erikchen: wdyt? I'm happy to make this change after your CL lands; it shouldn't affect your UKM logging, I believe.
Ah interesting, s.g.
Cc: fmea...@chromium.org ducbui@google.com
Labels: -Pri-2 Pri-1
This is also blocking https://chromium-review.googlesource.com/c/567539/

Comment 6 by dcheng@chromium.org, Jul 27 2017

If int64 is sufficient for everything we plan on using this for, that sounds good to me. Thanks for the quick followup.

Comment 7 by dcheng@chromium.org, Jul 28 2017

Also, I should mention: there's several other components to this bug:
- breaking coordination units out into actual subtypes rather than namespacing them with the coordination unit type enum
- providing typed setters (though this is less important to me if we do limit properties to integer types) and have concrete subtypes
Project Member

Comment 8 by bugdroid1@chromium.org, Aug 7 2017

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

commit f768b8dab842bdde2485d0c65c070ddbf9dff3ae
Author: Oystein Eftevaag <oysteine@chromium.org>
Date: Mon Aug 07 21:42:00 2017

GRC: Change properties to int64 rather than base::Value

Int64 covers all known use-cases, and has less potential security/performance implications.

Bug:  748728 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: I61e43f4e10ab3cea8d1e0b3e6700bf0feaf60f19
Reviewed-on: https://chromium-review.googlesource.com/596270
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Steven Holte <holte@chromium.org>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Reviewed-by: Zhen Wang <zhenw@chromium.org>
Commit-Queue: Oystein Eftevaag <oysteine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#492422}
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/chrome/browser/metrics/process_memory_metrics_emitter.cc
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/chrome/browser/metrics/process_memory_metrics_emitter.h
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/chrome/browser/metrics/process_memory_metrics_emitter_browsertest.cc
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/chrome/browser/metrics/process_memory_metrics_emitter_unittest.cc
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/chrome/browser/resource_coordinator/resource_coordinator_render_process_probe.cc
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/content/browser/frame_host/render_frame_host_impl.cc
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/coordination_unit/coordination_unit_graph_observer.h
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/coordination_unit/coordination_unit_graph_observer_unittest.cc
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/coordination_unit/coordination_unit_impl.cc
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/coordination_unit/coordination_unit_impl.h
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest.cc
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/coordination_unit/coordination_unit_introspector_impl.cc
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.cc
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/coordination_unit/metrics_collector.cc
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/coordination_unit/metrics_collector.h
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/coordination_unit/metrics_collector_unittest.cc
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/coordination_unit/process_coordination_unit_impl.cc
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/coordination_unit/process_coordination_unit_impl.h
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/coordination_unit/tab_signal_generator_impl.cc
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/coordination_unit/tab_signal_generator_impl.h
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.cc
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.h
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl_unittest.cc
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/public/cpp/resource_coordinator_interface.cc
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/public/cpp/resource_coordinator_interface.h
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/public/interfaces/coordination_unit.mojom
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/services/resource_coordinator/public/interfaces/coordination_unit_introspector.mojom
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/third_party/WebKit/Source/platform/instrumentation/resource_coordinator/FrameResourceCoordinator.cpp
[modify] https://crrev.com/f768b8dab842bdde2485d0c65c070ddbf9dff3ae/third_party/WebKit/Source/platform/instrumentation/resource_coordinator/FrameResourceCoordinator.h

Comment 9 by l...@chromium.org, Nov 7 2017

Cc: -l...@chromium.org
Mergedinto: 775691
Owner: l...@chromium.org
Status: Duplicate (was: Available)
Merging this bug to the current tracking bug for strongly-typing effort.

Sign in to add a comment