@@ -81,7 +81,7 @@ GMPParent::GMPParent()
81
81
mChildLaunchArch (base::PROCESS_ARCH_INVALID),
82
82
#endif
83
83
mMainThread (GetMainThreadSerialEventTarget()) {
84
- MOZ_ASSERT (IsOnGMPEventTarget ());
84
+ MOZ_ASSERT (GMPEventTarget ()-> IsOnCurrentThread ());
85
85
GMP_PARENT_LOG_DEBUG (" GMPParent ctor id=%u" , mPluginId );
86
86
}
87
87
@@ -92,7 +92,7 @@ GMPParent::~GMPParent() {
92
92
}
93
93
94
94
void GMPParent::CloneFrom (const GMPParent* aOther) {
95
- MOZ_ASSERT (IsOnGMPEventTarget ());
95
+ MOZ_ASSERT (GMPEventTarget ()-> IsOnCurrentThread ());
96
96
MOZ_ASSERT (aOther->mDirectory && aOther->mService , " null plugin directory" );
97
97
98
98
mService = aOther->mService ;
@@ -169,7 +169,7 @@ RefPtr<GenericPromise> GMPParent::Init(GeckoMediaPluginServiceParent* aService,
169
169
nsIFile* aPluginDir) {
170
170
MOZ_ASSERT (aPluginDir);
171
171
MOZ_ASSERT (aService);
172
- MOZ_ASSERT (IsOnGMPEventTarget ());
172
+ MOZ_ASSERT (GMPEventTarget ()-> IsOnCurrentThread ());
173
173
174
174
mService = aService;
175
175
mDirectory = aPluginDir;
@@ -343,7 +343,7 @@ class NotifyGMPProcessLoadedTask : public Runnable {
343
343
344
344
nsresult GMPParent::LoadProcess () {
345
345
MOZ_ASSERT (mDirectory , " Plugin directory cannot be NULL!" );
346
- MOZ_ASSERT (IsOnGMPEventTarget ());
346
+ MOZ_ASSERT (GMPEventTarget ()-> IsOnCurrentThread ());
347
347
MOZ_ASSERT (mState == GMPState::NotLoaded);
348
348
349
349
if (NS_WARN_IF(mPluginType == GMPPluginType::WidevineL1)) {
@@ -433,7 +433,7 @@ nsresult GMPParent::LoadProcess() {
433
433
}
434
434
435
435
void GMPParent::OnPreferenceChange (const mozilla::dom::Pref& aPref) {
436
- MOZ_ASSERT (IsOnGMPEventTarget ());
436
+ MOZ_ASSERT (GMPEventTarget ()-> IsOnCurrentThread ());
437
437
GMP_PARENT_LOG_DEBUG (" %s" , __FUNCTION__);
438
438
439
439
if (!mProcess || !mProcess ->UseXPCOM ()) {
@@ -501,7 +501,7 @@ mozilla::ipc::IPCResult GMPParent::RecvGetModulesTrust(
501
501
#endif // defined(XP_WIN)
502
502
503
503
void GMPParent::CloseIfUnused () {
504
- MOZ_ASSERT (IsOnGMPEventTarget ());
504
+ MOZ_ASSERT (GMPEventTarget ()-> IsOnCurrentThread ());
505
505
GMP_PARENT_LOG_DEBUG (" %s" , __FUNCTION__);
506
506
507
507
if ((mDeleteProcessOnlyOnUnload || mState == GMPState::Loaded ||
@@ -524,7 +524,7 @@ void GMPParent::CloseIfUnused() {
524
524
}
525
525
526
526
void GMPParent::CloseActive (bool aDieWhenUnloaded) {
527
- MOZ_ASSERT (IsOnGMPEventTarget ());
527
+ MOZ_ASSERT (GMPEventTarget ()-> IsOnCurrentThread ());
528
528
GMP_PARENT_LOG_DEBUG (" %s: state %u" , __FUNCTION__,
529
529
uint32_t (GMPState (mState )));
530
530
@@ -548,7 +548,7 @@ void GMPParent::MarkForDeletion() {
548
548
bool GMPParent::IsMarkedForDeletion () { return mIsBlockingDeletion ; }
549
549
550
550
void GMPParent::Shutdown () {
551
- MOZ_ASSERT (IsOnGMPEventTarget ());
551
+ MOZ_ASSERT (GMPEventTarget ()-> IsOnCurrentThread ());
552
552
GMP_PARENT_LOG_DEBUG (" %s" , __FUNCTION__);
553
553
554
554
if (mAbnormalShutdownInProgress ) {
@@ -615,7 +615,7 @@ void GMPParent::ChildTerminated() {
615
615
}
616
616
617
617
void GMPParent::DeleteProcess () {
618
- MOZ_ASSERT (IsOnGMPEventTarget ());
618
+ MOZ_ASSERT (GMPEventTarget ()-> IsOnCurrentThread ());
619
619
620
620
switch (mState ) {
621
621
case GMPState::Closed:
@@ -701,17 +701,7 @@ void GMPParent::DeleteProcess() {
701
701
702
702
GMPState GMPParent::State () const { return mState ; }
703
703
704
- bool GMPParent::IsOnGMPEventTarget () const {
705
- auto target = GMPEventTarget ();
706
- if (!target) {
707
- // We can't get the GMP event target if it has started shutting down, but it
708
- // may still run tasks.
709
- return AppShutdown::IsInOrBeyond (ShutdownPhase::XPCOMShutdownThreads);
710
- }
711
- return target->IsOnCurrentThread ();
712
- }
713
-
714
- nsCOMPtr<nsISerialEventTarget> GMPParent::GMPEventTarget () const {
704
+ nsCOMPtr<nsISerialEventTarget> GMPParent::GMPEventTarget () {
715
705
nsCOMPtr<mozIGeckoMediaPluginService> mps =
716
706
do_GetService (" @mozilla.org/gecko-media-plugin-service;1" );
717
707
MOZ_ASSERT (mps);
@@ -823,7 +813,7 @@ static void GMPNotifyObservers(const uint32_t aPluginID,
823
813
}
824
814
825
815
void GMPParent::ActorDestroy (ActorDestroyReason aWhy) {
826
- MOZ_ASSERT (IsOnGMPEventTarget ());
816
+ MOZ_ASSERT (GMPEventTarget ()-> IsOnCurrentThread ());
827
817
GMP_PARENT_LOG_DEBUG (" %s: (%d)" , __FUNCTION__, (int )aWhy);
828
818
829
819
if (AbnormalShutdown == aWhy) {
@@ -916,7 +906,7 @@ bool ReadInfoField(GMPInfoFileParser& aParser, const nsCString& aKey,
916
906
}
917
907
918
908
RefPtr<GenericPromise> GMPParent::ReadGMPMetaData () {
919
- MOZ_ASSERT (IsOnGMPEventTarget ());
909
+ MOZ_ASSERT (GMPEventTarget ()-> IsOnCurrentThread ());
920
910
MOZ_ASSERT (mDirectory , " Plugin directory cannot be NULL!" );
921
911
MOZ_ASSERT (!mName .IsEmpty (), " Plugin mName cannot be empty!" );
922
912
@@ -1005,7 +995,7 @@ static nsresult ParseVersion(const nsACString& aVersion,
1005
995
}
1006
996
1007
997
RefPtr<GenericPromise> GMPParent::ReadGMPInfoFile (nsIFile* aFile) {
1008
- MOZ_ASSERT (IsOnGMPEventTarget ());
998
+ MOZ_ASSERT (GMPEventTarget ()-> IsOnCurrentThread ());
1009
999
GMPInfoFileParser parser;
1010
1000
if (!parser.Init (aFile)) {
1011
1001
return GenericPromise::CreateAndReject (NS_ERROR_FAILURE, __func__);
@@ -1113,7 +1103,7 @@ RefPtr<GenericPromise> GMPParent::ReadGMPInfoFile(nsIFile* aFile) {
1113
1103
}
1114
1104
1115
1105
RefPtr<GenericPromise> GMPParent::ReadChromiumManifestFile (nsIFile* aFile) {
1116
- MOZ_ASSERT (IsOnGMPEventTarget ());
1106
+ MOZ_ASSERT (GMPEventTarget ()-> IsOnCurrentThread ());
1117
1107
nsAutoCString json;
1118
1108
if (!ReadIntoString (aFile, json, 5 * 1024 )) {
1119
1109
return GenericPromise::CreateAndReject (NS_ERROR_FAILURE, __func__);
@@ -1343,7 +1333,7 @@ void GMPParent::ResolveGetContentParentPromises() {
1343
1333
}
1344
1334
1345
1335
bool GMPParent::OpenPGMPContent () {
1346
- MOZ_ASSERT (IsOnGMPEventTarget ());
1336
+ MOZ_ASSERT (GMPEventTarget ()-> IsOnCurrentThread ());
1347
1337
MOZ_ASSERT (!mGMPContentParent );
1348
1338
1349
1339
Endpoint<PGMPContentParent> parent;
@@ -1380,7 +1370,7 @@ void GMPParent::RejectGetContentParentPromises() {
1380
1370
1381
1371
void GMPParent::GetGMPContentParent (
1382
1372
UniquePtr<MozPromiseHolder<GetGMPContentParentPromise>>&& aPromiseHolder) {
1383
- MOZ_ASSERT (IsOnGMPEventTarget ());
1373
+ MOZ_ASSERT (GMPEventTarget ()-> IsOnCurrentThread ());
1384
1374
GMP_PARENT_LOG_DEBUG (" %s %p" , __FUNCTION__, this );
1385
1375
1386
1376
if (mGMPContentParent ) {
0 commit comments