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

jberlin at webkit.org jberlin at webkit.org
Wed Dec 22 18:12:03 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit b646cd5e5876dff4f3e9c1de98422084b1c1ea45
Author: jberlin at webkit.org <jberlin at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 8 19:06:42 2010 +0000

    WebKit2: Implement WebChromeClient::exceededDatabaseQuota
    https://bugs.webkit.org/show_bug.cgi?id=50656
    
    Reviewed by Adam Roben.
    
    WebCore:
    
    * WebCore.exp.in:
    Export the symbol for SecurityOrigin::databaseIdentifier.
    
    WebKit2:
    
    The exceededDatabaseQuota call from the WebProcess to the UIProcess needs to be synchronous
    because the new quota is checked directly after exceededDatabaseQuota returns in order to
    determine if the new Database can be created.
    
    Pass all of the details from the WebProcess to the UIProcess in order to inform the
    decision in the UIProcess about the new quota. In WebKit1, these details were
    fetched through an additional call to the API detailsForDatabase (which is infeasible in
    WebKit2 since exceededDatabaseQuota is a synchronous call).
    
    * Platform/CoreIPC/HandleMessage.h:
    (CoreIPC::callMemberFunction):
    Add a version that takes 7 parameters.
    
    * UIProcess/API/C/WKPage.h:
    
    * UIProcess/API/qt/qwkpage.cpp:
    (QWKPage::QWKPage):
    Indicate that exceededDatabaseQuota is not implemented.
    
    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::exceededDatabaseQuota):
    Call the UIClient's exceededDatabaseQuota
    * UIProcess/WebPageProxy.h:
    * UIProcess/WebPageProxy.messages.in:
    
    * UIProcess/WebUIClient.cpp:
    (WebKit::WebUIClient::exceededDatabaseQuota):
    If the client does not implement exceededDatabaseQuota, return a the current quota.
    * UIProcess/WebUIClient.h:
    
    * WebProcess/WebCoreSupport/WebChromeClient.cpp:
    (WebKit::WebChromeClient::exceededDatabaseQuota):
    Send a synchronous message to the UIProcess to ask for the new quota for the origin for the
    given frame.
    
    WebKitTools:
    
    * MiniBrowser/mac/BrowserWindowController.m:
    (-[BrowserWindowController awakeFromNib]):
    Indicate that exceededDatabaseQuota is not implemented.
    * MiniBrowser/win/BrowserView.cpp:
    (BrowserView::create):
    Ditto.
    * WebKitTestRunner/TestController.cpp:
    (WTR::createOtherPage):
    Ditto.
    (WTR::TestController::initialize):
    Ditto.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73533 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7e8d219..ca4b77d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,13 @@
+2010-12-08  Jessie Berlin  <jberlin at apple.com>
+
+        Reviewed by Adam Roben.
+
+        WebKit2: Implement WebChromeClient::exceededDatabaseQuota
+        https://bugs.webkit.org/show_bug.cgi?id=50656
+
+        * WebCore.exp.in:
+        Export the symbol for SecurityOrigin::databaseIdentifier.
+
 2010-12-08  Csaba Osztrogonác  <ossy at webkit.org>
 
         Unreviewed, rolling out r73521.
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index c79eba7..e58d6fd 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -1007,6 +1007,7 @@ __ZNK7WebCore14RenderListItem10markerTextEv
 __ZNK7WebCore14ResourceHandle10connectionEv
 __ZNK7WebCore14ResourceLoader11frameLoaderEv
 __ZNK7WebCore14SecurityOrigin10canDisplayERKNS_4KURLE
+__ZNK7WebCore14SecurityOrigin18databaseIdentifierEv
 __ZNK7WebCore14SecurityOrigin5equalEPKS0_
 __ZNK7WebCore15FocusController18focusedOrMainFrameEv
 __ZNK7WebCore15GraphicsContext15platformContextEv
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 913e819..638774b 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,45 @@
+2010-12-08  Jessie Berlin  <jberlin at apple.com>
+
+        Reviewed by Adam Roben.
+
+        WebKit2: Implement WebChromeClient::exceededDatabaseQuota
+        https://bugs.webkit.org/show_bug.cgi?id=50656
+
+        The exceededDatabaseQuota call from the WebProcess to the UIProcess needs to be synchronous
+        because the new quota is checked directly after exceededDatabaseQuota returns in order to
+        determine if the new Database can be created.
+
+        Pass all of the details from the WebProcess to the UIProcess in order to inform the
+        decision in the UIProcess about the new quota. In WebKit1, these details were
+        fetched through an additional call to the API detailsForDatabase (which is infeasible in
+        WebKit2 since exceededDatabaseQuota is a synchronous call).
+
+        * Platform/CoreIPC/HandleMessage.h:
+        (CoreIPC::callMemberFunction):
+        Add a version that takes 7 parameters.
+
+        * UIProcess/API/C/WKPage.h:
+
+        * UIProcess/API/qt/qwkpage.cpp:
+        (QWKPage::QWKPage):
+        Indicate that exceededDatabaseQuota is not implemented.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::exceededDatabaseQuota):
+        Call the UIClient's exceededDatabaseQuota
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+
+        * UIProcess/WebUIClient.cpp:
+        (WebKit::WebUIClient::exceededDatabaseQuota):
+        If the client does not implement exceededDatabaseQuota, return a the current quota.
+        * UIProcess/WebUIClient.h:
+
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::exceededDatabaseQuota):
+        Send a synchronous message to the UIProcess to ask for the new quota for the origin for the
+        given frame.
+
 2010-12-07  Anders Carlsson  <andersca at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebKit2/Platform/CoreIPC/HandleMessage.h b/WebKit2/Platform/CoreIPC/HandleMessage.h
