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

andersca at apple.com andersca at apple.com
Wed Dec 22 18:26:49 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit fcb497f212a91e0ef87810c0107c069c47f7bb99
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 10 23:49:59 2010 +0000

    Make WKContextGetStatistics gather global statistics
    https://bugs.webkit.org/show_bug.cgi?id=50850
    
    Reviewed by John Sullivan.
    
    WebKit2:
    
    Change WKContextGetStatistics to work on all objects in the process, and
    make it more robust by incrementing/decrementing the counts in the constructor
    and destructor respectively.
    
    Also, rename WKContextGetStatistics to WKContextGetGlobalStatistics to better match
    what it's actually doing.
    
    * UIProcess/API/C/WKContext.cpp:
    (WKContextGetStatistics):
    * UIProcess/API/C/WKContextPrivate.h:
    * UIProcess/API/mac/WKView.mm:
    (-[WKView initWithFrame:pageNamespaceRef:pageGroupRef:]):
    (-[WKView dealloc]):
    * UIProcess/WebContext.cpp:
    (WebKit::WebContext::statistics):
    * UIProcess/WebContext.h:
    * UIProcess/WebFrameProxy.cpp:
    (WebKit::WebFrameProxy::WebFrameProxy):
    (WebKit::WebFrameProxy::~WebFrameProxy):
    * UIProcess/WebPageNamespace.cpp:
    * UIProcess/WebPageNamespace.h:
    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::WebPageProxy):
    (WebKit::WebPageProxy::~WebPageProxy):
    * UIProcess/WebPageProxy.h:
    
    WebKitTools:
    
    Remove the code that gets the statistics and fills in the per context
    statistics information for now.
    
    * MiniBrowser/mac/BrowserStatisticsWindowController.m:
    (-[BrowserStatisticsWindowController refreshStatistics:]):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73816 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 2453001..00f9652 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,36 @@
+2010-12-10  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by John Sullivan.
+
+        Make WKContextGetStatistics gather global statistics
+        https://bugs.webkit.org/show_bug.cgi?id=50850
+
+        Change WKContextGetStatistics to work on all objects in the process, and
+        make it more robust by incrementing/decrementing the counts in the constructor
+        and destructor respectively. 
+        
+        Also, rename WKContextGetStatistics to WKContextGetGlobalStatistics to better match
+        what it's actually doing.
+
+        * UIProcess/API/C/WKContext.cpp:
+        (WKContextGetStatistics):
+        * UIProcess/API/C/WKContextPrivate.h:
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView initWithFrame:pageNamespaceRef:pageGroupRef:]):
+        (-[WKView dealloc]):
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::statistics):
+        * UIProcess/WebContext.h:
+        * UIProcess/WebFrameProxy.cpp:
+        (WebKit::WebFrameProxy::WebFrameProxy):
+        (WebKit::WebFrameProxy::~WebFrameProxy):
+        * UIProcess/WebPageNamespace.cpp:
+        * UIProcess/WebPageNamespace.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::WebPageProxy):
+        (WebKit::WebPageProxy::~WebPageProxy):
+        * UIProcess/WebPageProxy.h:
+
 2010-12-10  Brian Weinstein  <bweinstein at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebKit2/UIProcess/API/C/WKContext.cpp b/WebKit2/UIProcess/API/C/WKContext.cpp
index 300cc94..2080ed8 100644
--- a/WebKit2/UIProcess/API/C/WKContext.cpp
+++ b/WebKit2/UIProcess/API/C/WKContext.cpp
@@ -92,9 +92,13 @@ void WKContextPostMessageToInjectedBundle(WKContextRef contextRef, WKStringRef m
     toImpl(contextRef)->postMessageToInjectedBundle(toImpl(messageNameRef)->string(), toImpl(messageBodyRef));
 }
 
-void WKContextGetStatistics(WKContextRef contextRef, WKContextStatistics* statistics)
+void WKContextGetGlobalStatistics(WKContextStatistics* statistics)
 {
-    toImpl(contextRef)->getStatistics(statistics);
+    const WebContext::Statistics& webContextStatistics = WebContext::statistics();
+
+    statistics->wkViewCount = webContextStatistics.wkViewCount;
+    statistics->wkPageCount = webContextStatistics.wkPageCount;
+    statistics->wkFrameCount = webContextStatistics.wkViewCount;
 }
 
 void WKContextAddVisitedLink(WKContextRef contextRef, WKStringRef visitedURL)
