bug 1543115: remote: expose nsIRemoteAgent as XPCOM service; r=remote-protocol-reviewers,maja_zf,nika

This change makes it possible to access the remote agent service
from C++ and Rust.

Differential Revision: https://phabricator.services.mozilla.com/D50288

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andreas Tolfsen 2019-11-22 08:03:19 +00:00
Родитель 967406480d
Коммит 4a8b5c26b8
2 изменённых файлов: 18 добавлений и 0 удалений

Просмотреть файл

@ -42,3 +42,10 @@ interface nsIRemoteAgent : nsISupports
/** Stops listening and drops existing connections. */
void close();
};
%{C++
#define NS_REMOTEAGENT_CONTRACTID "@mozilla.org/remote/agent;1"
#define NS_REMOTEAGENT_CID \
{ 0x8f685a9d, 0x8181, 0x46d6, \
{ 0xa7, 0x1d, x86, x92, x89, x09, x9c, x6d } }
%}

Просмотреть файл

@ -1,5 +1,8 @@
#!/usr/bin/env python
import buildconfig
services = []
@ -56,6 +59,10 @@ service('Bits', 'nsIBits',
service('AppInfoService', 'nsIXULRuntime',
"@mozilla.org/xre/app-info;1")
if buildconfig.substs.get('ENABLE_REMOTE_AGENT'):
service('RemoteAgent', 'nsIRemoteAgent',
"@mozilla.org/remote/agent;1")
# The definition file needs access to the definitions of the particular
# interfaces. If you add a new interface here, make sure the necessary includes
# are also listed in the following code snippet.
@ -91,6 +98,10 @@ CPP_INCLUDES = """
#include "nsIXULRuntime.h"
"""
if buildconfig.substs.get('ENABLE_REMOTE_AGENT'):
CPP_INCLUDES += '#include "nsIRemoteAgent.h"'
#####
# Codegen Logic
#