Diff
Modified: trunk/LayoutTests/ChangeLog (111454 => 111455)
--- trunk/LayoutTests/ChangeLog 2012-03-20 22:45:07 UTC (rev 111454)
+++ trunk/LayoutTests/ChangeLog 2012-03-20 22:51:43 UTC (rev 111455)
@@ -1,3 +1,15 @@
+2012-03-20 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r111445 and r111446.
+ http://trac.webkit.org/changeset/111445
+ http://trac.webkit.org/changeset/111446
+ https://bugs.webkit.org/show_bug.cgi?id=81708
+
+ It broke Qt and GTK build intentionally (Requested by Ossy on
+ #webkit).
+
+ * platform/chromium/test_expectations.txt:
+
2012-03-20 Adam Klein <[email protected]>
Unskip dom/xhtml test fixed in r111449.
Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (111454 => 111455)
--- trunk/LayoutTests/platform/chromium/test_expectations.txt 2012-03-20 22:45:07 UTC (rev 111454)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt 2012-03-20 22:51:43 UTC (rev 111455)
@@ -3952,7 +3952,3 @@
// Allowed to regress to fix a crash.
BUGWK81276 WIN LINUX: fast/inline/continuation-outlines-with-layers.html = IMAGE
-
-BUGWK81697 : fast/notifications/notifications-check-permission.html = TEXT
-BUGWK81697 : fast/notifications/notifications-request-permission.html = TEXT
-BUGWK81697 : fast/notifications/notifications-without-permission.html = TEXT
Modified: trunk/Source/WebCore/ChangeLog (111454 => 111455)
--- trunk/Source/WebCore/ChangeLog 2012-03-20 22:45:07 UTC (rev 111454)
+++ trunk/Source/WebCore/ChangeLog 2012-03-20 22:51:43 UTC (rev 111455)
@@ -1,3 +1,28 @@
+2012-03-20 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r111445 and r111446.
+ http://trac.webkit.org/changeset/111445
+ http://trac.webkit.org/changeset/111446
+ https://bugs.webkit.org/show_bug.cgi?id=81708
+
+ It broke Qt and GTK build intentionally (Requested by Ossy on
+ #webkit).
+
+ * WebCore.exp.in:
+ * dom/Document.cpp:
+ (WebCore::Document::initSecurityContext):
+ * notifications/Notification.cpp:
+ (WebCore::Notification::Notification):
+ * notifications/NotificationCenter.cpp:
+ (WebCore::NotificationCenter::checkPermission):
+ (WebCore::NotificationCenter::requestPermission):
+ * notifications/NotificationCenter.h:
+ (NotificationCenter):
+ * page/SecurityOrigin.cpp:
+ (WebCore::SecurityOrigin::toString):
+ * page/SecurityOrigin.h:
+ (SecurityOrigin):
+
2012-03-20 Adam Klein <[email protected]>
Refactor ContainerNode::replaceChild to match other mutation methods and share code
Modified: trunk/Source/WebCore/WebCore.exp.in (111454 => 111455)
--- trunk/Source/WebCore/WebCore.exp.in 2012-03-20 22:45:07 UTC (rev 111454)
+++ trunk/Source/WebCore/WebCore.exp.in 2012-03-20 22:51:43 UTC (rev 111455)
@@ -1283,7 +1283,6 @@
__ZNK7WebCore14ScrollableArea23mouseEnteredContentAreaEv
__ZNK7WebCore14ScrollableArea23mouseMovedInContentAreaEv
__ZNK7WebCore14SecurityOrigin10canDisplayERKNS_4KURLE
-__ZNK7WebCore14SecurityOrigin11toRawStringEv
__ZNK7WebCore14SecurityOrigin18databaseIdentifierEv
__ZNK7WebCore14SecurityOrigin5equalEPKS0_
__ZNK7WebCore14SecurityOrigin8toStringEv
Modified: trunk/Source/WebCore/dom/Document.cpp (111454 => 111455)
--- trunk/Source/WebCore/dom/Document.cpp 2012-03-20 22:45:07 UTC (rev 111454)
+++ trunk/Source/WebCore/dom/Document.cpp 2012-03-20 22:51:43 UTC (rev 111455)
@@ -4717,20 +4717,19 @@
if (Settings* settings = this->settings()) {
if (!settings->isWebSecurityEnabled()) {
- // Web security is turned off. We should let this document access every
- // other document. This is used primary by testing harnesses for web
- // sites.
- securityOrigin()->grantUniversalAccess();
+ // Web security is turned off. We should let this document access every
+ // other document. This is used primary by testing harnesses for web
+ // sites.
+ securityOrigin()->grantUniversalAccess();
+
} else if (settings->allowUniversalAccessFromFileURLs() && securityOrigin()->isLocal()) {
- // Some clients want file:// URLs to have universal access, but that
- // setting is dangerous for other clients.
- securityOrigin()->grantUniversalAccess();
+ // Some clients want file:// URLs to have universal access, but that
+ // setting is dangerous for other clients.
+ securityOrigin()->grantUniversalAccess();
} else if (!settings->allowFileAccessFromFileURLs() && securityOrigin()->isLocal()) {
- // Some clients want file:// URLs to have even tighter restrictions by
- // default, and not be able to access other local files.
- // FIXME 81578: The naming of this is confusing. Files with restricted access to other local files
- // still can have other privileges that can be remembered, thereby not making them unique origins.
- securityOrigin()->enforceFilePathSeparation();
+ // Some clients want file:// URLs to have even tighter restrictions by
+ // default, and not be able to access other local files.
+ securityOrigin()->enforceFilePathSeparation();
}
}
Modified: trunk/Source/WebCore/notifications/Notification.cpp (111454 => 111455)
--- trunk/Source/WebCore/notifications/Notification.cpp 2012-03-20 22:45:07 UTC (rev 111454)
+++ trunk/Source/WebCore/notifications/Notification.cpp 2012-03-20 22:51:43 UTC (rev 111455)
@@ -58,7 +58,8 @@
, m_state(Idle)
, m_notificationCenter(provider)
{
- if (m_notificationCenter->checkPermission() != NotificationClient::PermissionAllowed) {
+ ASSERT(m_notificationCenter->client());
+ if (m_notificationCenter->client()->checkPermission(context) != NotificationClient::PermissionAllowed) {
ec = SECURITY_ERR;
return;
}
@@ -79,7 +80,8 @@
, m_state(Idle)
, m_notificationCenter(provider)
{
- if (m_notificationCenter->checkPermission() != NotificationClient::PermissionAllowed) {
+ ASSERT(m_notificationCenter->client());
+ if (m_notificationCenter->client()->checkPermission(context) != NotificationClient::PermissionAllowed) {
ec = SECURITY_ERR;
return;
}
Modified: trunk/Source/WebCore/notifications/NotificationCenter.cpp (111454 => 111455)
--- trunk/Source/WebCore/notifications/NotificationCenter.cpp 2012-03-20 22:45:07 UTC (rev 111454)
+++ trunk/Source/WebCore/notifications/NotificationCenter.cpp 2012-03-20 22:51:43 UTC (rev 111455)
@@ -37,7 +37,7 @@
#include "Document.h"
#include "NotificationClient.h"
-#include "SecurityOrigin.h"
+#include "VoidCallback.h"
#include "WorkerContext.h"
namespace WebCore {
@@ -57,17 +57,6 @@
{
if (!client() || !scriptExecutionContext())
return NotificationClient::PermissionDenied;
-
- switch (scriptExecutionContext()->securityOrigin()->canShowNotifications()) {
- case SecurityOrigin::Always:
- return NotificationClient::PermissionAllowed;
- case SecurityOrigin::Never:
- return NotificationClient::PermissionDenied;
- case SecurityOrigin::Ask:
- return m_client->checkPermission(scriptExecutionContext());
- }
-
- ASSERT_NOT_REACHED();
return m_client->checkPermission(scriptExecutionContext());
}
@@ -75,18 +64,6 @@
{
if (!client() || !scriptExecutionContext())
return;
-
- switch (scriptExecutionContext()->securityOrigin()->canShowNotifications()) {
- case SecurityOrigin::Always:
- case SecurityOrigin::Never: {
- m_callbacks.add(NotificationRequestCallback::createAndStartTimer(this, callback));
- return;
- }
- case SecurityOrigin::Ask:
- return m_client->requestPermission(scriptExecutionContext(), callback);
- }
-
- ASSERT_NOT_REACHED();
m_client->requestPermission(scriptExecutionContext(), callback);
}
@@ -101,36 +78,6 @@
m_client = 0;
}
-void NotificationCenter::requestTimedOut(NotificationCenter::NotificationRequestCallback* request)
-{
- m_callbacks.remove(request);
-}
-
-PassRefPtr<NotificationCenter::NotificationRequestCallback> NotificationCenter::NotificationRequestCallback::createAndStartTimer(NotificationCenter* center, PassRefPtr<VoidCallback> callback)
-{
- RefPtr<NotificationCenter::NotificationRequestCallback> requestCallback = adoptRef(new NotificationCenter::NotificationRequestCallback(center, callback));
- requestCallback->startTimer();
- return requestCallback.release();
-}
-
-NotificationCenter::NotificationRequestCallback::NotificationRequestCallback(NotificationCenter* center, PassRefPtr<VoidCallback> callback)
- : m_notificationCenter(center)
- , m_timer(this, &NotificationCenter::NotificationRequestCallback::timerFired)
- , m_callback(callback)
-{
-}
-
-void NotificationCenter::NotificationRequestCallback::startTimer()
-{
- m_timer.startOneShot(0);
-}
-
-void NotificationCenter::NotificationRequestCallback::timerFired(Timer<NotificationCenter::NotificationRequestCallback>*)
-{
- m_callback->handleEvent();
- m_notificationCenter->requestTimedOut(this);
-}
-
} // namespace WebCore
#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
Modified: trunk/Source/WebCore/notifications/NotificationCenter.h (111454 => 111455)
--- trunk/Source/WebCore/notifications/NotificationCenter.h 2012-03-20 22:45:07 UTC (rev 111454)
+++ trunk/Source/WebCore/notifications/NotificationCenter.h 2012-03-20 22:51:43 UTC (rev 111455)
@@ -35,8 +35,6 @@
#include "ExceptionCode.h"
#include "Notification.h"
#include "ScriptExecutionContext.h"
-#include "Timer.h"
-#include "VoidCallback.h"
#include <wtf/OwnPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -85,23 +83,7 @@
private:
NotificationCenter(ScriptExecutionContext*, NotificationClient*);
- class NotificationRequestCallback : public RefCounted<NotificationRequestCallback> {
- public:
- static PassRefPtr<NotificationRequestCallback> createAndStartTimer(NotificationCenter*, PassRefPtr<VoidCallback>);
- void startTimer();
- void timerFired(Timer<NotificationRequestCallback>*);
- private:
- NotificationRequestCallback(NotificationCenter*, PassRefPtr<VoidCallback>);
-
- RefPtr<NotificationCenter> m_notificationCenter;
- Timer<NotificationRequestCallback> m_timer;
- RefPtr<VoidCallback> m_callback;
- };
-
- void requestTimedOut(NotificationRequestCallback*);
-
NotificationClient* m_client;
- HashSet<RefPtr<NotificationRequestCallback> > m_callbacks;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/page/SecurityOrigin.cpp (111454 => 111455)
--- trunk/Source/WebCore/page/SecurityOrigin.cpp 2012-03-20 22:45:07 UTC (rev 111454)
+++ trunk/Source/WebCore/page/SecurityOrigin.cpp 2012-03-20 22:51:43 UTC (rev 111455)
@@ -355,15 +355,6 @@
return true;
}
-SecurityOrigin::Policy SecurityOrigin::canShowNotifications() const
-{
- if (m_universalAccess)
- return Always;
- if (isUnique())
- return Never;
- return Ask;
-}
-
void SecurityOrigin::grantLoadLocalResources()
{
// This function exists only to support backwards compatibility with older
@@ -395,15 +386,12 @@
{
if (isUnique())
return "null";
- if (m_protocol == "file" && m_enforceFilePathSeparation)
- return "null";
- return toRawString();
-}
-String SecurityOrigin::toRawString() const
-{
- if (m_protocol == "file")
+ if (m_protocol == "file") {
+ if (m_enforceFilePathSeparation)
+ return "null";
return "file://";
+ }
StringBuilder result;
result.reserveCapacity(m_protocol.length() + m_host.length() + 10);
Modified: trunk/Source/WebCore/page/SecurityOrigin.h (111454 => 111455)
--- trunk/Source/WebCore/page/SecurityOrigin.h 2012-03-20 22:45:07 UTC (rev 111454)
+++ trunk/Source/WebCore/page/SecurityOrigin.h 2012-03-20 22:51:43 UTC (rev 111455)
@@ -39,12 +39,6 @@
class SecurityOrigin : public ThreadSafeRefCounted<SecurityOrigin> {
public:
- enum Policy {
- Never = 0,
- Always,
- Ask
- };
-
static PassRefPtr<SecurityOrigin> create(const KURL&);
static PassRefPtr<SecurityOrigin> createUnique();
@@ -121,7 +115,6 @@
bool canAccessCookies() const { return !isUnique(); }
bool canAccessPasswordManager() const { return !isUnique(); }
bool canAccessFileSystem() const { return !isUnique(); }
- Policy canShowNotifications() const;
// Technically, we should always allow access to sessionStorage, but we
// currently don't handle creating a sessionStorage area for unique
@@ -142,8 +135,6 @@
bool isUnique() const { return m_isUnique; }
// Marks a file:// origin as being in a domain defined by its path.
- // FIXME 81578: The naming of this is confusing. Files with restricted access to other local files
- // still can have other privileges that can be remembered, thereby not making them unique.
void enforceFilePathSeparation();
// Convert this SecurityOrigin into a string. The string
@@ -158,10 +149,6 @@
// we shouldTreatURLSchemeAsNoAccess.
String toString() const;
- // Similar to toString(), but does not take into account any factors that
- // could make the string return "null".
- String toRawString() const;
-
// Serialize the security origin to a string that could be used as part of
// file names. This format should be used in storage APIs only.
String databaseIdentifier() const;
Modified: trunk/Source/WebKit2/ChangeLog (111454 => 111455)
--- trunk/Source/WebKit2/ChangeLog 2012-03-20 22:45:07 UTC (rev 111454)
+++ trunk/Source/WebKit2/ChangeLog 2012-03-20 22:51:43 UTC (rev 111455)
@@ -1,3 +1,16 @@
+2012-03-20 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r111445 and r111446.
+ http://trac.webkit.org/changeset/111445
+ http://trac.webkit.org/changeset/111446
+ https://bugs.webkit.org/show_bug.cgi?id=81708
+
+ It broke Qt and GTK build intentionally (Requested by Ossy on
+ #webkit).
+
+ * WebProcess/Notifications/WebNotificationManager.cpp:
+ (WebKit::WebNotificationManager::policyForOrigin):
+
2012-03-20 Jon Lee <[email protected]>
Restrict access to notifications for unique origins and file URLs with no local file access
Modified: trunk/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp (111454 => 111455)
--- trunk/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp 2012-03-20 22:45:07 UTC (rev 111454)
+++ trunk/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp 2012-03-20 22:51:43 UTC (rev 111455)
@@ -95,9 +95,8 @@
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
if (!origin)
return NotificationClient::PermissionNotAllowed;
-
- ASSERT(!origin->isUnique());
- HashMap<String, bool>::const_iterator it = m_permissionsMap.find(origin->toRawString());
+
+ HashMap<String, bool>::const_iterator it = m_permissionsMap.find(origin->toString());
if (it != m_permissionsMap.end())
return it->second ? NotificationClient::PermissionAllowed : NotificationClient::PermissionDenied;
#endif