[iOS] WKContentView and WKLegacyPDFView should share application state tracking logic
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Apr 2018 01:48:31 +0000 (01:48 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Apr 2018 01:48:31 +0000 (01:48 +0000)
commit5f0c0a248480c28ada0ba3586b45ac0967414b48
treedda4d4f4e1ebaffdad4c89145daffe07a69a91ef
parente0d73a2a7a8386b6e71607dc0c5db5c10cac67c1
[iOS] WKContentView and WKLegacyPDFView should share application state tracking logic
https://bugs.webkit.org/show_bug.cgi?id=184402

Reviewed by Dan Bernstein.

WKContentView and WKLegacyPDFView have nearly identical logic for tracking
application foreground state. Let's share it so we can more easily create new
content views with proper application state tracking.

* UIProcess/ios/WKApplicationStateTrackingView.h: Added.
* UIProcess/ios/WKApplicationStateTrackingView.mm: Added.
(-[WKApplicationStateTrackingView initWithFrame:webView:]):
(-[WKApplicationStateTrackingView willMoveToWindow:]):
(-[WKApplicationStateTrackingView didMoveToWindow]):
(-[WKApplicationStateTrackingView _applicationDidEnterBackground]):
(-[WKApplicationStateTrackingView _applicationDidCreateWindowContext]):
(-[WKApplicationStateTrackingView _applicationDidFinishSnapshottingAfterEnteringBackground]):
(-[WKApplicationStateTrackingView _applicationWillEnterForeground]):
(-[WKApplicationStateTrackingView isBackground]):

Moved common logic from WKContentView and WKLegacyPDFView into
WKApplicationStateTrackingView.

* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView initWithFrame:processPool:configuration:webView:]):
(-[WKContentView willMoveToWindow:]):
(-[WKContentView _applicationDidCreateWindowContext]):
(-[WKContentView didMoveToWindow]): Deleted.
(-[WKContentView isBackground]): Deleted.
(-[WKContentView _applicationDidEnterBackground]): Deleted.
(-[WKContentView _applicationDidFinishSnapshottingAfterEnteringBackground]): Deleted.
(-[WKContentView _applicationWillEnterForeground]): Deleted.

Made WKContentView a subclass of WKApplicationStateTrackingView.

* UIProcess/ios/WKLegacyPDFView.h:
* UIProcess/ios/WKLegacyPDFView.mm:
(-[WKLegacyPDFView web_initWithFrame:webView:]):
(-[WKLegacyPDFView web_isBackground]):
(-[WKLegacyPDFView _applicationWillEnterForeground]):
(-[WKLegacyPDFView willMoveToWindow:]): Deleted.
(-[WKLegacyPDFView didMoveToWindow]): Deleted.
(-[WKLegacyPDFView _applicationDidEnterBackground]): Deleted.
(-[WKLegacyPDFView _applicationDidCreateWindowContext]): Deleted.
(-[WKLegacyPDFView _applicationDidFinishSnapshottingAfterEnteringBackground]): Deleted.

Made WKLegacyPDFView a subclass of WKApplicationStateTrackingView.

* WebKit.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKApplicationStateTrackingView.h [new file with mode: 0644]
Source/WebKit/UIProcess/ios/WKApplicationStateTrackingView.mm [new file with mode: 0644]
Source/WebKit/UIProcess/ios/WKContentView.h
Source/WebKit/UIProcess/ios/WKContentView.mm
Source/WebKit/UIProcess/ios/WKLegacyPDFView.h
Source/WebKit/UIProcess/ios/WKLegacyPDFView.mm
Source/WebKit/WebKit.xcodeproj/project.pbxproj