Bug 1332523 - Make the Bootstrap API entry point the same for both dependent and standalone linkage. r=bsmedberg

--HG--
extra : rebase_source : 21d9371dfa0a7ed7ff056d8486f28c978df8932d
This commit is contained in:
Mike Hommey 2017-01-13 07:29:56 +09:00
parent 9d2b3754b7
commit f9c3dd278b
4 changed files with 15 additions and 7 deletions

View File

@ -18,8 +18,7 @@ main(int argc, char *argv[])
DllBlocklist_Initialize();
#endif
Bootstrap::UniquePtr bootstrap;
XRE_GetBootstrap(bootstrap);
Bootstrap::UniquePtr bootstrap = GetBootstrap();
if (!bootstrap) {
return 2;
}

View File

@ -19,8 +19,7 @@ main(int argc, char** argv)
if (argc < 2)
return 1;
Bootstrap::UniquePtr bootstrap;
XRE_GetBootstrap(bootstrap);
Bootstrap::UniquePtr bootstrap = GetBootstrap();
if (!bootstrap) {
return 2;
}

View File

@ -60,8 +60,7 @@ main(int argc, char** argv, char** envp)
mozilla::sandboxing::GetInitializedBrokerServices();
#endif
mozilla::Bootstrap::UniquePtr bootstrap;
XRE_GetBootstrap(bootstrap);
mozilla::Bootstrap::UniquePtr bootstrap = mozilla::GetBootstrap();
if (!bootstrap) {
return 2;
}

View File

@ -125,9 +125,20 @@ public:
* "C" linkage. On failure this will be null.
* @note This function may only be called once and will crash if called again.
*/
#ifdef XPCOM_GLUE
typedef void (*GetBootstrapType)(Bootstrap::UniquePtr&);
Bootstrap::UniquePtr GetBootstrap(const char* aXPCOMFile=nullptr);
#else
extern "C" NS_EXPORT void NS_FROZENCALL
XRE_GetBootstrap(Bootstrap::UniquePtr& b);
typedef void (*GetBootstrapType)(Bootstrap::UniquePtr&);
inline Bootstrap::UniquePtr
GetBootstrap(const char* aXPCOMFile=nullptr) {
Bootstrap::UniquePtr bootstrap;
XRE_GetBootstrap(bootstrap);
return bootstrap;
}
#endif
} // namespace mozilla