summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/WebKit/Source/core/dom/ContextFeatures.cpp
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-08-08 14:30:41 +0200
committerJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-08-12 13:49:54 +0200
commitab0a50979b9eb4dfa3320eff7e187e41efedf7a9 (patch)
tree498dfb8a97ff3361a9f7486863a52bb4e26bb898 /chromium/third_party/WebKit/Source/core/dom/ContextFeatures.cpp
parent4ce69f7403811819800e7c5ae1318b2647e778d1 (diff)
Update Chromium to beta version 37.0.2062.68
Change-Id: I188e3b5aff1bec75566014291b654eb19f5bc8ca Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'chromium/third_party/WebKit/Source/core/dom/ContextFeatures.cpp')
-rw-r--r--chromium/third_party/WebKit/Source/core/dom/ContextFeatures.cpp36
1 files changed, 16 insertions, 20 deletions
diff --git a/chromium/third_party/WebKit/Source/core/dom/ContextFeatures.cpp b/chromium/third_party/WebKit/Source/core/dom/ContextFeatures.cpp
index 980dde13bfb..2e17b30dace 100644
--- a/chromium/third_party/WebKit/Source/core/dom/ContextFeatures.cpp
+++ b/chromium/third_party/WebKit/Source/core/dom/ContextFeatures.cpp
@@ -27,16 +27,15 @@
#include "config.h"
#include "core/dom/ContextFeatures.h"
-#include "RuntimeEnabledFeatures.h"
#include "core/dom/Document.h"
#include "core/page/Page.h"
+#include "platform/RuntimeEnabledFeatures.h"
namespace WebCore {
-ContextFeaturesClient* ContextFeaturesClient::empty()
+PassOwnPtr<ContextFeaturesClient> ContextFeaturesClient::empty()
{
- DEFINE_STATIC_LOCAL(ContextFeaturesClient, empty, ());
- return &empty;
+ return adoptPtr(new ContextFeaturesClient());
}
const char* ContextFeatures::supplementName()
@@ -46,7 +45,11 @@ const char* ContextFeatures::supplementName()
ContextFeatures* ContextFeatures::defaultSwitch()
{
+#if ENABLE(OILPAN)
+ DEFINE_STATIC_LOCAL(Persistent<ContextFeatures>, instance, (ContextFeatures::create(ContextFeaturesClient::empty())));
+#else
DEFINE_STATIC_REF(ContextFeatures, instance, (ContextFeatures::create(ContextFeaturesClient::empty())));
+#endif
return instance;
}
@@ -54,21 +57,14 @@ bool ContextFeatures::dialogElementEnabled(Document* document)
{
if (!document)
return RuntimeEnabledFeatures::dialogElementEnabled();
- return document->contextFeatures()->isEnabled(document, DialogElement, RuntimeEnabledFeatures::dialogElementEnabled());
-}
-
-bool ContextFeatures::styleScopedEnabled(Document* document)
-{
- if (!document)
- return RuntimeEnabledFeatures::styleScopedEnabled();
- return document->contextFeatures()->isEnabled(document, StyleScoped, RuntimeEnabledFeatures::styleScopedEnabled());
+ return document->contextFeatures().isEnabled(document, DialogElement, RuntimeEnabledFeatures::dialogElementEnabled());
}
bool ContextFeatures::pagePopupEnabled(Document* document)
{
if (!document)
return false;
- return document->contextFeatures()->isEnabled(document, PagePopup, false);
+ return document->contextFeatures().isEnabled(document, PagePopup, false);
}
bool ContextFeatures::mutationEventsEnabled(Document* document)
@@ -76,25 +72,25 @@ bool ContextFeatures::mutationEventsEnabled(Document* document)
ASSERT(document);
if (!document)
return true;
- return document->contextFeatures()->isEnabled(document, MutationEvents, true);
+ return document->contextFeatures().isEnabled(document, MutationEvents, true);
}
bool ContextFeatures::pushStateEnabled(Document* document)
{
- return document->contextFeatures()->isEnabled(document, PushState, true);
+ return document->contextFeatures().isEnabled(document, PushState, true);
}
-void provideContextFeaturesTo(Page* page, ContextFeaturesClient* client)
+void provideContextFeaturesTo(Page& page, PassOwnPtr<ContextFeaturesClient> client)
{
- RefCountedSupplement<Page, ContextFeatures>::provideTo(page, ContextFeatures::supplementName(), ContextFeatures::create(client));
+ ContextFeatures::SupplementType::provideTo(page, ContextFeatures::supplementName(), ContextFeatures::create(client));
}
-void provideContextFeaturesToDocumentFrom(Document* document, Page* page)
+void provideContextFeaturesToDocumentFrom(Document& document, Page& page)
{
- ContextFeatures* provided = static_cast<ContextFeatures*>(RefCountedSupplement<Page, ContextFeatures>::from(page, ContextFeatures::supplementName()));
+ ContextFeatures* provided = static_cast<ContextFeatures*>(ContextFeatures::SupplementType::from(page, ContextFeatures::supplementName()));
if (!provided)
return;
- document->setContextFeatures(provided);
+ document.setContextFeatures(*provided);
}
}