[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

aa at chromium.org aa at chromium.org
Thu Feb 4 21:31:19 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 9192a039704af0f72797d4d623c11f02418e65ec
Author: aa at chromium.org <aa at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 28 20:38:02 2010 +0000

    revert
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54011 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/notifications/Notification.cpp b/WebCore/notifications/Notification.cpp
index a2d0a2b..ecb5799 100644
--- a/WebCore/notifications/Notification.cpp
+++ b/WebCore/notifications/Notification.cpp
@@ -38,7 +38,7 @@
 
 #include "Document.h"
 #include "EventNames.h"
-#include "WorkerContext.h"
+#include "WorkerContext.h" 
 
 namespace WebCore {
 
@@ -49,8 +49,7 @@ Notification::Notification(const String& url, ScriptExecutionContext* context, E
     , m_presenter(provider)
 {
     ASSERT(m_presenter);
-    Document* document = context->isDocument() ? static_cast<Document*>(context) : 0;
-    if (m_presenter->checkPermission(context->url(), document)) != NotificationPresenter::PermissionAllowed) {
+    if (m_presenter->checkPermission(context->securityOrigin()) != NotificationPresenter::PermissionAllowed) {
         ec = SECURITY_ERR;
         return;
     }
@@ -70,12 +69,11 @@ Notification::Notification(const NotificationContents& contents, ScriptExecution
     , m_presenter(provider)
 {
     ASSERT(m_presenter);
-    Document* document = context->isDocument() ? static_cast<Document*>(context) : 0;
-    if (m_presenter->checkPermission(context->url(), document)) != NotificationPresenter::PermissionAllowed) {
+    if (m_presenter->checkPermission(context->securityOrigin()) != NotificationPresenter::PermissionAllowed) {
         ec = SECURITY_ERR;
         return;
     }
-    
+
     KURL icon = context->completeURL(contents.icon());
     if (!icon.isEmpty() && !icon.isValid()) {
         ec = SYNTAX_ERR;
diff --git a/WebCore/notifications/NotificationCenter.cpp b/WebCore/notifications/NotificationCenter.cpp
index ad9fbec..45d29cf 100644
--- a/WebCore/notifications/NotificationCenter.cpp
+++ b/WebCore/notifications/NotificationCenter.cpp
@@ -40,18 +40,16 @@
 
 namespace WebCore {
 
-NotificationCenter::NotificationCenter(ScriptExecutionContext* context, NotificationPresenter* presenter)
+NotificationCenter::NotificationCenter(ScriptExecutionContext* context, NotificationPresenter* presenter) 
     : ActiveDOMObject(context, this)
     , m_scriptExecutionContext(context)
     , m_notificationPresenter(presenter) {}
 
-int NotificationCenter::checkPermission()
+int NotificationCenter::checkPermission() 
 {
     if (!presenter())
         return NotificationPresenter::PermissionDenied;
-    return m_notificationPresenter->checkPermission(
-        m_scriptExecutionContext->url(),
-        m_scriptExecutionContext->isDocument() ? static_cast<Document*>(m_scriptExecutionContext) : 0);
+    return m_notificationPresenter->checkPermission(m_scriptExecutionContext->securityOrigin());
 }
 
 void NotificationCenter::requestPermission(PassRefPtr<VoidCallback> callback)
diff --git a/WebCore/notifications/NotificationPresenter.h b/WebCore/notifications/NotificationPresenter.h
index 3df03bb..fe80da8 100644
--- a/WebCore/notifications/NotificationPresenter.h
+++ b/WebCore/notifications/NotificationPresenter.h
@@ -38,16 +38,14 @@
 
 namespace WebCore {
 
-    class Document;
     class Notification;
-    class KURL;
     class SecurityOrigin;
     class String;
-
+    
     class NotificationPresenter {
 
     public:
-        enum Permission {
+        enum Permission { 
             PermissionAllowed, // User has allowed notifications
             PermissionNotAllowed, // User has not yet allowed
             PermissionDenied // User has explicitly denied permission
@@ -56,25 +54,23 @@ namespace WebCore {
         virtual ~NotificationPresenter() {}
 
         // Requests that a notification be shown.
-        virtual bool show(Notification*) = 0;
+        virtual bool show(Notification* object) = 0;
 
         // Requests that a notification that has already been shown be canceled.
-        virtual void cancel(Notification*) = 0;
+        virtual void cancel(Notification* object) = 0;
 
-        // Informs the presenter that a Notification object has been destroyed
+        // Informs the presenter that a Notification object has been destroyed 
         // (such as by a page transition).  The presenter may continue showing
         // the notification, but must not attempt to call the event handlers.
-        virtual void notificationObjectDestroyed(Notification*) = 0;
+        virtual void notificationObjectDestroyed(Notification* object) = 0;
 
         // Requests user permission to show desktop notifications from a particular
-        // origin. The callback parameter should be run when the user has
+        // origin.  The callback parameter should be run when the user has
         // made a decision.
-        virtual void requestPermission(SecurityOrigin*, PassRefPtr<VoidCallback>) = 0;
+        virtual void requestPermission(SecurityOrigin* origin, PassRefPtr<VoidCallback> callback) = 0;
 
-        // Checks the current level of permission for the specified URL. If the
-        // URL is a document (as opposed to a worker or other ScriptExecutionContext),
-        // |document| will also be provided.
-        virtual Permission checkPermission(const KURL&, Document*) = 0;
+        // Checks the current level of permission.
+        virtual Permission checkPermission(SecurityOrigin* origin) = 0;
     };
 
 } // namespace WebCore
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 9ca4b4d..92cb756 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,23 +1,3 @@
-2010-01-27  Aaron Boodman  <aa at chromium.org>
-
-        Reviewed by Darin Adler.
-
-        Send full URL and application id of requesting context to Chromium
-        when checking notification permissions.
-
-        https://bugs.webkit.org/show_bug.cgi?id=34238
-
-        * public/WebDocument.h:
-        * src/WebDocument.cpp:
-        (WebKit::WebDocument::applicationID):
-        Implement applicationID() method.
-
-        * public/WebNotificationPresenter.h:
-        * src/NotificationPresenterImpl.cpp:
-        (WebKit::NotificationPresenterImpl::checkPermission):
-        * src/NotificationPresenterImpl.h:
-        Send applicationID and full URL through to Chromium.
-
 2010-01-27  Darin Fisher  <darin at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebKit/chromium/public/WebDocument.h b/WebKit/chromium/public/WebDocument.h
index e158c41..0397910 100644
--- a/WebKit/chromium/public/WebDocument.h
+++ b/WebKit/chromium/public/WebDocument.h
@@ -68,7 +68,6 @@ public:
     WEBKIT_API WebNodeCollection all();
     WEBKIT_API WebURL completeURL(const WebString&) const;
     WEBKIT_API WebElement getElementById(const WebString& id) const;
-    WEBKIT_API WebString applicationID() const;
 
 #if WEBKIT_IMPLEMENTATION
     WebDocument(const WTF::PassRefPtr<WebCore::Document>&);
diff --git a/WebKit/chromium/public/WebNotificationPresenter.h b/WebKit/chromium/public/WebNotificationPresenter.h
index a3764aa..653b142 100644
--- a/WebKit/chromium/public/WebNotificationPresenter.h
+++ b/WebKit/chromium/public/WebNotificationPresenter.h
@@ -35,10 +35,8 @@
 
 namespace WebKit {
 
-class WebDocument;
 class WebNotification;
 class WebNotificationPermissionCallback;
-class WebURL;
 
 // Provides the services to show desktop notifications to the user.
 class WebNotificationPresenter {
@@ -59,9 +57,8 @@ public:
     // being destroyed.  Does _not_ remove the notification if being shown, but detaches it from receiving events.
     virtual void objectDestroyed(const WebNotification&) = 0;
 
-    // Checks the permission level for the given URL. If the URL is being displayed in a document
-    // (as opposed to a worker or other ScriptExecutionContext), |document| will also be provided.
-    virtual Permission checkPermission(const WebURL& url, WebDocument* document) = 0;
+    // Checks the permission level of a given origin.
+    virtual Permission checkPermission(const WebString& origin) = 0;
 
     // Requests permission for a given origin.  This operation is asynchronous and the callback provided
     // will be invoked when the permission decision is made.  Callback pointer must remain
diff --git a/WebKit/chromium/src/NotificationPresenterImpl.cpp b/WebKit/chromium/src/NotificationPresenterImpl.cpp
index a38b8b5..6b22319 100644
--- a/WebKit/chromium/src/NotificationPresenterImpl.cpp
+++ b/WebKit/chromium/src/NotificationPresenterImpl.cpp
@@ -33,15 +33,12 @@
 
 #if ENABLE(NOTIFICATIONS)
 
-#include "Document.h"
 #include "Notification.h"
 #include "SecurityOrigin.h"
 
-#include "WebDocument.h"
 #include "WebNotification.h"
 #include "WebNotificationPermissionCallback.h"
 #include "WebNotificationPresenter.h"
-#include "WebURL.h"
 
 #include <wtf/PassRefPtr.h>
 
@@ -92,13 +89,9 @@ void NotificationPresenterImpl::notificationObjectDestroyed(Notification* notifi
     m_presenter->objectDestroyed(PassRefPtr<Notification>(notification));
 }
 
-NotificationPresenter::Permission NotificationPresenterImpl::checkPermission(const KURL& url, Document* document)
+NotificationPresenter::Permission NotificationPresenterImpl::checkPermission(SecurityOrigin* origin)
 {
-    WebDocument webDocument;
-    if (document)
-        webDocument = document;
-
-    int result = m_presenter->checkPermission(url, document ? &webDocument : 0);
+    int result = m_presenter->checkPermission(origin->toString());
     return static_cast<NotificationPresenter::Permission>(result);
 }
 
diff --git a/WebKit/chromium/src/NotificationPresenterImpl.h b/WebKit/chromium/src/NotificationPresenterImpl.h
index 8e3799c..4afe9dc 100644
--- a/WebKit/chromium/src/NotificationPresenterImpl.h
+++ b/WebKit/chromium/src/NotificationPresenterImpl.h
@@ -54,7 +54,7 @@ public:
     virtual bool show(WebCore::Notification* object);
     virtual void cancel(WebCore::Notification* object);
     virtual void notificationObjectDestroyed(WebCore::Notification* object);
-    virtual WebCore::NotificationPresenter::Permission checkPermission(const WebCore::KURL& url, WebCore::Document* document);
+    virtual WebCore::NotificationPresenter::Permission checkPermission(WebCore::SecurityOrigin* origin);
     virtual void requestPermission(WebCore::SecurityOrigin* origin, WTF::PassRefPtr<WebCore::VoidCallback> callback);
 
 private:
diff --git a/WebKit/chromium/src/WebDocument.cpp b/WebKit/chromium/src/WebDocument.cpp
index 84f3004..b7938cf 100644
--- a/WebKit/chromium/src/WebDocument.cpp
+++ b/WebKit/chromium/src/WebDocument.cpp
@@ -32,14 +32,12 @@
 #include "WebDocument.h"
 
 #include "Document.h"
-#include "DocumentLoader.h"
 #include "Element.h"
 #include "HTMLAllCollection.h"
 #include "HTMLBodyElement.h"
 #include "HTMLCollection.h"
 #include "HTMLElement.h"
 #include "HTMLHeadElement.h"
-#include "NodeList.h"
 
 #include "WebElement.h"
 #include "WebFrameImpl.h"
@@ -113,38 +111,4 @@ WebElement WebDocument::getElementById(const WebString& id) const
     return WebElement(constUnwrap<Document>()->getElementById(id));
 }
 
-WebString WebDocument::applicationID() const
-{
-    const char* kChromeApplicationHeader = "x-chrome-application";
-
-    // First check if the document's response included a header indicating the
-    // application it should go with.
-    const Document* document = constUnwrap<Document>();
-    Frame* frame = document->frame();
-    if (!frame)
-        return WebString();
-
-    DocumentLoader* loader = frame->loader()->documentLoader();
-    if (!loader)
-        return WebString();
-
-    WebString headerValue =
-        loader->response().httpHeaderField(kChromeApplicationHeader);
-    if (!headerValue.isEmpty())
-        return headerValue;
-
-    // Otherwise, fall back to looking for the meta tag.
-    RefPtr<NodeList> metaTags =
-        const_cast<Document*>(document)->getElementsByTagName("meta");
-    for (unsigned i = 0; i < metaTags->length(); ++i) {
-        Element* element = static_cast<Element*>(metaTags->item(i));
-        if (element->getAttribute("http-equiv").lower() ==
-                kChromeApplicationHeader) {
-            return element->getAttribute("value");
-        }
-    }
-
-    return WebString();
-}
-
 } // namespace WebKit
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index e1895be..16529c8 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,14 +1,3 @@
-2010-01-27  Aaron Boodman  <aa at chromium.org>
-
-        Expand NotificationCenter::checkPermission() interface.
-        It now passes the full URL instead of just the origin.
-
-        https://bugs.webkit.org/show_bug.cgi?id=34238
-
-        * WebCoreSupport/WebDesktopNotificationsDelegate.cpp:
-        (WebDesktopNotificationsDelegate::checkPermission):
-        * WebCoreSupport/WebDesktopNotificationsDelegate.h:
-
 2010-01-27  Adam Roben  <aroben at apple.com>
 
         Make it possible to instantiate WebSerializedJSValue using
diff --git a/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp b/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp
index 3f6eb07..f822bfe 100644
--- a/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp
+++ b/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.cpp
@@ -33,8 +33,6 @@
 #include "WebSecurityOrigin.h"
 #include "WebView.h"
 #include <WebCore/BString.h>
-#include <WebCore/Document.h>
-#include <WebCore/KURL.h>
 
 #if ENABLE(NOTIFICATIONS)
 
@@ -172,10 +170,10 @@ void WebDesktopNotificationsDelegate::requestPermission(SecurityOrigin* origin,
         notificationDelegate()->requestNotificationPermission(org);
 }
 
-NotificationPresenter::Permission WebDesktopNotificationsDelegate::checkPermission(const KURL& url, Document*)
+NotificationPresenter::Permission WebDesktopNotificationsDelegate::checkPermission(SecurityOrigin* origin)
 {
     int out = 0;
-    BString org(SecurityOrigin::create(url)->toString());
+    BString org(origin->toString());
     if (hasNotificationDelegate())
         notificationDelegate()->checkNotificationPermission(org, &out);
     return (NotificationPresenter::Permission) out;
diff --git a/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.h b/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.h
index d30b1e7..00c00d5 100644
--- a/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.h
+++ b/WebKit/win/WebCoreSupport/WebDesktopNotificationsDelegate.h
@@ -36,11 +36,6 @@
 
 interface IWebDesktopNotificationPresenter;
 
-namespace WebCore {
-class Document;
-class KURL;
-}
-
 class WebDesktopNotificationsDelegate : public WebCore::NotificationPresenter {
 public:
     WebDesktopNotificationsDelegate(WebView* view);
@@ -50,7 +45,7 @@ public:
     virtual void cancel(WebCore::Notification* object);
     virtual void notificationObjectDestroyed(WebCore::Notification* object);
     virtual void requestPermission(WebCore::SecurityOrigin* origin, PassRefPtr<WebCore::VoidCallback> callback);
-    virtual WebCore::NotificationPresenter::Permission checkPermission(const KURL& url, Document* document);
+    virtual WebCore::NotificationPresenter::Permission checkPermission(WebCore::SecurityOrigin* origin);
 
 private:
     bool hasNotificationDelegate();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list