index 6adbe1d..4333cb6 100644
--- a/WebKit2/Platform/CoreIPC/HandleMessage.h
+++ b/WebKit2/Platform/CoreIPC/HandleMessage.h
@@ -133,6 +133,12 @@ void callMemberFunction(const Arguments4<P1, P2, P3, P4>& args, Arguments1<R1>&
     (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, replyArgs.argument1);
 }
 
+template<typename C, typename MF, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename R1>
+void callMemberFunction(const Arguments7<P1, P2, P3, P4, P5, P6, P7>& args, Arguments1<R1>& replyArgs, C* object, MF function)
+{
+    (object->*function)(args.argument1, args.argument2, args.argument3, args.argument4, args.argument5, args.argument6, args.argument7, replyArgs.argument1);
+}
+
 template<typename C, typename MF, typename P1, typename P2, typename P3, typename P4, typename R1, typename R2>
 void callMemberFunction(const Arguments4<P1, P2, P3, P4>& args, Arguments2<R1, R2>& replyArgs, C* object, MF function)
 {
diff --git a/WebKit2/UIProcess/API/C/WKPage.h b/WebKit2/UIProcess/API/C/WKPage.h
index e265732..1eeb849 100644
--- a/WebKit2/UIProcess/API/C/WKPage.h
+++ b/WebKit2/UIProcess/API/C/WKPage.h
@@ -153,6 +153,7 @@ typedef void (*WKPageSetWindowFrameCallback)(WKPageRef page, WKRect frame, const
 typedef bool (*WKPageRunBeforeUnloadConfirmPanelCallback)(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo);
 typedef void (*WKPageDidDrawCallback)(WKPageRef page, const void *clientInfo);
 typedef void (*WKPageDidScrollCallback)(WKPageRef page, const void *clientInfo);
+typedef unsigned long long (*WKPageExceededDatabaseQuotaCallback)(WKPageRef page, WKFrameRef frame, WKSecurityOriginRef origin, WKStringRef databaseName, WKStringRef displayName, unsigned long long currentQuota, unsigned long long currentUsage, unsigned long long expectedUsage, const void *clientInfo);
 
 
 struct WKPageUIClient {
@@ -180,6 +181,7 @@ struct WKPageUIClient {
     WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
     WKPageDidDrawCallback                                               didDraw;
     WKPageDidScrollCallback                                             pageDidScroll;
+    WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
 };
 typedef struct WKPageUIClient WKPageUIClient;
 
diff --git a/WebKit2/UIProcess/API/qt/qwkpage.cpp b/WebKit2/UIProcess/API/qt/qwkpage.cpp
index 42124d5..cebac2b 100644
--- a/WebKit2/UIProcess/API/qt/qwkpage.cpp
+++ b/WebKit2/UIProcess/API/qt/qwkpage.cpp
@@ -360,7 +360,8 @@ QWKPage::QWKPage(WKPageNamespaceRef namespaceRef)
         0,  /* setWindowFrame */
         0,  /* runBeforeUnloadConfirmPanel */
         0,  /* didDraw */
-        0   /* pageDidScroll */
+        0,  /* pageDidScroll */
+        0   /* exceededDatabaseQuota */
     };
     WKPageSetPageUIClient(pageRef(), &uiClient);
 }
diff --git a/WebKit2/UIProcess/WebPageProxy.cpp b/WebKit2/UIProcess/WebPageProxy.cpp
index 77b8f2b..27fdc4f 100644
--- a/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/WebKit2/UIProcess/WebPageProxy.cpp
@@ -58,6 +58,7 @@
 #include "WebProcessMessages.h"
 #include "WebProcessProxy.h"
 #include "WebProtectionSpace.h"
+#include "WebSecurityOrigin.h"
 #include "WebURLRequest.h"
 #include <WebCore/FloatRect.h>
 #include <WebCore/MIMETypeRegistry.h>
@@ -1561,4 +1562,12 @@ void WebPageProxy::didReceiveAuthenticationChallenge(uint64_t frameID, const Web
     m_loaderClient.didReceiveAuthenticationChallengeInFrame(this, frame, authenticationChallenge.get(), authenticationChallenge->listener());
 }
 
+void WebPageProxy::exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentUsage, uint64_t expectedUsage, uint64_t& newQuota)
+{
+    WebFrameProxy* frame = process()->webFrame(frameID);
+    RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::create(originIdentifier);
+
+    newQuota = m_uiClient.exceededDatabaseQuota(this, frame, origin.get(), databaseName, displayName, currentQuota, currentUsage, expectedUsage);
+}
+
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/WebPageProxy.h b/WebKit2/UIProcess/WebPageProxy.h
index d54109f..689bb80 100644
--- a/WebKit2/UIProcess/WebPageProxy.h
+++ b/WebKit2/UIProcess/WebPageProxy.h
@@ -327,6 +327,7 @@ private:
 #if ENABLE(TILED_BACKING_STORE)
     void pageDidRequestScroll(const WebCore::IntSize&);
 #endif
