Title: [185331] trunk/Source/WebKit2
Revision
185331
Author
[email protected]
Date
2015-06-08 15:29:51 -0700 (Mon, 08 Jun 2015)

Log Message

Move the snapshot layer contents SPI to the web view
https://bugs.webkit.org/show_bug.cgi?id=145771

Reviewed by Geoffrey Garen.

We need to potentially ask the web page to take a snapshot of the current item,
so move the SPI to WKWebView and name it appropriately.

* UIProcess/API/Cocoa/WKBackForwardListItem.mm:
(-[WKBackForwardListItem _snapshotLayerContents]): Deleted.
* UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h: Removed.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _snapshotLayerContentsForBackForwardListItem:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* WebKit2.xcodeproj/project.pbxproj:

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (185330 => 185331)


--- trunk/Source/WebKit2/ChangeLog	2015-06-08 22:29:26 UTC (rev 185330)
+++ trunk/Source/WebKit2/ChangeLog	2015-06-08 22:29:51 UTC (rev 185331)
@@ -1,3 +1,21 @@
+2015-06-08  Anders Carlsson  <[email protected]>
+
+        Move the snapshot layer contents SPI to the web view
+        https://bugs.webkit.org/show_bug.cgi?id=145771
+
+        Reviewed by Geoffrey Garen.
+
+        We need to potentially ask the web page to take a snapshot of the current item,
+        so move the SPI to WKWebView and name it appropriately.
+
+        * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
+        (-[WKBackForwardListItem _snapshotLayerContents]): Deleted.
+        * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h: Removed.
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]):
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+        * WebKit2.xcodeproj/project.pbxproj:
+
 2015-06-08  Brady Eidson  <[email protected]>
 
         Completely remove all IDB properties/constructors when it is disabled at runtime.

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListItem.mm (185330 => 185331)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListItem.mm	2015-06-08 22:29:26 UTC (rev 185330)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListItem.mm	2015-06-08 22:29:51 UTC (rev 185331)
@@ -75,20 +75,4 @@
 
 @end
 
-@implementation WKBackForwardListItem (WKPrivate)
-
-#if PLATFORM(IOS)
-
-- (id)_snapshotLayerContents
-{
-    if (auto* viewSnapshot = _item->snapshot())
-        return viewSnapshot->asLayerContents();
-
-    return nil;
-}
-
-#endif
-
-@end
-
 #endif // WK_API_ENABLED

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListItemInternal.h (185330 => 185331)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListItemInternal.h	2015-06-08 22:29:26 UTC (rev 185330)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListItemInternal.h	2015-06-08 22:29:51 UTC (rev 185331)
@@ -23,7 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import "WKBackForwardListItemPrivate.h"
+#import "WKBackForwardListItem.h"
 
 #if WK_API_ENABLED
 

Deleted: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h (185330 => 185331)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h	2015-06-08 22:29:26 UTC (rev 185330)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h	2015-06-08 22:29:51 UTC (rev 185331)
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <WebKit/WKBackForwardList.h>
-
-#if WK_API_ENABLED
-
-WK_ASSUME_NONNULL_BEGIN
-
-@interface WKBackForwardListItem (WKPrivate)
-
-#if TARGET_OS_IPHONE
-
-@property (WK_NULLABLE_PROPERTY nonatomic, readonly, strong) id _snapshotLayerContents WK_AVAILABLE(NA, WK_IOS_TBA);
-
-#endif
-
-@end
-
-WK_ASSUME_NONNULL_END
-
-#endif

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (185330 => 185331)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2015-06-08 22:29:26 UTC (rev 185330)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2015-06-08 22:29:51 UTC (rev 185331)
@@ -1938,6 +1938,17 @@
     }];
 }
 
+- (id)_snapshotLayerContentsForBackForwardListItem:(WKBackForwardListItem *)item
+{
+    if (_page->backForwardList().currentItem() == &item._item)
+        _page->recordNavigationSnapshot(*_page->backForwardList().currentItem());
+
+    if (auto* viewSnapshot = item._item.snapshot())
+        return viewSnapshot->asLayerContents();
+
+    return nil;
+}
+
 #endif
 
 - (void)_didRelaunchProcess

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (185330 => 185331)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h	2015-06-08 22:29:26 UTC (rev 185330)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h	2015-06-08 22:29:51 UTC (rev 185331)
@@ -160,6 +160,8 @@
 
 - (void)_becomeFirstResponderWithSelectionMovingForward:(BOOL)selectingForward completionHandler:(void (^)(BOOL didBecomeFirstResponder))completionHandler WK_AVAILABLE(NA, WK_IOS_TBA);
 
