Changeset 74282 in webkit
- Timestamp:
- Dec 17, 2010 11:35:46 AM (13 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r74275 r74282 1 2010-12-17 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 WebKit2: Implement a title attribute per frame 6 https://bugs.webkit.org/show_bug.cgi?id=51266 7 8 Cache the title of each frame on the WebFrameProxy. Removes 9 the WebPageProxy's cache of the main frame title to just 10 access the main frame. 11 12 We clear the cached title on new committed loads and on failures 13 to load. 14 15 * UIProcess/API/C/WKFrame.cpp: 16 (WKFrameCopyTitle): 17 * UIProcess/API/C/WKFrame.h: 18 * UIProcess/WebFrameProxy.cpp: 19 (WebKit::WebFrameProxy::didCommitLoad): 20 (WebKit::WebFrameProxy::didFailLoad): 21 (WebKit::WebFrameProxy::didChangeTitle): 22 * UIProcess/WebFrameProxy.h: 23 (WebKit::WebFrameProxy::title): 24 * UIProcess/WebPageProxy.cpp: 25 (WebKit::WebPageProxy::close): 26 (WebKit::WebPageProxy::pageTitle): 27 (WebKit::WebPageProxy::didReceiveTitleForFrame): 28 (WebKit::WebPageProxy::processDidCrash): 29 * UIProcess/WebPageProxy.h: 30 1 31 2010-12-16 Darin Adler <darin@apple.com> 2 32 -
trunk/WebKit2/UIProcess/API/C/WKFrame.cpp
r73591 r74282 77 77 } 78 78 79 WKStringRef WKFrameCopyTitle(WKFrameRef frameRef) 80 { 81 return toCopiedAPI(toImpl(frameRef)->title()); 82 } 83 79 84 WKPageRef WKFrameGetPage(WKFrameRef frameRef) 80 85 { -
trunk/WebKit2/UIProcess/API/C/WKFrame.h
r73591 r74282 50 50 WK_EXPORT WKURLRef WKFrameCopyProvisionalURL(WKFrameRef frame); 51 51 WK_EXPORT WKURLRef WKFrameCopyURL(WKFrameRef frame); 52 53 52 WK_EXPORT WKURLRef WKFrameCopyUnreachableURL(WKFrameRef frame); 54 53 55 54 WK_EXPORT WKStringRef WKFrameCopyMIMEType(WKFrameRef frame); 55 WK_EXPORT WKStringRef WKFrameCopyTitle(WKFrameRef frame); 56 56 57 57 WK_EXPORT WKPageRef WKFrameGetPage(WKFrameRef frame); -
trunk/WebKit2/UIProcess/WebFrameProxy.cpp
r73816 r74282 128 128 void WebFrameProxy::didCommitLoad() 129 129 { 130 // FIXME: Add assertions.131 130 m_loadState = LoadStateCommitted; 132 131 m_url = m_provisionalURL; 133 132 m_provisionalURL = String(); 133 m_title = String(); 134 134 } 135 135 … … 143 143 { 144 144 m_loadState = LoadStateFinished; 145 m_title = String(); 145 146 } 146 147 … … 150 151 } 151 152 152 void WebFrameProxy::did ReceiveTitle(const String&)153 void WebFrameProxy::didChangeTitle(const String& title) 153 154 { 155 m_title = title; 154 156 } 155 157 -
trunk/WebKit2/UIProcess/WebFrameProxy.h
r73591 r74282 85 85 const String& mimeType() const { return m_MIMEType; } 86 86 87 const String& title() const { return m_title; } 88 87 89 void setCertificateInfo(PassRefPtr<WebCertificateInfo>); 88 90 WebCertificateInfo* certificateInfo() const { return m_certificateInfo.get(); } … … 101 103 void didFailLoad(); 102 104 void didSameDocumentNavigation(const String&); // eg. anchor navigation, session state change. 103 void did ReceiveTitle(const String&);105 void didChangeTitle(const String&); 104 106 105 107 void receivedPolicyDecision(WebCore::PolicyAction, uint64_t listenerID); … … 118 120 String m_unreachableURL; 119 121 String m_MIMEType; 122 String m_title; 120 123 bool m_isFrameSet; 121 124 RefPtr<WebCertificateInfo> m_certificateInfo; -
trunk/WebKit2/UIProcess/WebPageProxy.cpp
r74275 r74282 239 239 } 240 240 241 m_pageTitle = String();242 241 m_toolTip = String(); 243 242 … … 624 623 } 625 624 625 String WebPageProxy::pageTitle() const 626 { 627 // Return the null string if there is no main frame (e.g. nothing has been loaded in the page yet, WebProcess has 628 // crashed, page has been closed). 629 if (!m_mainFrame) 630 return String(); 631 632 return m_mainFrame->title(); 633 } 634 626 635 void WebPageProxy::setUserAgent(const String& userAgent) 627 636 { … … 1015 1024 1016 1025 WebFrameProxy* frame = process()->webFrame(frameID); 1017 1018 frame->didReceiveTitle(title); 1019 1020 // Cache the title for the main frame in the page. 1021 if (frame == m_mainFrame) 1022 m_pageTitle = title; 1023 1026 frame->didChangeTitle(title); 1027 1024 1028 m_loaderClient.didReceiveTitleForFrame(this, title, frame, userData.get()); 1025 1029 } … … 1715 1719 } 1716 1720 1717 m_pageTitle = String();1718 1721 m_toolTip = String(); 1719 1722 -
trunk/WebKit2/UIProcess/WebPageProxy.h
r74275 r74282 202 202 #endif 203 203 204 const String& pageTitle() const { return m_pageTitle; }204 String pageTitle() const; 205 205 const String& toolTip() const { return m_toolTip; } 206 206 … … 436 436 RefPtr<WebFrameProxy> m_mainFrame; 437 437 RefPtr<WebFrameProxy> m_focusedFrame; 438 String m_pageTitle;439 438 440 439 String m_userAgent;
Note: See TracChangeset
for help on using the changeset viewer.