diff --git a/WebKit2/UIProcess/API/C/WKContextPrivate.h b/WebKit2/UIProcess/API/C/WKContextPrivate.h
index 0151e9d..96abb82 100644
--- a/WebKit2/UIProcess/API/C/WKContextPrivate.h
+++ b/WebKit2/UIProcess/API/C/WKContextPrivate.h
@@ -34,13 +34,13 @@ extern "C" {
 #endif
 
 struct WKContextStatistics {
-    size_t numberOfWKPageNamespaces;
-    size_t numberOfWKPages;
-    size_t numberOfWKFrames;
+    unsigned wkViewCount;
+    unsigned wkPageCount;
+    unsigned wkFrameCount;
 };
 typedef struct WKContextStatistics WKContextStatistics;
 
-WK_EXPORT void WKContextGetStatistics(WKContextRef context, WKContextStatistics* statistics);
+WK_EXPORT void WKContextGetGlobalStatistics(WKContextStatistics* statistics);
 
 WK_EXPORT WKContextRef WKContextGetSharedThreadContext();
 
diff --git a/WebKit2/UIProcess/API/mac/WKView.mm b/WebKit2/UIProcess/API/mac/WKView.mm
index 309466e..c75e8a3 100644
--- a/WebKit2/UIProcess/API/mac/WKView.mm
+++ b/WebKit2/UIProcess/API/mac/WKView.mm
@@ -163,6 +163,8 @@ struct EditCommandState {
     _data->_hasMarkedText = NO;
     _data->_selectedRange = NSMakeRange(NSNotFound, 0);
 
+    WebContext::statistics().wkViewCount++;
+
     return self;
 }
 
@@ -182,6 +184,9 @@ struct EditCommandState {
     _data->_page->close();
 
     [_data release];
+
+    WebContext::statistics().wkViewCount--;
+
     [super dealloc];
 }
 
diff --git a/WebKit2/UIProcess/WebContext.cpp b/WebKit2/UIProcess/WebContext.cpp
index 3cae3a6..1b68f0f 100644
--- a/WebKit2/UIProcess/WebContext.cpp
+++ b/WebKit2/UIProcess/WebContext.cpp
@@ -308,14 +308,11 @@ void WebContext::populateVisitedLinks()
     m_historyClient.populateVisitedLinks(this);
 }
 
-void WebContext::getStatistics(WKContextStatistics* statistics)
+WebContext::Statistics& WebContext::statistics()
 {
-    memset(statistics, 0, sizeof(WKContextStatistics));
+    static Statistics statistics = Statistics();
 
-    statistics->numberOfWKPageNamespaces = m_pageNamespaces.size();
-
-    for (HashSet<WebPageNamespace*>::iterator it = m_pageNamespaces.begin(), end = m_pageNamespaces.end(); it != end; ++it)
-        (*it)->getStatistics(statistics);
+    return statistics;
 }
 
 void WebContext::setAdditionalPluginsDirectory(const String& directory)
diff --git a/WebKit2/UIProcess/WebContext.h b/WebKit2/UIProcess/WebContext.h
index 1aa5527..7e4b5b1 100644
--- a/WebKit2/UIProcess/WebContext.h
+++ b/WebKit2/UIProcess/WebContext.h
@@ -93,7 +93,6 @@ public:
 
     void populateVisitedLinks();
     
-    void getStatistics(WKContextStatistics* statistics);
     void setAdditionalPluginsDirectory(const String&);
 
     PluginInfoStore* pluginInfoStore() { return &m_pluginInfoStore; }
@@ -127,6 +126,13 @@ public:
 
     WebDatabaseManagerProxy* databaseManagerProxy() const { return m_databaseManagerProxy.get(); }
 
+    struct Statistics {
+        unsigned wkViewCount;
+        unsigned wkPageCount;
+        unsigned wkFrameCount;
+    };
+    static Statistics& statistics();
+
 private:
     WebContext(ProcessModel, const String& injectedBundlePath);
 
diff --git a/WebKit2/UIProcess/WebFrameProxy.cpp b/WebKit2/UIProcess/WebFrameProxy.cpp
index 73b321d..244de87 100644
--- a/WebKit2/UIProcess/WebFrameProxy.cpp
+++ b/WebKit2/UIProcess/WebFrameProxy.cpp
@@ -44,10 +44,12 @@ WebFrameProxy::WebFrameProxy(WebPageProxy* page, uint64_t frameID)
     , m_isFrameSet(false)
     , m_frameID(frameID)
 {
+    WebContext::statistics().wkFrameCount++;
 }
 
 WebFrameProxy::~WebFrameProxy()
 {
+    WebContext::statistics().wkFrameCount--;
 }
 
 void WebFrameProxy::disconnect()
diff --git a/WebKit2/UIProcess/WebPageNamespace.cpp b/WebKit2/UIProcess/WebPageNamespace.cpp
index 6bf047f..9b2d7b3 100644
--- a/WebKit2/UIProcess/WebPageNamespace.cpp
+++ b/WebKit2/UIProcess/WebPageNamespace.cpp
@@ -62,15 +62,4 @@ WebPageProxy* WebPageNamespace::createWebPage(WebPageGroup* group)
     return m_context->createWebPage(this, group);
 }
 