+    void exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentUsage, uint64_t expectedUsage, uint64_t& newQuota);
 #if PLATFORM(QT)
     void didChangeContentsSize(const WebCore::IntSize&);
     void didFindZoomableArea(const WebCore::IntRect&);
diff --git a/WebKit2/UIProcess/WebPageProxy.messages.in b/WebKit2/UIProcess/WebPageProxy.messages.in
index cfa7b42..7ed86e2 100644
--- a/WebKit2/UIProcess/WebPageProxy.messages.in
+++ b/WebKit2/UIProcess/WebPageProxy.messages.in
@@ -140,4 +140,7 @@ messages -> WebPageProxy {
     # Authentication
     CanAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, WebCore::ProtectionSpace protectionSpace) -> (bool canAuthenticate)
     DidReceiveAuthenticationChallenge(uint64_t frameID, WebCore::AuthenticationChallenge challenge, uint64_t challengeID)
+
+    # Databases
+    ExceededDatabaseQuota(uint64_t frameID, WTF::String originIdentifier, WTF::String databaseName, WTF::String databaseDisplayName, uint64_t currentQuota, uint64_t currentUsage, uint64_t expectedUsage) -> (uint64_t newQuota)
 }
diff --git a/WebKit2/UIProcess/WebUIClient.cpp b/WebKit2/UIProcess/WebUIClient.cpp
index 9b6e0ab..4782311 100644
--- a/WebKit2/UIProcess/WebUIClient.cpp
+++ b/WebKit2/UIProcess/WebUIClient.cpp
@@ -237,4 +237,12 @@ void WebUIClient::pageDidScroll(WebPageProxy* page)
     m_client.pageDidScroll(toAPI(page), m_client.clientInfo);
 }
 
+unsigned long long WebUIClient::exceededDatabaseQuota(WebPageProxy* page, WebFrameProxy* frame, WebSecurityOrigin* origin, const String& databaseName, const String& databaseDisplayName, unsigned long long currentQuota, unsigned long long currentUsage, unsigned long long expectedUsage)
+{
+    if (!m_client.exceededDatabaseQuota)
+        return currentQuota;
+
+    return m_client.exceededDatabaseQuota(toAPI(page), toAPI(frame), toAPI(origin), toAPI(databaseName.impl()), toAPI(databaseDisplayName.impl()), currentQuota, currentUsage, expectedUsage, m_client.clientInfo);
+}
+
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/WebUIClient.h b/WebKit2/UIProcess/WebUIClient.h
index 1136d44..fe701d2 100644
--- a/WebKit2/UIProcess/WebUIClient.h
+++ b/WebKit2/UIProcess/WebUIClient.h
@@ -44,6 +44,7 @@ class APIObject;
 class NativeWebKeyboardEvent;
 class WebFrameProxy;
 class WebPageProxy;
+class WebSecurityOrigin;
 
 class WebUIClient : public APIClient<WKPageUIClient> {
 public:
@@ -77,6 +78,8 @@ public:
 
     void didDraw(WebPageProxy*);
     void pageDidScroll(WebPageProxy*);
+
+    unsigned long long exceededDatabaseQuota(WebPageProxy*, WebFrameProxy*, WebSecurityOrigin*, const String& databaseName, const String& databaseDisplayName, unsigned long long currentQuota, unsigned long long currentUsage, unsigned long long expectedUsage);
 };
 
 } // namespace WebKit
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp b/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
index cd00528..1bb0530 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
@@ -43,6 +43,7 @@
 #include "WebProcess.h"
 #include "WebProcessProxyMessageKinds.h"
 #include "WebSearchPopupMenu.h"
