Reviewed by John Sullivan
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Dec 2007 01:22:00 +0000 (01:22 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Dec 2007 01:22:00 +0000 (01:22 +0000)
        Fix for <rdar://problem/5640080> - Database UI delegate calls need to specify WebFrame

        This is because a common UI case is to want to know the originating URL of a Database

        * WebCoreSupport/WebChromeClient.mm:
        (WebChromeClient::requestQuotaIncreaseForNewDatabase):
        (WebChromeClient::requestQuotaIncreaseForDatabaseOperation):

        * WebView/WebUIDelegatePrivate.h:

        * WebView/WebView.mm:
        (CallDelegateReturningUnsignedLongLong):
        (CallUIDelegateReturningUnsignedLongLong):
        * WebView/WebViewInternal.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28597 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/mac/ChangeLog
WebKit/mac/WebCoreSupport/WebChromeClient.mm
WebKit/mac/WebView/WebUIDelegatePrivate.h
WebKit/mac/WebView/WebView.mm
WebKit/mac/WebView/WebViewInternal.h

index 467bd2b25247968e0450993d431c6d1e4a59461e..bb0384cbe0824d1f277222a755dd6052328e5669 100644 (file)
@@ -1,3 +1,22 @@
+2007-12-10  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by John Sullivan
+
+        Fix for <rdar://problem/5640080> - Database UI delegate calls need to specify WebFrame
+
+        This is because a common UI case is to want to know the originating URL of a Database
+
+        * WebCoreSupport/WebChromeClient.mm:
+        (WebChromeClient::requestQuotaIncreaseForNewDatabase):
+        (WebChromeClient::requestQuotaIncreaseForDatabaseOperation):
+
+        * WebView/WebUIDelegatePrivate.h:
+
+        * WebView/WebView.mm:
+        (CallDelegateReturningUnsignedLongLong):
+        (CallUIDelegateReturningUnsignedLongLong):
+        * WebView/WebViewInternal.h:
+
 2007-12-10  Timothy Hatcher  <timothy@apple.com>
 
         Reviewed by Mark Rowe.
index be6c9b7a42f2274dc639a50de22eabb8e9b19613..f871b6498aca7fd0c929238e477bd6537faf693c 100644 (file)
@@ -412,18 +412,18 @@ void WebChromeClient::print(Frame* frame)
     CallUIDelegate(m_webView, @selector(webView:printFrameView:), frameView);
 }
 
-unsigned long long WebChromeClient::requestQuotaIncreaseForNewDatabase(WebCore::Frame*, const WebCore::SecurityOriginData& origin, const WebCore::String& databaseDisplayName, unsigned long long estimatedSize)
+unsigned long long WebChromeClient::requestQuotaIncreaseForNewDatabase(WebCore::Frame* frame, const WebCore::SecurityOriginData& origin, const WebCore::String& databaseDisplayName, unsigned long long estimatedSize)
 {
     WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOriginData:reinterpret_cast<const WebCoreSecurityOriginData*>(&origin)];
-    unsigned long long result = CallUIDelegateReturningUnsignedLongLong(m_webView, @selector(webView:quotaForSecurityOrigin:toCreateDatabase:withEstimatedSize:), webOrigin, (NSString *)databaseDisplayName, estimatedSize);
+    unsigned long long result = CallUIDelegateReturningUnsignedLongLong(m_webView, @selector(webView:frame:quotaForSecurityOrigin:toCreateDatabase:withEstimatedSize:), kit(frame), webOrigin, (NSString *)databaseDisplayName, estimatedSize);
     [webOrigin release];
     return result;
 }
 
-unsigned long long WebChromeClient::requestQuotaIncreaseForDatabaseOperation(WebCore::Frame*, const WebCore::SecurityOriginData& origin, const WebCore::String& databaseIdentifier, unsigned long long proposedNewQuota)
+unsigned long long WebChromeClient::requestQuotaIncreaseForDatabaseOperation(WebCore::Frame* frame, const WebCore::SecurityOriginData& origin, const WebCore::String& databaseIdentifier, unsigned long long proposedNewQuota)
 {
     WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOriginData:reinterpret_cast<const WebCoreSecurityOriginData*>(&origin)];