+- (id)_snapshotLayerContentsForBackForwardListItem:(WKBackForwardListItem *)item WK_AVAILABLE(NA, WK_IOS_TBA);
+
 #else
 @property (readonly) NSColor *_pageExtendedBackgroundColor;
 @property (nonatomic, setter=_setDrawsTransparentBackground:) BOOL _drawsTransparentBackground;

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (185330 => 185331)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2015-06-08 22:29:26 UTC (rev 185330)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2015-06-08 22:29:51 UTC (rev 185331)
@@ -181,7 +181,6 @@
 		1A1D8BA11731A36300141DA4 /* LocalStorageDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1D8B9F1731A36300141DA4 /* LocalStorageDatabase.cpp */; };
 		1A1D8BA21731A36300141DA4 /* LocalStorageDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A1D8BA01731A36300141DA4 /* LocalStorageDatabase.h */; };
 		1A1DC340196346D700FF7059 /* LegacySessionStateCoding.h in Headers */ = {isa = PBXBuildFile; fileRef = 31607F3819627002009B87DA /* LegacySessionStateCoding.h */; };
-		1A1E01E91B1FBB7900973E1F /* WKBackForwardListItemPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A1E01E81B1FBB7900973E1F /* WKBackForwardListItemPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1A1E093318861D3800D2DC49 /* WebProgressTrackerClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1E093118861D3800D2DC49 /* WebProgressTrackerClient.cpp */; };
 		1A1E093418861D3800D2DC49 /* WebProgressTrackerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A1E093218861D3800D2DC49 /* WebProgressTrackerClient.h */; };
 		1A1EC69E1872092100B951F0 /* ImportanceAssertion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A1EC69D1872092100B951F0 /* ImportanceAssertion.h */; };
@@ -2305,7 +2304,6 @@
 		1A1D2117191D996C0001619F /* MigrateHeadersFromWebKitLegacy.make */ = {isa = PBXFileReference; lastKnownFileType = text; name = MigrateHeadersFromWebKitLegacy.make; path = mac/MigrateHeadersFromWebKitLegacy.make; sourceTree = "<group>"; };
 		1A1D8B9F1731A36300141DA4 /* LocalStorageDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalStorageDatabase.cpp; sourceTree = "<group>"; };
 		1A1D8BA01731A36300141DA4 /* LocalStorageDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalStorageDatabase.h; sourceTree = "<group>"; };
-		1A1E01E81B1FBB7900973E1F /* WKBackForwardListItemPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBackForwardListItemPrivate.h; sourceTree = "<group>"; };
 		1A1E093118861D3800D2DC49 /* WebProgressTrackerClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebProgressTrackerClient.cpp; sourceTree = "<group>"; };
 		1A1E093218861D3800D2DC49 /* WebProgressTrackerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebProgressTrackerClient.h; sourceTree = "<group>"; };
 		1A1EC69D1872092100B951F0 /* ImportanceAssertion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImportanceAssertion.h; sourceTree = "<group>"; };
@@ -5430,7 +5428,6 @@
 				37C4C08518149C5B003688B9 /* WKBackForwardListItem.h */,
 				37C4C08418149C5B003688B9 /* WKBackForwardListItem.mm */,
 				37C4C08818149F23003688B9 /* WKBackForwardListItemInternal.h */,
-				1A1E01E81B1FBB7900973E1F /* WKBackForwardListItemPrivate.h */,
 				1A9F28101958F478008CAC72 /* WKBackForwardListPrivate.h */,
 				1AF4592D19464B2000F9D4A2 /* WKError.h */,
 				1AF4592C19464B2000F9D4A2 /* WKError.mm */,
@@ -8192,7 +8189,6 @@
 				33367630130C9998006C9DE2 /* WebResourceCacheManager.h in Headers */,
 				33367656130C9ECA006C9DE2 /* WebResourceCacheManagerMessages.h in Headers */,
 				33367636130C99B2006C9DE2 /* WebResourceCacheManagerProxy.h in Headers */,
-				1A1E01E91B1FBB7900973E1F /* WKBackForwardListItemPrivate.h in Headers */,
 				33367658130C9ECB006C9DE2 /* WebResourceCacheManagerProxyMessages.h in Headers */,
 				510AFFBA16542048001BA05E /* WebResourceLoader.h in Headers */,
 				51F060E01654317F00F3281B /* WebResourceLoaderMessages.h in Headers */,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to