Bug 776664: Check "sms" capability for PSms. r=mounir
authorChris Jones <jones.chris.g@gmail.com>
Thu, 16 Aug 2012 12:34:53 -0700
changeset 102569 769750c602b2264ca176fee27c89eb999c40ab39
parent 102568 7bd865cc52c5d496ac79b0cb165d4e1e995abe86
child 102570 9e314d3b7120ad89129b6aad2fb7517d32b3974c
push id23297
push useremorley@mozilla.com
push dateFri, 17 Aug 2012 12:22:28 +0000
treeherdermozilla-central@e1cd9fb39dd7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmounir
bugs776664
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 776664: Check "sms" capability for PSms. r=mounir
dom/ipc/ContentParent.cpp
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -10,16 +10,17 @@
 
 #if defined(ANDROID) || defined(LINUX)
 # include <sys/time.h>
 # include <sys/resource.h>
 #endif
 
 #include "chrome/common/process_watcher.h"
 
+#include "AppProcessPermissions.h"
 #include "CrashReporterParent.h"
 #include "History.h"
 #include "IDBFactory.h"
 #include "IndexedDBParent.h"
 #include "IndexedDatabaseManager.h"
 #include "mozIApplication.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/dom/ExternalHelperAppParent.h"
@@ -1353,16 +1354,19 @@ ContentParent::DeallocPExternalHelperApp
     ExternalHelperAppParent *parent = static_cast<ExternalHelperAppParent *>(aService);
     parent->Release();
     return true;
 }
 
 PSmsParent*
 ContentParent::AllocPSms()
 {
+    if (!AppProcessHasPermission(this, "sms")) {
+        return nullptr;
+    }
     return new SmsParent();
 }
 
 bool
 ContentParent::DeallocPSms(PSmsParent* aSms)
 {
     delete aSms;
     return true;