-void WebPageNamespace::getStatistics(WKContextStatistics* statistics)
-{
-    if (!process())
-        return;
-
-    statistics->numberOfWKPages += process()->numberOfPages();
-
-    for (WebProcessProxy::pages_const_iterator it = process()->pages_begin(), end = process()->pages_end(); it != end; ++it)
-        (*it)->getStatistics(statistics);
-}
-
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/WebPageNamespace.h b/WebKit2/UIProcess/WebPageNamespace.h
index 11b577b..c852f39 100644
--- a/WebKit2/UIProcess/WebPageNamespace.h
+++ b/WebKit2/UIProcess/WebPageNamespace.h
@@ -54,8 +54,6 @@ public:
     WebContext* context() const { return m_context.get(); }
     WebProcessProxy* process() const { return m_context->process(); }
 
-    void getStatistics(WKContextStatistics*);
-
 private:
     WebPageNamespace(WebContext*);
 
diff --git a/WebKit2/UIProcess/WebPageProxy.cpp b/WebKit2/UIProcess/WebPageProxy.cpp
index b635601..fd54982 100644
--- a/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/WebKit2/UIProcess/WebPageProxy.cpp
@@ -108,11 +108,15 @@ WebPageProxy::WebPageProxy(WebPageNamespace* pageNamespace, WebPageGroup* pageGr
     webPageProxyCounter.increment();
 #endif
 
+    WebContext::statistics().wkPageCount++;
+
     m_pageGroup->addPage(this);
 }
 
 WebPageProxy::~WebPageProxy()
 {
+    WebContext::statistics().wkPageCount--;
+
     m_pageGroup->removePage(this);
 
 #ifndef NDEBUG
@@ -717,11 +721,6 @@ void WebPageProxy::setResizesToContentsUsingLayoutSize(const WebCore::IntSize& t
 }
 #endif
 
-void WebPageProxy::getStatistics(WKContextStatistics* statistics)
-{
-    statistics->numberOfWKFrames += process()->frameCountInPage(this);
-}
-
 void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
 {
     if (messageID.is<CoreIPC::MessageClassDrawingAreaProxy>()) {
diff --git a/WebKit2/UIProcess/WebPageProxy.h b/WebKit2/UIProcess/WebPageProxy.h
index 26d5503..fd59719 100644
--- a/WebKit2/UIProcess/WebPageProxy.h
+++ b/WebKit2/UIProcess/WebPageProxy.h
@@ -262,8 +262,6 @@ public:
 
     void preferencesDidChange();
 
-    void getStatistics(WKContextStatistics*);
-
 #if ENABLE(TILED_BACKING_STORE)
     void setResizesToContentsUsingLayoutSize(const WebCore::IntSize&);
 #endif
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index cab6501..2f238b1 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,16 @@
+2010-12-10  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by John Sullivan.
+
+        Make WKContextGetStatistics gather global statistics
+        https://bugs.webkit.org/show_bug.cgi?id=50850
+
+        Remove the code that gets the statistics and fills in the per context
+        statistics information for now.
+
+        * MiniBrowser/mac/BrowserStatisticsWindowController.m:
+        (-[BrowserStatisticsWindowController refreshStatistics:]):
+
 2010-12-10  Eric Seidel  <eric at webkit.org>
 
         Unreviewed.
diff --git a/WebKitTools/MiniBrowser/mac/BrowserStatisticsWindowController.m b/WebKitTools/MiniBrowser/mac/BrowserStatisticsWindowController.m
index 28ddb7a..878821a 100644
--- a/WebKitTools/MiniBrowser/mac/BrowserStatisticsWindowController.m
+++ b/WebKitTools/MiniBrowser/mac/BrowserStatisticsWindowController.m
@@ -41,18 +41,7 @@
 
 - (IBAction)refreshStatistics:(id)sender
 {
-    WKContextStatistics threadStats;
-    WKContextGetStatistics(_threadContext, &threadStats);
-
-    WKContextStatistics processStats;
-    WKContextGetStatistics(_processContext, &processStats);
-
-    [[_basicStatsMatrix cellWithTag:11] setIntValue:processStats.numberOfWKPages];
-    [[_basicStatsMatrix cellWithTag:12] setIntValue:processStats.numberOfWKFrames];
-
-    [[_basicStatsMatrix cellWithTag:21] setIntValue:threadStats.numberOfWKPages];
-    [[_basicStatsMatrix cellWithTag:22] setIntValue:threadStats.numberOfWKFrames];
-
+    // FIXME: (Re-)implement.
 }
 
 @end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list