bool GMPProcessParent::Launch(int32_t aTimeoutMs) { nsCOMPtr<nsIFile> path; if (!GetEMEVoucherPath(getter_AddRefs(path))) { NS_WARNING("GMPProcessParent can't get EME voucher path!"); return false; } nsAutoCString voucherPath; path->GetNativePath(voucherPath); vector<string> args; #if defined(XP_WIN) && defined(MOZ_SANDBOX) std::wstring wGMPPath = UTF8ToWide(mGMPPath.c_str()); // The sandbox doesn't allow file system rules where the paths contain // symbolic links or junction points. Sometimes the Users folder has been // moved to another drive using a junction point, so allow for this specific // case. See bug 1236680 for details. if (!widget::WinUtils::ResolveMovedUsersFolder(wGMPPath)) { NS_WARNING("ResolveMovedUsersFolder failed for GMP path."); return false; } mAllowedFilesRead.push_back(wGMPPath + L"\\*"); args.push_back(WideToUTF8(wGMPPath)); #else args.push_back(mGMPPath); #endif args.push_back(string(voucherPath.BeginReading(), voucherPath.EndReading())); return SyncLaunch(args, aTimeoutMs, base::GetCurrentProcessArchitecture()); }
bool EMEVoucherFileExists() { nsCOMPtr<nsIFile> path; bool exists; return GetEMEVoucherPath(getter_AddRefs(path)) && NS_SUCCEEDED(path->Exists(&exists)) && exists; }
bool GMPProcessParent::Launch(int32_t aTimeoutMs) { nsCOMPtr<nsIFile> path; if (!GetEMEVoucherPath(getter_AddRefs(path))) { NS_WARNING("GMPProcessParent can't get EME voucher path!"); return false; } nsAutoCString voucherPath; path->GetNativePath(voucherPath); vector<string> args; args.push_back(mGMPPath); args.push_back(string(voucherPath.BeginReading(), voucherPath.EndReading())); #if defined(XP_WIN) && defined(MOZ_SANDBOX) std::wstring wGMPPath = UTF8ToWide(mGMPPath.c_str()); mAllowedFilesRead.push_back(wGMPPath + L"\\*"); #endif return SyncLaunch(args, aTimeoutMs, base::GetCurrentProcessArchitecture()); }