[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

darin at chromium.org darin at chromium.org
Thu Apr 8 01:27:17 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 0ce9774c83f1ccb2ce289a09b13c52d9c430504c
Author: darin at chromium.org <darin at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jan 27 19:15:13 2010 +0000

    2010-01-26  Darin Fisher  <darin at chromium.org>
    
            Reviewed by David Levin.
    
            Add methods to support running a nested modal loop outside of WebKit.
            https://bugs.webkit.org/show_bug.cgi?id=34199
    
            * public/WebView.h:
            * src/WebViewImpl.cpp:
            (WebKit::WebView::willEnterModalLoop): Create PageGroupLoadDeferrer
            (WebKit::WebView::didExitModalLoop): Destroy PageGroupLoadDeferrer
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53943 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index b1ae94c..a043c6b 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,15 @@
+2010-01-26  Darin Fisher  <darin at chromium.org>
+
+        Reviewed by David Levin.
+
+        Add methods to support running a nested modal loop outside of WebKit.
+        https://bugs.webkit.org/show_bug.cgi?id=34199
+
+        * public/WebView.h:
+        * src/WebViewImpl.cpp:
+        (WebKit::WebView::willEnterModalLoop): Create PageGroupLoadDeferrer
+        (WebKit::WebView::didExitModalLoop): Destroy PageGroupLoadDeferrer
+
 2010-01-27  Darin Fisher  <darin at chromium.org>
 
         Reviewed by Dimitri Glazkov.
diff --git a/WebKit/chromium/public/WebView.h b/WebKit/chromium/public/WebView.h
index c31667f..aba556c 100644
--- a/WebKit/chromium/public/WebView.h
+++ b/WebKit/chromium/public/WebView.h
@@ -252,6 +252,7 @@ public:
 
 
     // Custom colors -------------------------------------------------------
+
     virtual void setScrollbarColors(unsigned inactiveColor,
                                     unsigned activeColor,
                                     unsigned trackColor) = 0;
@@ -261,6 +262,14 @@ public:
                                     unsigned inactiveBackgroundColor,
                                     unsigned inactiveForegroundColor) = 0;
 
+
+    // Modal dialog support ------------------------------------------------
+
+    // Call these methods before and after running a nested, modal event loop
+    // to suspend script callbacks and resource loads.
+    WEBKIT_API static void willEnterModalLoop();
+    WEBKIT_API static void didExitModalLoop();
+
 protected:
     ~WebView() {}
 };
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index 2418a4d..97825e9 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -66,6 +66,7 @@
 #include "NodeRenderStyle.h"
 #include "Page.h"
 #include "PageGroup.h"
+#include "PageGroupLoadDeferrer.h"
 #include "Pasteboard.h"
 #include "PlatformContextSkia.h"
 #include "PlatformKeyboardEvent.h"
@@ -130,6 +131,10 @@ static const double maxTextSizeMultiplier = 3.0;
 // one page group.
 const char* pageGroupName = "default";
 
+// Used to defer all page activity in cases where the embedder wishes to run
+// a nested event loop.
+static PageGroupLoadDeferrer* pageGroupLoadDeferrer;
+
 // Ensure that the WebDragOperation enum values stay in sync with the original
 // DragOperation constants.
 #define COMPILE_ASSERT_MATCHING_ENUM(coreName) \
@@ -175,6 +180,28 @@ void WebView::resetVisitedLinkState()
     Page::allVisitedStateChanged(PageGroup::pageGroup(pageGroupName));
 }
 
+void WebView::willEnterModalLoop()
+{
+    // It is not valid to nest more than once.
+    ASSERT(!pageGroupLoadDeferrer);
+
+    PageGroup* pageGroup = PageGroup::pageGroup(pageGroupName);
+    ASSERT(pageGroup);
+    ASSERT(!pageGroup->pages().isEmpty());
+
+    // Pick any page in the page group since we are deferring all pages.
+    pageGroupLoadDeferrer = new PageGroupLoadDeferrer(*pageGroup->pages().begin(), true);
+}
+
+void WebView::didExitModalLoop()
+{
+    // The embedder must have called willEnterNestedEventLoop.
+    ASSERT(pageGroupLoadDeferrer);
+
+    delete pageGroupLoadDeferrer;
+    pageGroupLoadDeferrer = 0;
+}
+
 void WebViewImpl::initializeMainFrame(WebFrameClient* frameClient)
 {
     // NOTE: The WebFrameImpl takes a reference to itself within InitMainFrame

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list