[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

weinig at apple.com weinig at apple.com
Wed Dec 22 18:46:37 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 6e2d323e17730ae7190303169b8d5acda7e63e3c
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 17 19:35:46 2010 +0000

    WebKit2: Implement a title attribute per frame
    https://bugs.webkit.org/show_bug.cgi?id=51266
    
    Reviewed by Darin Adler.
    
    Cache the title of each frame on the WebFrameProxy. Removes
    the WebPageProxy's cache of the main frame title to just
    access the main frame.
    
    We clear the cached title on new committed loads and on failures
    to load.
    
    * UIProcess/API/C/WKFrame.cpp:
    (WKFrameCopyTitle):
    * UIProcess/API/C/WKFrame.h:
    * UIProcess/WebFrameProxy.cpp:
    (WebKit::WebFrameProxy::didCommitLoad):
    (WebKit::WebFrameProxy::didFailLoad):
    (WebKit::WebFrameProxy::didChangeTitle):
    * UIProcess/WebFrameProxy.h:
    (WebKit::WebFrameProxy::title):
    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::close):
    (WebKit::WebPageProxy::pageTitle):
    (WebKit::WebPageProxy::didReceiveTitleForFrame):
    (WebKit::WebPageProxy::processDidCrash):
    * UIProcess/WebPageProxy.h:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74282 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 69ae661..0d02ded 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,33 @@
+2010-12-17  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Darin Adler.
+
+        WebKit2: Implement a title attribute per frame
+        https://bugs.webkit.org/show_bug.cgi?id=51266
+
+        Cache the title of each frame on the WebFrameProxy. Removes
+        the WebPageProxy's cache of the main frame title to just
+        access the main frame.
+
+        We clear the cached title on new committed loads and on failures
+        to load.
+
+        * UIProcess/API/C/WKFrame.cpp:
+        (WKFrameCopyTitle):
+        * UIProcess/API/C/WKFrame.h:
+        * UIProcess/WebFrameProxy.cpp:
+        (WebKit::WebFrameProxy::didCommitLoad):
+        (WebKit::WebFrameProxy::didFailLoad):
+        (WebKit::WebFrameProxy::didChangeTitle):
+        * UIProcess/WebFrameProxy.h:
+        (WebKit::WebFrameProxy::title):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::close):
+        (WebKit::WebPageProxy::pageTitle):
+        (WebKit::WebPageProxy::didReceiveTitleForFrame):
+        (WebKit::WebPageProxy::processDidCrash):
+        * UIProcess/WebPageProxy.h:
+
 2010-12-16  Darin Adler  <darin at apple.com>
 
         Reviewed by Maciej Stachowiak.
diff --git a/WebKit2/UIProcess/API/C/WKFrame.cpp b/WebKit2/UIProcess/API/C/WKFrame.cpp
index 7bcd77c..84acb4f 100644
--- a/WebKit2/UIProcess/API/C/WKFrame.cpp
+++ b/WebKit2/UIProcess/API/C/WKFrame.cpp
@@ -76,6 +76,11 @@ WKStringRef WKFrameCopyMIMEType(WKFrameRef frameRef)
     return toCopiedAPI(toImpl(frameRef)->mimeType());
 }
 
+WKStringRef WKFrameCopyTitle(WKFrameRef frameRef)
+{
+    return toCopiedAPI(toImpl(frameRef)->title());
+}
+
 WKPageRef WKFrameGetPage(WKFrameRef frameRef)
 {
     return toAPI(toImpl(frameRef)->page());
diff --git a/WebKit2/UIProcess/API/C/WKFrame.h b/WebKit2/UIProcess/API/C/WKFrame.h
index a74063e..0784bf0 100644
--- a/WebKit2/UIProcess/API/C/WKFrame.h
+++ b/WebKit2/UIProcess/API/C/WKFrame.h
@@ -49,10 +49,10 @@ WK_EXPORT bool WKFrameIsMainFrame(WKFrameRef frame);
 WK_EXPORT WKFrameLoadState WKFrameGetFrameLoadState(WKFrameRef frame);
 WK_EXPORT WKURLRef WKFrameCopyProvisionalURL(WKFrameRef frame);
 WK_EXPORT WKURLRef WKFrameCopyURL(WKFrameRef frame);
-
 WK_EXPORT WKURLRef WKFrameCopyUnreachableURL(WKFrameRef frame);
 
 WK_EXPORT WKStringRef WKFrameCopyMIMEType(WKFrameRef frame);
+WK_EXPORT WKStringRef WKFrameCopyTitle(WKFrameRef frame);
 
 WK_EXPORT WKPageRef WKFrameGetPage(WKFrameRef frame);
 
diff --git a/WebKit2/UIProcess/WebFrameProxy.cpp b/WebKit2/UIProcess/WebFrameProxy.cpp
index 244de87..65569d1 100644
--- a/WebKit2/UIProcess/WebFrameProxy.cpp
+++ b/WebKit2/UIProcess/WebFrameProxy.cpp
@@ -127,10 +127,10 @@ void WebFrameProxy::didFailProvisionalLoad()
 
 void WebFrameProxy::didCommitLoad()
 {
-    // FIXME: Add assertions.
     m_loadState = LoadStateCommitted;
     m_url = m_provisionalURL;
     m_provisionalURL = String();
+    m_title = String();
 }
 
 void WebFrameProxy::didFinishLoad()
@@ -142,6 +142,7 @@ void WebFrameProxy::didFinishLoad()
 void WebFrameProxy::didFailLoad()
 {
     m_loadState = LoadStateFinished;
+    m_title = String();
 }
 
 void WebFrameProxy::didSameDocumentNavigation(const String& url)
@@ -149,8 +150,9 @@ void WebFrameProxy::didSameDocumentNavigation(const String& url)
     m_url = url;
 }
 
