Bug 214304 - [iOS] Avoid loading media libraries in Document::visibilityStateChanged() if not needed
Summary: [iOS] Avoid loading media libraries in Document::visibilityStateChanged() if ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Per Arne Vollan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-07-14 09:52 PDT by Per Arne Vollan
Modified: 2020-07-14 12:55 PDT (History)
9 users (show)

See Also:


Attachments
Patch (1.74 KB, patch)
2020-07-14 09:55 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (1.46 KB, patch)
2020-07-14 12:10 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Per Arne Vollan 2020-07-14 09:52:01 PDT
When the shared PlatformMediaSessionManager is created and accessed for the first time, some media libraries are loaded. There should be no need to access the shared PlatformMediaSessionManager if no manager has been created in Document::visibilityStateChanged().
Comment 1 Per Arne Vollan 2020-07-14 09:53:17 PDT
rdar://problem/65005038
Comment 2 Per Arne Vollan 2020-07-14 09:55:44 PDT
Created attachment 404245 [details]
Patch
Comment 3 Per Arne Vollan 2020-07-14 11:33:39 PDT
Comment on attachment 404245 [details]
Patch

Thanks for reviewing!
Comment 4 EWS 2020-07-14 11:40:22 PDT
Committed r264359: <https://trac.webkit.org/changeset/264359>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 404245 [details].
Comment 5 Simon Fraser (smfr) 2020-07-14 12:00:45 PDT
Comment on attachment 404245 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=404245&action=review

> Source/WebCore/dom/Document.cpp:1761
> +    if (PlatformMediaSessionManager::sharedManagerIfExists()) {
> +        if (!PlatformMediaSessionManager::sharedManager().isInterrupted())
> +            MediaStreamTrack::updateCaptureAccordingToMutedState(*this);
> +    }

if (auto mediaSessionManager = PlatformMediaSessionManager::sharedManagerIfExists())
  if (mediaSessionManager->isInterrupted())
....
Comment 6 Per Arne Vollan 2020-07-14 12:02:41 PDT
(In reply to Simon Fraser (smfr) from comment #5)
> Comment on attachment 404245 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=404245&action=review
> 
> > Source/WebCore/dom/Document.cpp:1761
> > +    if (PlatformMediaSessionManager::sharedManagerIfExists()) {
> > +        if (!PlatformMediaSessionManager::sharedManager().isInterrupted())
> > +            MediaStreamTrack::updateCaptureAccordingToMutedState(*this);
> > +    }
> 
> if (auto mediaSessionManager =
> PlatformMediaSessionManager::sharedManagerIfExists())
>   if (mediaSessionManager->isInterrupted())
> ....

Yes, that is better, I will a new patch :)

Thanks for reviewing!
Comment 7 Per Arne Vollan 2020-07-14 12:10:13 PDT
Reopening to attach new patch.
Comment 8 Per Arne Vollan 2020-07-14 12:10:14 PDT
Created attachment 404263 [details]
Patch
Comment 9 EWS 2020-07-14 12:55:51 PDT
Committed r264370: <https://trac.webkit.org/changeset/264370>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 404263 [details].