SiteArchiveTarget->registerTarget();
SiteArchiveTarget->RegisterTarget();
PRBool CreateSystemTargets(nsPrincipal *sysPrin){  nsUserTarget *userTarg;  nsTarget *target;  PRUint32 i=0;  nsUserTarget *FileReadTarg;  nsUserTarget *FileWriteTarg;  nsUserTarget *FileDeleteTarg;  nsUserTarget *BrowserReadTarg;  nsUserTarget *BrowserWriteTarg;  nsUserTarget *UniversalPreferencesReadTarg;  nsUserTarget *UniversalPreferencesWriteTarg;  nsUserTarget *SendMailTarg;  nsUserTarget *RegistryPrivateTarg;  nsUserTarget *RegistryStandardTarg;  nsUserTarget *RegistryAdminTarg;  nsUserTarget *SilentInstallTarg;  nsUserTarget *SoftwareInstallTarg;  nsUserTarget *UninstallTarg;    nsUserTarget *UniversalFileAccessTarg;  nsUserTarget *UniversalBrowserAccessTarg;    nsTarget *ImpersonatorTarg;    int targetRiskHigh = JavaSecUI_targetRiskHigh();  int targetRiskLow = JavaSecUI_targetRiskLow();   int targetRiskMedium = JavaSecUI_targetRiskMedium();  char *targetRiskColorHigh = JavaSecUI_getString(CAPS_TARGET_RISK_COLOR_HIGH);  char *targetRiskColorLow = JavaSecUI_getString(CAPS_TARGET_RISK_COLOR_LOW);  char *targetRiskColorMedium = JavaSecUI_getString(CAPS_TARGET_RISK_COLOR_MEDIUM);    //  // targets used by the real browser  //  nsTargetArray *targetPtrArray;    FileReadTarg = new nsUserTarget("UniversalFileRead", sysPrin,                                  targetRiskHigh,                                  targetRiskColorHigh,                                  CAPS_TARGET_DESC_FILE_READ,                                  CAPS_TARGET_DETAIL_DESC_FILE_READ,                                  CAPS_TARGET_URL_FILE_READ);  FileReadTarg->registerTarget();    FileWriteTarg = new nsUserTarget("UniversalFileWrite", sysPrin,                                   targetRiskHigh,                                   targetRiskColorHigh,                                   CAPS_TARGET_DESC_FILE_WRITE,                                   CAPS_TARGET_DETAIL_DESC_FILE_WRITE,                                   CAPS_TARGET_URL_FILE_WRITE);  FileWriteTarg->registerTarget();    FileDeleteTarg = new nsUserTarget("UniversalFileDelete", sysPrin,                                    targetRiskHigh,                                    targetRiskColorHigh,                                    CAPS_TARGET_DESC_FILE_DELETE,                                    CAPS_TARGET_DETAIL_DESC_FILE_DELETE,                                    CAPS_TARGET_URL_FILE_DELETE);  FileDeleteTarg->registerTarget();    ImpersonatorTarg = new nsTarget("Impersonator", sysPrin,                                  targetRiskHigh,                                  targetRiskColorHigh,                                  CAPS_TARGET_DESC_IMPERSONATOR,                                  CAPS_TARGET_DETAIL_DESC_IMPERSONATOR,                                  CAPS_TARGET_URL_IMPERSONATOR);  ImpersonatorTarg->registerTarget();    BrowserReadTarg = new nsUserTarget("UniversalBrowserRead", sysPrin,                                     targetRiskMedium,                                     targetRiskColorMedium,                                     CAPS_TARGET_DESC_BROWSER_READ,                                     CAPS_TARGET_DETAIL_DESC_BROWSER_READ,                                     CAPS_TARGET_URL_BROWSER_READ);  BrowserReadTarg->registerTarget();    BrowserWriteTarg = new nsUserTarget("UniversalBrowserWrite", sysPrin,                                      targetRiskHigh,                                      targetRiskColorHigh,                                      CAPS_TARGET_DESC_BROWSER_WRITE,                                      CAPS_TARGET_DETAIL_DESC_BROWSER_WRITE,                                      CAPS_TARGET_URL_BROWSER_WRITE);  BrowserWriteTarg->registerTarget();    UniversalPreferencesReadTarg = new nsUserTarget("UniversalPreferencesRead",                                                   sysPrin,                                                  targetRiskMedium,                                                  targetRiskColorMedium,                                                  CAPS_TARGET_DESC_PREFS_READ,                                                  CAPS_TARGET_DETAIL_DESC_PREFS_READ,                                                  CAPS_TARGET_URL_PREFS_READ);  UniversalPreferencesReadTarg->registerTarget();    UniversalPreferencesWriteTarg = new nsUserTarget("UniversalPreferencesWrite",                                                    sysPrin,                                                   targetRiskHigh,                                                   targetRiskColorHigh,                                                   CAPS_TARGET_DESC_PREFS_WRITE,                                                   CAPS_TARGET_DETAIL_DESC_PREFS_WRITE,                                                   CAPS_TARGET_URL_PREFS_WRITE);  UniversalPreferencesWriteTarg->registerTarget();    SendMailTarg = new nsUserTarget("UniversalSendMail", sysPrin,                                  targetRiskMedium,                                  targetRiskColorMedium,                                  CAPS_TARGET_DESC_SEND_MAIL,                                  CAPS_TARGET_DETAIL_DESC_SEND_MAIL,                                  CAPS_TARGET_URL_SEND_MAIL);  SendMailTarg->registerTarget();    RegistryPrivateTarg = new nsUserTarget("PrivateRegistryAccess", sysPrin,                                         targetRiskLow,                                         targetRiskColorLow,                                         CAPS_TARGET_DESC_REG_PRIVATE,                                         CAPS_TARGET_DETAIL_DESC_REG_PRIVATE,                                         CAPS_TARGET_URL_REG_PRIVATE);  RegistryPrivateTarg->registerTarget();    targetPtrArray = new nsTargetArray();  targetPtrArray->SetSize(1, 1);  i = 0;  targetPtrArray->Set(i++, (void *)RegistryPrivateTarg);  RegistryStandardTarg = new nsUserTarget("StandardRegistryAccess", sysPrin,                                          targetRiskMedium,                                          targetRiskColorMedium,                                          CAPS_TARGET_DESC_REG_STANDARD,                                          CAPS_TARGET_DETAIL_DESC_REG_STANDARD,                                          CAPS_TARGET_URL_REG_STANDARD,                                          targetPtrArray);  RegistryStandardTarg->registerTarget();    targetPtrArray = new nsTargetArray();  targetPtrArray->SetSize(1, 1);  i = 0;  targetPtrArray->Set(i++, (void *)RegistryStandardTarg);  RegistryAdminTarg = new nsUserTarget("AdministratorRegistryAccess",                                        sysPrin,                                       targetRiskHigh,                                       targetRiskColorHigh,                                       CAPS_TARGET_DESC_REG_ADMIN,                                       CAPS_TARGET_DETAIL_DESC_REG_ADMIN,                                       CAPS_TARGET_URL_REG_ADMIN,                                       targetPtrArray);  RegistryAdminTarg->registerTarget();    UninstallTarg = new nsUserTarget("Uninstall",                                     sysPrin,                                    targetRiskHigh,			                        targetRiskColorHigh,                                    CAPS_TARGET_DESC_UNINSTALL,                                    CAPS_TARGET_DETAIL_DESC_UNINSTALL,                                    CAPS_TARGET_URL_UNINSTALL);  UninstallTarg->registerTarget();  targetPtrArray = new nsTargetArray();  targetPtrArray->SetSize(4,1);  i=0;  targetPtrArray->Set(i++, (void *)RegistryStandardTarg);  targetPtrArray->Set(i++, (void *)UniversalPreferencesReadTarg);  targetPtrArray->Set(i++, (void *)FileReadTarg);  targetPtrArray->Set(i++, (void *)UninstallTarg);  SoftwareInstallTarg = new nsUserTarget("SoftwareInstall",                                         sysPrin,                                        targetRiskHigh,			                            targetRiskColorHigh,                                        CAPS_TARGET_DESC_SOFTWAREINSTALL,                                        CAPS_TARGET_DETAIL_DESC_SOFTWAREINSTALL,                                        CAPS_TARGET_URL_SOFTWAREINSTALL,                                        targetPtrArray);  SoftwareInstallTarg->registerTarget();  targetPtrArray = new nsTargetArray();  targetPtrArray->SetSize(1, 1);  i = 0;  targetPtrArray->Set(i++, (void *)SoftwareInstallTarg);  SilentInstallTarg = new nsUserTarget("SilentInstall",                                        sysPrin,                                        targetRiskHigh,			                            targetRiskColorHigh,                                        CAPS_TARGET_DESC_SILENTINSTALL,                                        CAPS_TARGET_DETAIL_DESC_SILENTINSTALL,                                        CAPS_TARGET_URL_SILENTINSTALL,                                        targetPtrArray);  SilentInstallTarg->registerTarget();  //  // targets used by Constellation group  //  // Create a user target that protects cache APIs  nsTarget *SiteArchiveTarget = new nsUserTarget("SiteArchiveTarget",                                                     sysPrin,                                                 targetRiskHigh,                                                 targetRiskColorHigh,                                                 CAPS_TARGET_DESC_SAR,                                                 CAPS_TARGET_DETAIL_DESC_SAR,                                                 CAPS_TARGET_URL_SAR);  SiteArchiveTarget->registerTarget();    targetPtrArray = new nsTargetArray();  targetPtrArray->SetSize(1, 1);  i=0;  targetPtrArray->Set(i++, (void *)BrowserWriteTarg);  userTarg = new nsUserTarget("CanvasAccess", sysPrin,                              targetRiskHigh,                              targetRiskColorHigh,                              CAPS_TARGET_DESC_CANVAS_ACCESS,                              CAPS_TARGET_DETAIL_DESC_CANVAS_ACCESS,                              CAPS_TARGET_URL_CANVAS_ACCESS,                               targetPtrArray);  userTarg->registerTarget();    targetPtrArray = new nsTargetArray();  targetPtrArray->SetSize(3, 1);  i=0;  targetPtrArray->Set(i++, (void *)FileReadTarg);  targetPtrArray->Set(i++, (void *)FileWriteTarg);  targetPtrArray->Set(i++, (void *)FileDeleteTarg);  UniversalFileAccessTarg = new nsUserTarget("UniversalFileAccess",                                              sysPrin,                                             targetRiskHigh,                                             targetRiskColorHigh,                                             CAPS_TARGET_DESC_FILE_ACCESS,                                             CAPS_TARGET_DETAIL_DESC_FILE_ACCESS,                                             CAPS_TARGET_URL_FILE_ACCESS,                                             targetPtrArray);  UniversalFileAccessTarg->registerTarget();    targetPtrArray = new nsTargetArray();  targetPtrArray->SetSize(2, 1);  i=0;  targetPtrArray->Set(i++, (void *)BrowserReadTarg);  targetPtrArray->Set(i++, (void *)BrowserWriteTarg);  UniversalBrowserAccessTarg =     new nsUserTarget("UniversalBrowserAccess",                     sysPrin,                     targetRiskHigh,                     targetRiskColorHigh,                     CAPS_TARGET_DESC_BROWSER_ACCESS,                     CAPS_TARGET_DETAIL_DESC_BROWSER_ACCESS,                     CAPS_TARGET_URL_BROWSER_ACCESS,                     targetPtrArray);  UniversalBrowserAccessTarg->registerTarget();    // a macro Target for PE  targetPtrArray = new nsTargetArray();  targetPtrArray->SetSize(7, 1);  i=0;  targetPtrArray->Set(i++, (void *)BrowserReadTarg);  targetPtrArray->Set(i++, (void *)BrowserWriteTarg);  targetPtrArray->Set(i++, (void *)UniversalPreferencesReadTarg);  targetPtrArray->Set(i++, (void *)UniversalPreferencesWriteTarg);  targetPtrArray->Set(i++, (void *)UniversalFileAccessTarg);  userTarg = new nsUserTarget("AccountSetup", sysPrin,                              targetRiskHigh,                              targetRiskColorHigh,                              CAPS_TARGET_DESC_ACCOUNT_SETUP,                              CAPS_TARGET_DETAIL_DESC_ACCOUNT_SETUP,                              CAPS_TARGET_URL_ACCOUNT_SETUP,                              targetPtrArray);  userTarg->registerTarget();    /* Permission to All privileges in Java */  target = new nsUserTarget("AllJavaPermission", sysPrin,                             targetRiskHigh,                            targetRiskColorHigh,                            CAPS_TARGET_DESC_ALL_JAVA_PERMISSION,                            CAPS_TARGET_DETAIL_DESC_ALL_JAVA_PERMISSION,                            CAPS_TARGET_URL_ALL_JAVA_PERMISSION);  target->registerTarget();  /* Permission to All privileges in Java */  targetPtrArray = new nsTargetArray();  targetPtrArray->SetSize(7, 1);  i=0;  /* The following list of JS targets came from lm_taint.c */  targetPtrArray->Set(i++, (void *)BrowserReadTarg);  targetPtrArray->Set(i++, (void *)BrowserWriteTarg);  targetPtrArray->Set(i++, (void *)SendMailTarg);  targetPtrArray->Set(i++, (void *)FileReadTarg);  targetPtrArray->Set(i++, (void *)FileWriteTarg);  targetPtrArray->Set(i++, (void *)UniversalPreferencesReadTarg);  targetPtrArray->Set(i++, (void *)UniversalPreferencesWriteTarg);  target = new nsUserTarget("AllJavaScriptPermission", sysPrin,                             targetRiskHigh,                            targetRiskColorHigh,                            CAPS_TARGET_DESC_ALL_JS_PERMISSION,                            CAPS_TARGET_DETAIL_DESC_ALL_JS_PERMISSION,                            CAPS_TARGET_URL_ALL_JS_PERMISSION,                            targetPtrArray);  target->registerTarget();  return PR_TRUE;}