Make FileIOClient::Status an enum class, fixing -Wshadow warning

Recent Clang versions have started including enumerators in -Wshadow warnings:

[44590/58815] CXX obj/content/utility/utility/utility_service_factory.o
In file included from ../../content/utility/
In file included from ../../media/mojo/services/mojo_cdm_helper.h:20:
In file included from ../../media/mojo/services/mojo_cdm_file_io.h:19:
../../media/cdm/api/content_decryption_module.h:670:28: warning: declaration
shadows a variable in namespace 'cdm' [-Wshadow]
  enum Status : uint32_t { kSuccess = 0, kInUse, kError };
../../media/cdm/api/content_decryption_module.h:80:3: note: previous
declaration is here
  kSuccess = 0,

This patch fixes the warning by making FileIOClient::Status an enum class,
which means kSuccess needs to be referenced as Status::kSuccess. A few files in
Chromium needs an update when this rolls in.

Bug: chromium:895475
Change-Id: I8003c1494cb76b412b2990d4372e83442141c699
Reviewed-by: Xiaohan Wang <>
1 file changed
tree: 20c67d2e531ef97eb9715560ff092991d1cf7692
  3. codereview.settings
  4. content_decryption_module.h
  5. content_decryption_module_export.h
  6. content_decryption_module_ext.h
  7. content_decryption_module_proxy.h

Library CDM Interface

This directory contains files that define the shared library interface between an Encrypted Media Extensions (EME) Content Decryption Module (CDM) and Chromium or other user agents. It is used to build both user agents and CDMs.

This is also referred to as the “CDM interface” in the context of library CDM and in this doc.

TODO(xhwang): Add more sections describing the CDM interface.

Experimental and Stable CDM interface

A new CDM interface that‘s still under development is subject to change. This is called an “experimental CDM interface”. To avoid compatibility issues, a user agent should not support an experimental CDM interface by default (it’s okay to support it behind a flag). Similarly, a CDM vendor should not ship a CDM using an experimental CDM interface to end users.

The experimental status of a CDM interface ends when the development is complete and the CDM interface is marked as stable. A stable CDM interface defines an application binary interface (ABI) between the CDM and the host, which should never be changed. Some minor ABI-compatible changes can still be made on a stable CDM interface to improve readability or to avoid unnecessary complexity. For example:

  • Adding clarifying comments.
  • Extending an existing enum type with new values, without changing the enum-base.

Note that even though these changes are ABI-compatible, the implementation may still need to be updated, e.g. to handle the new enum type in a switch case block.

On newer CDM interfaces, a static boolean member kIsStable is present to indicate whether the CDM interface is stable or experimental.