Setting build args to false will not always disable certain feature

279 views
Skip to first unread message

Muralitharan Perumal

unread,
Jun 18, 2024, 1:28:20 PMJun 18
to Chromium-dev
Hi,

I have been trying to reduce the chrome binary image size by disabling certain features using build args as the first step. The current stripped chrome size is 167MB (ARM), but aiming to bring it down under 100 MB and not sure if that is possible.

When I do this 'enable_media_remoting = false', I expect it to work but it fails for undefined symbol:

ld.lld: error: undefined symbol: CastRemotingConnector::Get(content::WebContents*)
>>> referenced by media_router_desktop.cc


when checking the source, it's not under any compilation flag.

void MediaRouterDesktop::CreateRoute(const MediaSource::Id& source_id,
                                     const MediaSink::Id& sink_id,
                                     const url::Origin& origin,
                                     content::WebContents* web_contents,
                                     MediaRouteResponseCallback callback,
                                     base::TimeDelta timeout) {
 . 
 .
 .
  const MediaSource source(source_id);
  if (source.IsTabMirroringSource()) {
    // Ensure the CastRemotingConnector is created before mirroring starts.
    CastRemotingConnector* const connector =
        CastRemotingConnector::Get(web_contents);

    connector->ResetRemotingPermission();

    MediaRouterMojoMetrics::RecordTabMirroringMetrics(web_contents);
  }

If this is required by default, why do we need to have a build arg to enable/disable this feature?

Any thoughts?

Thanks,
-M

Jeremy Roman

unread,
Jun 18, 2024, 2:00:37 PMJun 18
to muralit...@gmail.com, Chromium-dev
Not all combinations of build flags are supported, unfortunately.

I don't work on the relevant code, but it's likely that it's used to disable code that is not used on platforms where media remoting isn't supported (which appears to be iOS and Cast devices). On the other hand, if there is no desktop platform where Chromium ships without media remoting support, it's possible that desktop-only code doesn't examine the build flag.

You'd have to ask the relevant OWNERS whether they would accept patches to guard the desktop code in some way, but it might be involved and it might not continue to work if the CI does not test such a configuration. In general, code in chrome/ is built with the intent of supporting the Chrome product, so flexibility that doesn't benefit Chrome often isn't a priority.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/6f747f56-003d-4033-afa1-5849dbc14658n%40chromium.org.
Reply all
Reply to author
Forward
0 new messages