mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-31 19:10:36 +00:00
Bug 813762: Teach OS.File about compartment sharing. r=mrbkap
This commit is contained in:
parent
9ce11fb93c
commit
439a5889fa
@ -78,7 +78,10 @@ EXPORTS_mozilla = \
|
||||
$(NULL)
|
||||
|
||||
# We fire the nsDOMDeviceAcceleration
|
||||
LOCAL_INCLUDES += -I$(topsrcdir)/content/events/src
|
||||
LOCAL_INCLUDES += \
|
||||
-I$(topsrcdir)/content/events/src \
|
||||
-I$(topsrcdir)/js/xpconnect/loader \
|
||||
$(NULL)
|
||||
|
||||
ifdef ENABLE_TESTS
|
||||
DIRS += tests
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
#include "nsAppDirectoryServiceDefs.h"
|
||||
#include "mozJSComponentLoader.h"
|
||||
|
||||
#include "OSFileConstants.h"
|
||||
#include "nsIOSFileConstantsService.h"
|
||||
@ -699,11 +700,13 @@ OSFileConstantsService::Init(JSContext *aCx)
|
||||
return rv;
|
||||
}
|
||||
|
||||
JSObject *global = JS_GetGlobalForScopeChain(aCx);
|
||||
if (!global) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
if (!mozilla::DefineOSFileConstants(aCx, global)) {
|
||||
JSObject *targetObj = nullptr;
|
||||
|
||||
mozJSComponentLoader* loader = mozJSComponentLoader::Get();
|
||||
rv = loader->FindTargetObject(aCx, &targetObj);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (!mozilla::DefineOSFileConstants(aCx, targetObj)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user