-void WebFrameProxy::didReceiveTitle(const String&)
+void WebFrameProxy::didChangeTitle(const String& title)
 {
+    m_title = title;
 }
 
 void WebFrameProxy::receivedPolicyDecision(WebCore::PolicyAction action, uint64_t listenerID)
diff --git a/WebKit2/UIProcess/WebFrameProxy.h b/WebKit2/UIProcess/WebFrameProxy.h
index 548bc45..01a9233 100644
--- a/WebKit2/UIProcess/WebFrameProxy.h
+++ b/WebKit2/UIProcess/WebFrameProxy.h
@@ -84,6 +84,8 @@ public:
     void setMIMEType(const String& mimeType) { m_MIMEType = mimeType; }
     const String& mimeType() const { return m_MIMEType; }
 
+    const String& title() const { return m_title; }
+
     void setCertificateInfo(PassRefPtr<WebCertificateInfo>);
     WebCertificateInfo* certificateInfo() const { return m_certificateInfo.get(); }
 
@@ -100,7 +102,7 @@ public:
     void didFinishLoad();
     void didFailLoad();
     void didSameDocumentNavigation(const String&); // eg. anchor navigation, session state change.
-    void didReceiveTitle(const String&);
+    void didChangeTitle(const String&);
 
     void receivedPolicyDecision(WebCore::PolicyAction, uint64_t listenerID);
     WebFramePolicyListenerProxy* setUpPolicyListenerProxy(uint64_t listenerID);
@@ -117,6 +119,7 @@ private:
     String m_provisionalURL;
     String m_unreachableURL;
     String m_MIMEType;
+    String m_title;
     bool m_isFrameSet;
     RefPtr<WebCertificateInfo> m_certificateInfo;
     RefPtr<WebFrameListenerProxy> m_activeListener;
diff --git a/WebKit2/UIProcess/WebPageProxy.cpp b/WebKit2/UIProcess/WebPageProxy.cpp
index 58391e3..70b4888 100644
--- a/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/WebKit2/UIProcess/WebPageProxy.cpp
@@ -238,7 +238,6 @@ void WebPageProxy::close()
         m_openPanelResultListener = 0;
     }
 
-    m_pageTitle = String();
     m_toolTip = String();
 
     invalidateCallbackMap(m_contentsAsStringCallbacks);
@@ -623,6 +622,16 @@ void WebPageProxy::receivedPolicyDecision(PolicyAction action, WebFrameProxy* fr
     process()->send(Messages::WebPage::DidReceivePolicyDecision(frame->frameID(), listenerID, action, downloadID), m_pageID);
 }
 
+String WebPageProxy::pageTitle() const
+{
+    // Return the null string if there is no main frame (e.g. nothing has been loaded in the page yet, WebProcess has
+    // crashed, page has been closed).
+    if (!m_mainFrame)
+        return String();
+
+    return m_mainFrame->title();
+}
+
 void WebPageProxy::setUserAgent(const String& userAgent)
 {
     if (m_userAgent == userAgent)
@@ -1014,13 +1023,8 @@ void WebPageProxy::didReceiveTitleForFrame(uint64_t frameID, const String& title
         return;
 
     WebFrameProxy* frame = process()->webFrame(frameID);
-
-    frame->didReceiveTitle(title);
-
-    // Cache the title for the main frame in the page.
-    if (frame == m_mainFrame)
-        m_pageTitle = title;
-
+    frame->didChangeTitle(title);
+    
     m_loaderClient.didReceiveTitleForFrame(this, title, frame, userData.get());
 }
 
@@ -1714,7 +1718,6 @@ void WebPageProxy::processDidCrash()
         m_openPanelResultListener = 0;
     }
 
-    m_pageTitle = String();
     m_toolTip = String();
 
     invalidateCallbackMap(m_contentsAsStringCallbacks);
diff --git a/WebKit2/UIProcess/WebPageProxy.h b/WebKit2/UIProcess/WebPageProxy.h
index bd5f42f..6436d7e 100644
--- a/WebKit2/UIProcess/WebPageProxy.h
+++ b/WebKit2/UIProcess/WebPageProxy.h
@@ -201,7 +201,7 @@ public:
     void handleTouchEvent(const WebTouchEvent&);
 #endif
 
-    const String& pageTitle() const { return m_pageTitle; }
+    String pageTitle() const;
     const String& toolTip() const { return m_toolTip; }
 
     void setUserAgent(const String&);
@@ -435,7 +435,6 @@ private:
     RefPtr<WebPageGroup> m_pageGroup;
     RefPtr<WebFrameProxy> m_mainFrame;
     RefPtr<WebFrameProxy> m_focusedFrame;
-    String m_pageTitle;
 
     String m_userAgent;
     String m_applicationNameForUserAgent;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list