Changeset 175759 in webkit
- Timestamp:
- Nov 7, 2014 12:35:23 PM (9 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r175757 r175759 1 2014-11-07 Anshu Chimala <anshu@apple.com> 2 3 Make it possible to associate snapshots with back/forward list items other than the current item. 4 https://bugs.webkit.org/show_bug.cgi?id=138490 5 6 Reviewed by Tim Horton. 7 8 * UIProcess/API/Cocoa/WKViewPrivate.h: 9 Declare -saveBackForwardSnapshotForItem:, an alternative to -saveBackForwardSnapshotForCurrentItem that accepts a 10 back/forward list item as an argument. 11 * UIProcess/API/mac/WKView.mm: 12 (-[WKView saveBackForwardSnapshotForItem:]): 13 Pass the provided back/forward list item along to WebPageProxy::recordNavigationSnapshot(). 14 15 * UIProcess/WebPageProxy.cpp: 16 (WebKit::WebPageProxy::recordNavigationSnapshot): 17 Overloaded to optionally take a back/forward list item as an argument. If one isn't provided, default to the current item 18 as before; otherwise, associate the snapshot with whichever item was provided. 19 * UIProcess/WebPageProxy.h: 20 Declare the new recordNavigationSnapshot() overload. 21 22 * UIProcess/mac/ViewSnapshotStore.h: 23 Make recordSnapshot() take a back/forward list item as an argument. 24 * UIProcess/mac/ViewSnapshotStore.mm: 25 (WebKit::ViewSnapshotStore::recordSnapshot): 26 Store the snapshot in the provided back/forward list item instead of in the current item. 27 1 28 2014-11-07 Tim Horton <timothy_horton@apple.com> 2 29 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h
r175732 r175759 110 110 111 111 - (void)saveBackForwardSnapshotForCurrentItem; 112 - (void)saveBackForwardSnapshotForItem:(WKBackForwardListItemRef)item; 112 113 113 114 // Views must be layer-backed, have no transform applied, be in back-to-front z-order, and the whole set must be a contiguous opaque rectangle. -
trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm
r175756 r175759 3706 3706 } 3707 3707 3708 - (void)saveBackForwardSnapshotForItem:(WKBackForwardListItemRef)item 3709 { 3710 _data->_page->recordNavigationSnapshot(*toImpl(item)); 3711 } 3712 3708 3713 - (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef 3709 3714 { -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r175756 r175759 907 907 void WebPageProxy::recordNavigationSnapshot() 908 908 { 909 if (WebBackForwardListItem* item = m_backForwardList->currentItem()) 910 recordNavigationSnapshot(*item); 911 } 912 913 void WebPageProxy::recordNavigationSnapshot(WebBackForwardListItem& item) 914 { 909 915 if (!m_shouldRecordNavigationSnapshots) 910 916 return; 911 917 912 918 #if PLATFORM(COCOA) 913 ViewSnapshotStore::shared().recordSnapshot(*this); 919 ViewSnapshotStore::shared().recordSnapshot(*this, item); 920 #else 921 UNUSED_PARAM(item); 914 922 #endif 915 923 } -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r175637 r175759 901 901 void setShouldRecordNavigationSnapshots(bool shouldRecordSnapshots) { m_shouldRecordNavigationSnapshots = shouldRecordSnapshots; } 902 902 void recordNavigationSnapshot(); 903 void recordNavigationSnapshot(WebBackForwardListItem&); 903 904 904 905 #if PLATFORM(COCOA) -
trunk/Source/WebKit2/UIProcess/mac/ViewSnapshotStore.h
r171239 r175759 118 118 static ViewSnapshotStore& shared(); 119 119 120 void recordSnapshot(WebPageProxy& );120 void recordSnapshot(WebPageProxy&, WebBackForwardListItem&); 121 121 122 122 void discardSnapshotImages(); -
trunk/Source/WebKit2/UIProcess/mac/ViewSnapshotStore.mm
r171239 r175759 107 107 } 108 108 109 void ViewSnapshotStore::recordSnapshot(WebPageProxy& webPageProxy )109 void ViewSnapshotStore::recordSnapshot(WebPageProxy& webPageProxy, WebBackForwardListItem& item) 110 110 { 111 111 if (webPageProxy.isShowingNavigationGestureSnapshot()) 112 112 return; 113 113 114 WebBackForwardListItem* item = webPageProxy.backForwardList().currentItem();115 116 if (!item)117 return;118 119 114 pruneSnapshots(webPageProxy); 120 115 121 webPageProxy.willRecordNavigationSnapshot( *item);116 webPageProxy.willRecordNavigationSnapshot(item); 122 117 123 118 RefPtr<ViewSnapshot> snapshot = webPageProxy.takeViewSnapshot(); … … 129 124 snapshot->setBackgroundColor(webPageProxy.pageExtendedBackgroundColor()); 130 125 131 item ->setSnapshot(snapshot.release());126 item.setSnapshot(snapshot.release()); 132 127 } 133 128
Note: See TracChangeset
for help on using the changeset viewer.