Changeset 64662 in webkit
- Timestamp:
- Aug 4, 2010 11:55:22 AM (14 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 3 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r64661 r64662 1 2010-08-04 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Lay the groundwork for saving/restoring page session state to WK2 6 https://bugs.webkit.org/show_bug.cgi?id=43495 7 8 * WebKit2.xcodeproj/project.pbxproj: 9 * win/WebKit2.vcproj: 10 11 * Shared/APIObject.h: 12 (WebKit::APIObject::): 13 * UIProcess/API/C/WKAPICast.h: 14 * UIProcess/API/C/WKBase.h: 15 16 Arbitrary byte buffer: 17 * Shared/WebData.h: Added. 18 (WebKit::WebData::create): 19 (WebKit::WebData::bytes): 20 (WebKit::WebData::size): 21 (WebKit::WebData::WebData): 22 (WebKit::WebData::type): 23 24 API facing object to act as a byte buffer: 25 * UIProcess/API/C/WKData.cpp: Added. 26 (WKDataGetTypeID): 27 (WKDataCreate): 28 (WKDataGetBytes): 29 (WKDataGetSize): 30 (WKDataRetain): 31 (WKDataRelease): 32 * UIProcess/API/C/WKData.h: Added. 33 34 API for saving/restoring state: 35 * UIProcess/API/C/WKPage.cpp: 36 (WKPageCopySessionState): 37 (WKPageRestoreFromSessionState): 38 * UIProcess/API/C/WKPage.h: 39 40 These will be filled in later: 41 * UIProcess/WebPageProxy.cpp: 42 (WebKit::WebPageProxy::sessionState): 43 (WebKit::WebPageProxy::restoreFromSessionState): 44 * UIProcess/WebPageProxy.h: 45 46 1 47 2010-08-04 Sam Weinig <sam@webkit.org> 2 48 -
trunk/WebKit2/Shared/APIObject.h
r64253 r64662 36 36 // Base types 37 37 TypeArray, 38 TypeData, 38 39 TypeString, 39 40 TypeURL, -
trunk/WebKit2/UIProcess/API/C/WKAPICast.h
r64255 r64662 43 43 class WebBackForwardListItem; 44 44 class WebContext; 45 class WebData; 45 46 class WebFramePolicyListenerProxy; 46 47 class WebFrameProxy; … … 53 54 template<typename APIType> struct APITypeInfo { }; 54 55 template<> struct APITypeInfo<WKTypeRef> { typedef APIObject* ImplType; }; 56 template<> struct APITypeInfo<WKArrayRef> { typedef ImmutableArray* ImplType; }; 57 template<> struct APITypeInfo<WKBackForwardListItemRef> { typedef WebBackForwardListItem* ImplType; }; 58 template<> struct APITypeInfo<WKBackForwardListRef> { typedef WebBackForwardList* ImplType; }; 59 template<> struct APITypeInfo<WKContextRef> { typedef WebContext* ImplType; }; 60 template<> struct APITypeInfo<WKDataRef> { typedef WebData* ImplType; }; 61 template<> struct APITypeInfo<WKFramePolicyListenerRef> { typedef WebFramePolicyListenerProxy* ImplType; }; 55 62 template<> struct APITypeInfo<WKFrameRef> { typedef WebFrameProxy* ImplType; }; 63 template<> struct APITypeInfo<WKNavigationDataRef> { typedef WebNavigationData* ImplType; }; 64 template<> struct APITypeInfo<WKPageNamespaceRef> { typedef WebPageNamespace* ImplType; }; 56 65 template<> struct APITypeInfo<WKPageRef> { typedef WebPageProxy* ImplType; }; 57 template<> struct APITypeInfo<WKContextRef> { typedef WebContext* ImplType; };58 template<> struct APITypeInfo<WKPageNamespaceRef> { typedef WebPageNamespace* ImplType; };59 template<> struct APITypeInfo<WKFramePolicyListenerRef> { typedef WebFramePolicyListenerProxy* ImplType; };60 66 template<> struct APITypeInfo<WKPreferencesRef> { typedef WebPreferences* ImplType; }; 61 67 template<> struct APITypeInfo<WKStringRef> { typedef WebString* ImplType; }; 62 68 template<> struct APITypeInfo<WKURLRef> { typedef WebURL* ImplType; }; 63 template<> struct APITypeInfo<WKNavigationDataRef> { typedef WebNavigationData* ImplType; }; 64 template<> struct APITypeInfo<WKArrayRef> { typedef ImmutableArray* ImplType; }; 65 template<> struct APITypeInfo<WKBackForwardListItemRef> { typedef WebBackForwardListItem* ImplType; }; 66 template<> struct APITypeInfo<WKBackForwardListRef> { typedef WebBackForwardList* ImplType; }; 69 67 70 68 71 template<typename ImplType> struct ImplTypeInfo { }; 69 72 template<> struct ImplTypeInfo<APIObject*> { typedef WKTypeRef APIType; }; 73 template<> struct ImplTypeInfo<ImmutableArray*> { typedef WKArrayRef APIType; }; 74 template<> struct ImplTypeInfo<WebBackForwardList*> { typedef WKBackForwardListRef APIType; }; 75 template<> struct ImplTypeInfo<WebBackForwardListItem*> { typedef WKBackForwardListItemRef APIType; }; 76 template<> struct ImplTypeInfo<WebContext*> { typedef WKContextRef APIType; }; 77 template<> struct ImplTypeInfo<WebData*> { typedef WKDataRef APIType; }; 78 template<> struct ImplTypeInfo<WebFramePolicyListenerProxy*> { typedef WKFramePolicyListenerRef APIType; }; 70 79 template<> struct ImplTypeInfo<WebFrameProxy*> { typedef WKFrameRef APIType; }; 80 template<> struct ImplTypeInfo<WebNavigationData*> { typedef WKNavigationDataRef APIType; }; 81 template<> struct ImplTypeInfo<WebPageNamespace*> { typedef WKPageNamespaceRef APIType; }; 71 82 template<> struct ImplTypeInfo<WebPageProxy*> { typedef WKPageRef APIType; }; 72 template<> struct ImplTypeInfo<WebContext*> { typedef WKContextRef APIType; };73 template<> struct ImplTypeInfo<WebPageNamespace*> { typedef WKPageNamespaceRef APIType; };74 template<> struct ImplTypeInfo<WebFramePolicyListenerProxy*> { typedef WKFramePolicyListenerRef APIType; };75 83 template<> struct ImplTypeInfo<WebPreferences*> { typedef WKPreferencesRef APIType; }; 76 84 template<> struct ImplTypeInfo<WebString*> { typedef WKStringRef APIType; }; 77 85 template<> struct ImplTypeInfo<WebURL*> { typedef WKURLRef APIType; }; 78 template<> struct ImplTypeInfo<WebNavigationData*> { typedef WKNavigationDataRef APIType; }; 79 template<> struct ImplTypeInfo<ImmutableArray*> { typedef WKArrayRef APIType; }; 80 template<> struct ImplTypeInfo<WebBackForwardListItem*> { typedef WKBackForwardListItemRef APIType; }; 81 template<> struct ImplTypeInfo<WebBackForwardList*> { typedef WKBackForwardListRef APIType; }; 86 82 87 83 88 template<typename ImplType, typename APIType = typename ImplTypeInfo<ImplType*>::APIType> -
trunk/WebKit2/UIProcess/API/C/WKBase.h
r64380 r64662 40 40 typedef struct OpaqueWKBackForwardListRef* WKBackForwardListRef; 41 41 typedef struct OpaqueWKContext* WKContextRef; 42 typedef struct OpaqueWKData* WKDataRef; 42 43 typedef struct OpaqueWKFrame* WKFrameRef; 43 44 typedef struct OpaqueWKFramePolicyListener* WKFramePolicyListenerRef; -
trunk/WebKit2/UIProcess/API/C/WKPage.cpp
r64386 r64662 29 29 #include "WKAPICast.h" 30 30 #include "WebBackForwardList.h" 31 #include "WebData.h" 31 32 #include "WebPageProxy.h" 32 33 … … 132 133 } 133 134 135 WKDataRef WKPageCopySessionState(WKPageRef pageRef) 136 { 137 RefPtr<WebData> state = toWK(pageRef)->sessionState(); 138 return toRef(state.release().releaseRef()); 139 } 140 141 void WKPageRestoreFromSessionState(WKPageRef pageRef, WKDataRef sessionStateData) 142 { 143 toWK(pageRef)->restoreFromSessionState(toWK(sessionStateData)); 144 } 145 134 146 void WKPageSetPageLoaderClient(WKPageRef pageRef, const WKPageLoaderClient* wkClient) 135 147 { -
trunk/WebKit2/UIProcess/API/C/WKPage.h
r64317 r64662 161 161 WK_EXPORT void WKPageTerminate(WKPageRef page); 162 162 163 WK_EXPORT WKDataRef WKPageCopySessionState(WKPageRef page); 164 WK_EXPORT void WKPageRestoreFromSessionState(WKPageRef page, WKDataRef sessionStateData); 165 163 166 WK_EXPORT void WKPageSetPageLoaderClient(WKPageRef page, const WKPageLoaderClient* client); 164 167 WK_EXPORT void WKPageSetPagePolicyClient(WKPageRef page, const WKPagePolicyClient* client); -
trunk/WebKit2/UIProcess/WebPageProxy.cpp
r64594 r64662 33 33 #include "WebContext.h" 34 34 #include "WebCoreArgumentCoders.h" 35 #include "WebData.h" 35 36 #include "WebEvent.h" 36 37 #include "WebPageMessageKinds.h" … … 339 340 340 341 process()->terminate(); 342 } 343 344 PassRefPtr<WebData> WebPageProxy::sessionState() const 345 { 346 // FIXME: Return session state data for saving Page state. 347 return 0; 348 } 349 350 void WebPageProxy::restoreFromSessionState(WebData*) 351 { 352 // FIXME: Restore the Page from the passed in session state data. 341 353 } 342 354 -
trunk/WebKit2/UIProcess/WebPageProxy.h
r64485 r64662 64 64 class WebBackForwardList; 65 65 class WebBackForwardListItem; 66 class WebData; 66 67 class WebKeyboardEvent; 67 68 class WebMouseEvent; … … 131 132 132 133 void terminateProcess(); 134 135 PassRefPtr<WebData> sessionState() const; 136 void restoreFromSessionState(WebData*); 133 137 134 138 void runJavaScriptInMainFrame(const WebCore::String&, PassRefPtr<ScriptReturnValueCallback>); -
trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj
r64594 r64662 87 87 1AEFD2F711D1807B008219D3 /* ArgumentCoders.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AEFD2F611D1807B008219D3 /* ArgumentCoders.h */; }; 88 88 1AF3060A111B599E00F96436 /* WebKit2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* WebKit2.framework */; }; 89 514AF6C81209EE7300A26C97 /* WKData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514AF6C61209EE7300A26C97 /* WKData.cpp */; }; 90 514AF6C91209EE7300A26C97 /* WKData.h in Headers */ = {isa = PBXBuildFile; fileRef = 514AF6C71209EE7300A26C97 /* WKData.h */; }; 91 51578B831209ECEF00A37C4A /* WebData.h in Headers */ = {isa = PBXBuildFile; fileRef = 51578B821209ECEF00A37C4A /* WebData.h */; }; 89 92 5DAD729C116FF86200EE5396 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; }; 90 93 6D8A91A611F0EFD100DD01FE /* com.apple.WebProcess.sb in Resources */ = {isa = PBXBuildFile; fileRef = 6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb */; }; … … 389 392 1AEFD2F611D1807B008219D3 /* ArgumentCoders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArgumentCoders.h; sourceTree = "<group>"; }; 390 393 32DBCF5E0370ADEE00C91783 /* WebKit2Prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKit2Prefix.h; sourceTree = "<group>"; }; 394 514AF6C61209EE7300A26C97 /* WKData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKData.cpp; sourceTree = "<group>"; }; 395 514AF6C71209EE7300A26C97 /* WKData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKData.h; sourceTree = "<group>"; }; 396 51578B821209ECEF00A37C4A /* WebData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebData.h; sourceTree = "<group>"; }; 391 397 5DAD7294116FF70B00EE5396 /* WebProcess.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebProcess.xcconfig; sourceTree = "<group>"; }; 392 398 5DAD73F1116FF90C00EE5396 /* BaseTarget.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = BaseTarget.xcconfig; sourceTree = "<group>"; }; … … 773 779 0FB659221208B4DB0044816C /* DrawingAreaBase.h */, 774 780 0FB659A51208B9EE0044816C /* DrawingAreaBase.cpp */, 775 BCF04C8E11FF9F6E00F86A58 /* WebString.h */,776 BCDB86C01200FB97007254BE /* WebURL.h */,777 781 1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */, 778 782 BC64696D11DBE603006455B0 /* ImmutableArray.cpp */, … … 780 784 BCC57161115ADB42001CCAF9 /* NotImplemented.h */, 781 785 BC1DD7B1114DC396005ADAF3 /* WebCoreArgumentCoders.h */, 786 51578B821209ECEF00A37C4A /* WebData.h */, 782 787 BC032DAF10F4380F0058C15A /* WebEvent.h */, 783 788 BC032DB010F4380F0058C15A /* WebEventConversion.cpp */, … … 786 791 BCD598AB112B7FDF00EC8C23 /* WebPreferencesStore.cpp */, 787 792 BCD598AA112B7FDF00EC8C23 /* WebPreferencesStore.h */, 793 BCF04C8E11FF9F6E00F86A58 /* WebString.h */, 794 BCDB86C01200FB97007254BE /* WebURL.h */, 788 795 ); 789 796 path = Shared; … … 983 990 BCB9E2491120E15C00A137E0 /* WKContext.h */, 984 991 BCC938E01180DE440085E5FE /* WKContextPrivate.h */, 992 514AF6C61209EE7300A26C97 /* WKData.cpp */, 993 514AF6C71209EE7300A26C97 /* WKData.h */, 985 994 BCD01398110FA420003B8A67 /* WKFrame.cpp */, 986 995 BCD01397110FA420003B8A67 /* WKFrame.h */, … … 1347 1356 D3B9484911FF4B6500032B39 /* WebSearchPopupMenu.h in Headers */, 1348 1357 0FB659231208B4DB0044816C /* DrawingAreaBase.h in Headers */, 1358 51578B831209ECEF00A37C4A /* WebData.h in Headers */, 1359 514AF6C91209EE7300A26C97 /* WKData.h in Headers */, 1349 1360 ); 1350 1361 runOnlyForDeploymentPostprocessing = 0; … … 1551 1562 D3B9484811FF4B6500032B39 /* WebSearchPopupMenu.cpp in Sources */, 1552 1563 0FB659A61208B9EE0044816C /* DrawingAreaBase.cpp in Sources */, 1564 514AF6C81209EE7300A26C97 /* WKData.cpp in Sources */, 1553 1565 ); 1554 1566 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebKit2/win/WebKit2.vcproj
r64645 r64662 974 974 </File> 975 975 <File 976 RelativePath="..\UIProcess\WebData.h" 977 > 978 </File> 979 <File 976 980 RelativePath="..\UIProcess\WebFramePolicyListenerProxy.cpp" 977 981 > … … 1121 1125 <File 1122 1126 RelativePath="..\UIProcess\API\C\WKContextPrivate.h" 1127 > 1128 </File> 1129 <File 1130 RelativePath="..\UIProcess\API\C\WKData.cpp" 1131 > 1132 </File> 1133 <File 1134 RelativePath="..\UIProcess\API\C\WKData.h" 1123 1135 > 1124 1136 </File>
Note: See TracChangeset
for help on using the changeset viewer.