+#include <WebCore/DatabaseTracker.h>
 #include <WebCore/FileChooser.h>
 #include <WebCore/Frame.h>
 #include <WebCore/FrameLoader.h>
@@ -420,9 +421,19 @@ void WebChromeClient::print(Frame*)
 }
 
 #if ENABLE(DATABASE)
-void WebChromeClient::exceededDatabaseQuota(Frame*, const String& databaseName)
+void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& databaseName)
 {
-    notImplemented();
+    WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
+    SecurityOrigin* origin = frame->document()->securityOrigin();
+
+    DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(databaseName, origin);
+    unsigned long long currentQuota = DatabaseTracker::tracker().quotaForOrigin(origin);
+    unsigned long long newQuota = 0;
+    WebProcess::shared().connection()->sendSync(
+        Messages::WebPageProxy::ExceededDatabaseQuota(webFrame->frameID(), origin->databaseIdentifier(), databaseName, details.displayName(), currentQuota, details.currentUsage(), details.expectedUsage()),
+        Messages::WebPageProxy::ExceededDatabaseQuota::Reply(newQuota), m_page->pageID());
+
+    DatabaseTracker::tracker().setQuota(origin, newQuota);
 }
 #endif
 
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 8049dbf..6ed5ac7 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,22 @@
+2010-12-08  Jessie Berlin  <jberlin at apple.com>
+
+        Reviewed by Adam Roben.
+
+        WebKit2: Implement WebChromeClient::exceededDatabaseQuota
+        https://bugs.webkit.org/show_bug.cgi?id=50656
+
+        * MiniBrowser/mac/BrowserWindowController.m:
+        (-[BrowserWindowController awakeFromNib]):
+        Indicate that exceededDatabaseQuota is not implemented.
+        * MiniBrowser/win/BrowserView.cpp:
+        (BrowserView::create):
+        Ditto.
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::createOtherPage):
+        Ditto.
+        (WTR::TestController::initialize):
+        Ditto.
+
 2010-12-08  Antonio Gomes  <agomes at rim.com>
 
         Reviewed by Martin Robinson.
diff --git a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
index e015637..6033a28 100644
--- a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
+++ b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
@@ -606,7 +606,8 @@ static bool runBeforeUnloadConfirmPanel(WKPageRef page, WKStringRef message, WKF
         setWindowFrame,
         runBeforeUnloadConfirmPanel,
         0,          /* didDraw */
-        0           /* pageDidScroll */
+        0,          /* pageDidScroll */
+        0           /* exceededDatabaseQuota */
     };
     WKPageSetPageUIClient(_webView.pageRef, &uiClient);
 }
diff --git a/WebKitTools/MiniBrowser/win/BrowserView.cpp b/WebKitTools/MiniBrowser/win/BrowserView.cpp
index f6d0cde..186dbd6 100644
--- a/WebKitTools/MiniBrowser/win/BrowserView.cpp
+++ b/WebKitTools/MiniBrowser/win/BrowserView.cpp
@@ -118,7 +118,8 @@ void BrowserView::create(RECT webViewRect, BrowserWindow* parentWindow)
         0,          /* setWindowFrame */
         0,          /* runBeforeUnloadConfirmPanel */
         0,          /* didDraw */
-        0           /* pageDidScroll */
+        0,          /* pageDidScroll */
+        0           /* exceededDatabaseQuota */
     };
 
     WKPageSetPageUIClient(WKViewGetPage(m_webView), &uiClient);
diff --git a/WebKitTools/WebKitTestRunner/TestController.cpp b/WebKitTools/WebKitTestRunner/TestController.cpp
index 547b133..4c16387 100644
--- a/WebKitTools/WebKitTestRunner/TestController.cpp
+++ b/WebKitTools/WebKitTestRunner/TestController.cpp
@@ -135,7 +135,8 @@ static WKPageRef createOtherPage(WKPageRef oldPage, WKDictionaryRef, WKEventModi
         setWindowFrameOtherPage,
         0, // runBeforeUnloadConfirmPanel
         0, // didDraw
-        0  // pageDidScroll
+        0, // pageDidScroll
+        0  // exceededDatabaseQuota
     };
     WKPageSetPageUIClient(newPage, &otherPageUIClient);
 
@@ -237,7 +238,8 @@ void TestController::initialize(int argc, const char* argv[])
         setWindowFrameMainPage,
         0, // runBeforeUnloadConfirmPanel
         0, // didDraw
-        0  // pageDidScroll
+        0, // pageDidScroll
+        0  // exceededDatabaseQuota
     };
     WKPageSetPageUIClient(m_mainWebView->page(), &pageUIClient);
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list