зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1471025: Part 3b - Refactor Android shared FD API to require fewer modifications per change. r=jld
Adding or removing an FD from this API currently requires changes in about a half dozen places. Ignoring the Java side of things. This patch changes the API to pass a struct, rather than additional arguments for each FD, so that adding and removing FDs only requires changing one declaration, and the two call sites that add and consume the FDs. MozReview-Commit-ID: CToSEVp1oqP --HG-- extra : rebase_source : 28e8c6075bacf5f610058227a9731aeadb50f320 extra : absorb_source : f63602a163ed19fb65e26640319750fdd9b92ad1
This commit is contained in:
Родитель
607cc0aec9
Коммит
de31493580
|
@ -408,7 +408,7 @@ Java_org_mozilla_gecko_mozglue_GeckoLoader_nativeRun(JNIEnv *jenv, jclass jc, jo
|
|||
gBootstrap->GeckoStart(jenv, argv, argc, sAppData);
|
||||
ElfLoader::Singleton.ExpectShutdown(true);
|
||||
} else {
|
||||
gBootstrap->XRE_SetAndroidChildFds(jenv, prefsFd, ipcFd, crashFd, crashAnnotationFd);
|
||||
gBootstrap->XRE_SetAndroidChildFds(jenv, { prefsFd, ipcFd, crashFd, crashAnnotationFd });
|
||||
gBootstrap->XRE_SetProcessType(argv[argc - 1]);
|
||||
|
||||
XREChildData childData;
|
||||
|
|
|
@ -78,8 +78,8 @@ public:
|
|||
::GeckoStart(aEnv, argv, argc, aAppData);
|
||||
}
|
||||
|
||||
virtual void XRE_SetAndroidChildFds(JNIEnv* aEnv, int aPrefsFd, int aIPCFd, int aCrashFd, int aCrashAnnotationFd) override {
|
||||
::XRE_SetAndroidChildFds(aEnv, aPrefsFd, aIPCFd, aCrashFd, aCrashAnnotationFd);
|
||||
virtual void XRE_SetAndroidChildFds(JNIEnv* aEnv, const XRE_AndroidChildFds& aFds) override {
|
||||
::XRE_SetAndroidChildFds(aEnv, aFds);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ public:
|
|||
#ifdef MOZ_WIDGET_ANDROID
|
||||
virtual void GeckoStart(JNIEnv* aEnv, char** argv, int argc, const StaticXREAppData& aAppData) = 0;
|
||||
|
||||
virtual void XRE_SetAndroidChildFds(JNIEnv* aEnv, int aPrefsFd, int aIPCFd, int aCrashFd, int aCrashAnnotationFd) = 0;
|
||||
virtual void XRE_SetAndroidChildFds(JNIEnv* aEnv, const XRE_AndroidChildFds& fds) = 0;
|
||||
#endif
|
||||
|
||||
#ifdef LIBFUZZER
|
||||
|
|
|
@ -244,13 +244,13 @@ GeckoProcessType sChildProcessType = GeckoProcessType_Default;
|
|||
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
void
|
||||
XRE_SetAndroidChildFds (JNIEnv* env, int prefsFd, int ipcFd, int crashFd, int crashAnnotationFd)
|
||||
XRE_SetAndroidChildFds (JNIEnv* env, const XRE_AndroidChildFds& fds)
|
||||
{
|
||||
mozilla::jni::SetGeckoThreadEnv(env);
|
||||
mozilla::dom::SetPrefsFd(prefsFd);
|
||||
IPC::Channel::SetClientChannelFd(ipcFd);
|
||||
CrashReporter::SetNotificationPipeForChild(crashFd);
|
||||
CrashReporter::SetCrashAnnotationPipeForChild(crashAnnotationFd);
|
||||
mozilla::dom::SetPrefsFd(fds.mPrefsFd);
|
||||
IPC::Channel::SetClientChannelFd(fds.mIpcFd);
|
||||
CrashReporter::SetNotificationPipeForChild(fds.mCrashFd);
|
||||
CrashReporter::SetCrashAnnotationPipeForChild(fds.mCrashAnnotationFd);
|
||||
}
|
||||
#endif // defined(MOZ_WIDGET_ANDROID)
|
||||
|
||||
|
|
|
@ -397,8 +397,16 @@ XRE_API(const char*,
|
|||
XRE_ChildProcessTypeToString, (GeckoProcessType aProcessType))
|
||||
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
struct XRE_AndroidChildFds
|
||||
{
|
||||
int mPrefsFd;
|
||||
int mIpcFd;
|
||||
int mCrashFd;
|
||||
int mCrashAnnotationFd;
|
||||
};
|
||||
|
||||
XRE_API(void,
|
||||
XRE_SetAndroidChildFds, (JNIEnv* env, int prefsFd, int ipcFd, int crashFd, int crashAnnotationFd))
|
||||
XRE_SetAndroidChildFds, (JNIEnv* env, const XRE_AndroidChildFds& fds))
|
||||
#endif // defined(MOZ_WIDGET_ANDROID)
|
||||
|
||||
XRE_API(void,
|
||||
|
|
Загрузка…
Ссылка в новой задаче