-    unsigned long long result = CallUIDelegateReturningUnsignedLongLong(m_webView, @selector(webView:quotaForSecurityOrigin:fromProposedQuota:database:), webOrigin, proposedNewQuota, (NSString *)databaseIdentifier);
+    unsigned long long result = CallUIDelegateReturningUnsignedLongLong(m_webView, @selector(webView:frame:quotaForSecurityOrigin:fromProposedQuota:database:), kit(frame), webOrigin, proposedNewQuota, (NSString *)databaseIdentifier);
     [webOrigin release];
     return result;
 }
index 7468c3aaa664300db4912de2309cbefce6a9dcab..83ceffc345660be9450b0fcad5225a3bad753d31 100644 (file)
@@ -89,6 +89,7 @@ enum {
 /*!
     @method webView:quotaForSecurityOrigin:toCreateDatabase:withEstimatedSize:
     @param sender The WebView sending the delegate method
+    @param frame The WebFrame whose JavaScript initiated this call.
     @param origin The security origin of the database that needs a larger quota to create a database
     @param newDatabaseName The display name of the new database
     @param estimatedSize The estimated maximum usage of the new database
@@ -96,11 +97,12 @@ enum {
     @discussion If the new quota is less than or equal to the current usage for the given security origin, the new database will not be created.
     Otherwise the database will created, even if the new quota doesn't allow for the entire estimated size.
 */
-- (unsigned long long)webView:(WebView *)sender quotaForSecurityOrigin:(WebSecurityOrigin *)origin toCreateDatabase:(NSString *)newDatabaseName withEstimatedSize:(unsigned long long)estimatedSize;
+- (unsigned long long)webView:(WebView *)sender frame:(WebFrame *)frame quotaForSecurityOrigin:(WebSecurityOrigin *)origin toCreateDatabase:(NSString *)newDatabaseName withEstimatedSize:(unsigned long long)estimatedSize;
 
 /*!
     @method webView:quotaForSecurityOrigin:fromProposedQuota:database:
     @param sender The WebView sending the delegate method
+    @param frame The WebFrame whose JavaScript initiated this call.
     @param origin The security origin of the database that has reached its size limit
     @param proposedNewQuota WebKit's best guess as to the required new quota
     @param databaseIdentifier The string identifier of the database
@@ -109,7 +111,7 @@ enum {
     If the new quota is equal to or greater than the proposedNewQuota, the current database operation will continue, 
     possibly calling this delegate method again to request even more space
 */
-- (unsigned long long)webView:(WebView *)sender quotaForSecurityOrigin:(WebSecurityOrigin *)origin fromProposedQuota:(unsigned long long)proposedNewQuota database:(NSString *)databaseIdentifier;
+- (unsigned long long)webView:(WebView *)sender frame:(WebFrame *)frame quotaForSecurityOrigin:(WebSecurityOrigin *)origin fromProposedQuota:(unsigned long long)proposedNewQuota database:(NSString *)databaseIdentifier;
 
 - (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request windowFeatures:(NSDictionary *)features;
 
index ae2baa5e70ebbdb2c53b8a88c41f9b5e03009784..c0d87474d8d51466bae1f340b80f5068b17da124 100644 (file)
@@ -4284,28 +4284,28 @@ static inline float CallDelegateReturningFloat(WebView *self, id delegate, SEL s
 typedef unsigned long long (*ObjCMsgSendULLRet)(id, SEL, ...);
 static const ObjCMsgSendULLRet objc_msgSend_ullret = reinterpret_cast<ObjCMsgSendULLRet>(objc_msgSend);
 
-static inline unsigned long long CallDelegateReturningUnsignedLongLong(WebView *self, id delegate, SEL selector, id object1, id object2, unsigned long long integer)
+static inline unsigned long long CallDelegateReturningUnsignedLongLong(WebView *self, id delegate, SEL selector, id object1, id object2, id object3, unsigned long long integer)
 {
     if (!delegate || ![delegate respondsToSelector:selector])
         return 0;
     if (!self->_private->catchesDelegateExceptions)
-        return objc_msgSend_ullret(delegate, selector, self, object1, object2, integer);
+        return objc_msgSend_ullret(delegate, selector, self, object1, object2, object3, integer);
     @try {
-        return objc_msgSend_ullret(delegate, selector, self, object1, object2, integer);
+        return objc_msgSend_ullret(delegate, selector, self, object1, object2, object3, integer);
     } @catch(id exception) {
         ReportDiscardedDelegateException(selector, exception);
     }
     return 0;
 }
 
-static inline unsigned long long CallDelegateReturningUnsignedLongLong(WebView *self, id delegate, SEL selector, id object1, unsigned long long integer, id object2)
+static inline unsigned long long CallDelegateReturningUnsignedLongLong(WebView *self, id delegate, SEL selector, id object1, id object2, unsigned long long integer, id object3)
 {
     if (!delegate || ![delegate respondsToSelector:selector])
         return 0;
     if (!self->_private->catchesDelegateExceptions)
-        return objc_msgSend_ullret(delegate, selector, self, object1, integer, object2);
+        return objc_msgSend_ullret(delegate, selector, self, object1, object2, integer, object3);
     @try {
-        return objc_msgSend_ullret(delegate, selector, self, object1, integer, object2);
+        return objc_msgSend_ullret(delegate, selector, self, object1, object2, integer, object3);
     } @catch(id exception) {
         ReportDiscardedDelegateException(selector, exception);
     }
@@ -4520,14 +4520,14 @@ float CallUIDelegateReturningFloat(WebView *self, SEL selector)
     return CallDelegateReturningFloat(self, self->_private->UIDelegate, selector);
 }
 
-unsigned long long CallUIDelegateReturningUnsignedLongLong(WebView *self, SEL selector, id object1, id object2, unsigned long long integer)
+unsigned long long CallUIDelegateReturningUnsignedLongLong(WebView *self, SEL selector, id object1, id object2, id object3, unsigned long long integer)
 {
-    return CallDelegateReturningUnsignedLongLong(self, self->_private->UIDelegate, selector, object1, object2, integer);
+    return CallDelegateReturningUnsignedLongLong(self, self->_private->UIDelegate, selector, object1, object2, object3, integer);
 }
 
-unsigned long long CallUIDelegateReturningUnsignedLongLong(WebView *self, SEL selector, id object1, unsigned long long integer, id object2)
+unsigned long long CallUIDelegateReturningUnsignedLongLong(WebView *self, SEL selector, id object1, id object2, unsigned long long integer, id object3)
 {
-    return CallDelegateReturningUnsignedLongLong(self, self->_private->UIDelegate, selector, object1, integer, object2);
+    return CallDelegateReturningUnsignedLongLong(self, self->_private->UIDelegate, selector, object1, object2, integer, object3);
 }
 
 BOOL CallUIDelegateReturningBoolean(BOOL result, WebView *self, SEL selector)
index e7a1aa1bb9c62f23b9e4e2495213894083bdf801..2d7cc592d757ffdf9baf094207809d324718881d 100644 (file)
@@ -167,8 +167,8 @@ id CallUIDelegate(WebView *, SEL, id, BOOL);
 id CallUIDelegate(WebView *, SEL, id, id, id);
 id CallUIDelegate(WebView *, SEL, id, NSUInteger);
 float CallUIDelegateReturningFloat(WebView *, SEL);
-unsigned long long CallUIDelegateReturningUnsignedLongLong(WebView *, SEL, id, id, unsigned long long);
-unsigned long long CallUIDelegateReturningUnsignedLongLong(WebView *, SEL, id, unsigned long long, id);
+unsigned long long CallUIDelegateReturningUnsignedLongLong(WebView *, SEL, id, id, id, unsigned long long);
+unsigned long long CallUIDelegateReturningUnsignedLongLong(WebView *, SEL, id, id, unsigned long long, id);
 BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL);
 BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL, id);
 BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL, id, id);