Chrome Foundation Services
Chrome Foundation Services
Contents
Overview
This directory contains Chrome Foundation Services. If you think of Chrome as a “portable OS,” Chrome Foundation Services can be thought of as that OS' foundational “system services” layer.
Roughly each subdirectory here corresponds to a service that:
- is a client of
//services/service_manager
with its own unique Identity. - could logically run a standalone process for security/performance isolation benefits depending on the constraints of the host OS.
API Standards
As illustrated above, the individual services in //services are intended for graceful reusability across a broad variety of use cases. To enable this goal, we have rigorous standards on services' public APIs. Before doing significant work in //services (and especially before becoming an owner of a service), please internalize these standards -- you are responsible for upholding them.
Service Directory Structure
Individual services are structured like so:
//services/foo/ <-- Implementation code, may have subdirs. /public/ /cpp/ <-- C++ client libraries (optional) /mojom/ <-- Mojom interfaces
Dependencies
Code within //services
may only depend on each other via each other's /public/
directories, i.e. implementation code may not be shared directly.
Service code should also take care to tightly limit the dependencies on static libraries from outside of //services
. Dependencies to large platform layers like //content
, //chrome
or //third_party/WebKit
must be avoided.
Physical Packaging
Note that while it may be possible to build a discrete physical package (DSO) for each service, products consuming these services may package them differently, e.g. by combining them into a single package.
Additional Documentation
Relationship To Other Top-Level Directories
Services can be thought of as integrators of library code from across the Chromium repository, most commonly //base
and //mojo
(obviously) but for each service also //components
, //ui
, etc. in accordance with the functionality they provide.
Not everything in //components
is automatically a service in its own right. Think of //components
as sort of like a //lib
. Individual //components
can define, implement and use Mojom interfaces, but only //services
have unique identities with the Service Manager and so only //services
make it possible for Mojom interfaces to be acquired.
Adding a new service
See the Service Manager documentation for more details regarding how to define a service and expose or consume interfaces to and from other services.
Please start a thread on services-dev@chromium.org if you want to introduce a new service.
If you are servicifying existing Chromium code: Please first read the servicification strategies documentation, which contains information that will hopefully make your task easier.
posted on 2018-10-16 20:29 huangguanyuan 阅读(170) 评论(0) 编辑 收藏 举报
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
· 三行代码完成国际化适配,妙~啊~