gecko/dom/apps/InterAppComm.cpp
Birunthan Mohanathas f882bf3044 Bug 1058101 - Flatten dom/apps/src/ into parent directory. r=mccr8
--HG--
rename : dom/apps/src/AppDownloadManager.jsm => dom/apps/AppDownloadManager.jsm
rename : dom/apps/src/AppsService.js => dom/apps/AppsService.js
rename : dom/apps/src/AppsService.manifest => dom/apps/AppsService.manifest
rename : dom/apps/src/AppsServiceChild.jsm => dom/apps/AppsServiceChild.jsm
rename : dom/apps/src/AppsUtils.jsm => dom/apps/AppsUtils.jsm
rename : dom/apps/src/FreeSpaceWatcher.jsm => dom/apps/FreeSpaceWatcher.jsm
rename : dom/apps/src/InterAppComm.cpp => dom/apps/InterAppComm.cpp
rename : dom/apps/src/InterAppComm.h => dom/apps/InterAppComm.h
rename : dom/apps/src/InterAppComm.manifest => dom/apps/InterAppComm.manifest
rename : dom/apps/src/InterAppCommService.js => dom/apps/InterAppCommService.js
rename : dom/apps/src/InterAppCommService.jsm => dom/apps/InterAppCommService.jsm
rename : dom/apps/src/InterAppConnection.js => dom/apps/InterAppConnection.js
rename : dom/apps/src/InterAppMessagePort.js => dom/apps/InterAppMessagePort.js
rename : dom/apps/src/OfflineCacheInstaller.jsm => dom/apps/OfflineCacheInstaller.jsm
rename : dom/apps/src/OperatorApps.jsm => dom/apps/OperatorApps.jsm
rename : dom/apps/src/PermissionsInstaller.jsm => dom/apps/PermissionsInstaller.jsm
rename : dom/apps/src/PermissionsTable.jsm => dom/apps/PermissionsTable.jsm
rename : dom/apps/src/ScriptPreloader.jsm => dom/apps/ScriptPreloader.jsm
rename : dom/apps/src/StoreTrustAnchor.jsm => dom/apps/StoreTrustAnchor.jsm
rename : dom/apps/src/Webapps.js => dom/apps/Webapps.js
rename : dom/apps/src/Webapps.jsm => dom/apps/Webapps.jsm
rename : dom/apps/src/Webapps.manifest => dom/apps/Webapps.manifest
2014-08-27 10:12:06 -07:00

27 lines
903 B
C++

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "InterAppComm.h"
#include "nsContentUtils.h"
#include "nsPIDOMWindow.h"
#include "nsJSPrincipals.h"
#include "mozilla/Preferences.h"
#include "AccessCheck.h"
using namespace mozilla::dom;
/* static */ bool
InterAppComm::EnabledForScope(JSContext* /* unused */,
JS::Handle<JSObject*> /* unused */)
{
// Disable the constructors if they're disabled by the preference for sure.
if (!Preferences::GetBool("dom.inter-app-communication-api.enabled", false)) {
return false;
}
// Only expose the constructors to the chrome codes for Gecko internal uses.
// The content pages shouldn't be aware of the constructors.
return nsContentUtils::ThreadsafeIsCallerChrome();
}