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

Issue 745774 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Feature



Sign in to add a comment

Need to link ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial from third_party/webrtc_overrides

Project Member Reported by ilnik@chromium.org, Jul 18 2017

Issue description

To use Synthetic field trials inside webrtc they need a forwarding in third_party/webrtc_overrides (which is a part of chromium repository).

The problem is that it's inside monolithic build target //chrome/browser:browser.

If I try to add it to deps in third_party/webrtc_overrides I get the following error:

ERROR at //skia/BUILD.gn:674:5: Assertion failed.
    assert(false, "Need to port cpu specific stuff from skia_library_opts.gyp")
    ^-----
Need to port cpu specific stuff from skia_library_opts.gyp
See //ppapi/BUILD.gn:383:5: which caused the file to be included.
    "//skia",
    ^-------
ninja: error: rebuilding 'build.ninja': subcommand failed

Adding only "//chrome/browser/metrics/chrome_metrics_service_accessor.cc" to sources doesn't work either, as there are some weird include errors with protobuf:

In file included from ../../chrome/browser/metrics/chrome_metrics_service_accessor.cc:5:
In file included from ../../chrome/browser/metrics/chrome_metrics_service_accessor.h:14:
In file included from ../../chrome/browser/metrics/metrics_reporting_state.h:9:
In file included from ../../components/metrics/metrics_service_client.h:18:
gen/components/metrics/proto/system_profile.pb.h:9:10: fatal error: 'google/protobuf/stubs/common.h' file not found

Any ideas, how can it be done?

 

Comment 1 by ilnik@chromium.org, Jul 19 2017

Cc: rkaplow@chromium.org
+rkaplow, who is knowledgeable in chrome build infrastructure? Could you refer to someone who could help here?

Comment 2 by ilnik@chromium.org, Jul 24 2017

Owner: rkaplow@chromium.org

Comment 3 by ilnik@chromium.org, Jul 24 2017

Labels: -Pri-3 Pri-2
Components: Internals>Metrics
Owner: asvitk...@chromium.org
I'm not really use how to use core browser stuff within third_party. alexei might know more than me on this.
not really sure*
Generally, these sorts of things are done by having WebRTC have a Delegate interface whose implementation lives in chrome/. Then, WebRTC uses the functionality through the Delegate and the concrete implementation of that delegate inside chrome/ routes to the stuff in chrome/.

Comment 7 by ilnik@chromium.org, Jul 25 2017

Re #4.

I am trying to compile that delegate. It is, however located in third_party/webrtc_overrides (which is a part of the chromium repository).

Do you think there will be no such problems if I create another layer of abstraction in chrome/?

Turns out, this particular assert can be solved by providing target_cpu variable in "gn args". However, there are more asserts surfacing after that (like https://cs.chromium.org/chromium/src/v8/snapshot_toolchain.gni?q=v8/snapshot_toolchain.gni:97&sq=package:chromium&l=97 )

I am missing some kind of configuration in third_party/webrtc_overrides/BUILD.gn or in gn args.

Comment 8 by ilnik@webrtc.org, Jul 26 2017

Re #6, Alexei, do you have any examples of such delegates? I tried to create a new target in chrome/BUILD.gn, but I really have troubles including only required things to the deps there. If I include browser as a dependency, everything brokes in the same way.

It might work, If I had defined a global function in //chrome/browser/metrics/chrome_metrics_service_accessor.c what will call the static method in question. Then declaring it as extern in webrtc_overrides we might hope that linker will resolve while linking chrome.

But it will be a terrible hack making a global function just to call a static method.

Do you know of any way to make a forward declaration of a class with a static method?

Comment 9 by ilnik@webrtc.org, Jul 26 2017

Also, RegisterSyntheticFieldTrial is private! Why? How am I even supposed to use it once I manage to resolve all crazy dependencies?

Comment 10 by ilnik@webrtc.org, Jul 26 2017

Ok, I see the instruction to add a friend declaration in the class.

Comment 11 by ilnik@webrtc.org, Jul 26 2017

Somehow, I've managed to make it all compile. I was missing third_party/protobuf:protobuf_light dependency.
The CL is up.

Comment 12 by ilnik@chromium.org, Jul 26 2017

Status: Fixed (was: Available)
For the record, can you link to the fixing changelist?

Sign in to add a comment