Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Unified Diff: WebCore/dom/make_names.pl

Issue 1696004: Merge 57922 - 20100420 Justin Schuh <jschuh@chromium.org>... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/WebKit/375/
Patch Set: Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/media/svg-as-image-with-media-blocked-expected.txt ('k') | WebCore/page/Settings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/dom/make_names.pl
===================================================================
--- WebCore/dom/make_names.pl (revision 45140)
+++ WebCore/dom/make_names.pl (working copy)
@@ -287,8 +287,10 @@
# Handle media elements.
if ($tags{$tagName}{wrapperOnlyIfMediaIsAvailable}) {
print F <<END
- if (!MediaPlayer::isAvailable())
+ Settings* settings = document->settings();
+ if (!MediaPlayer::isAvailable() || (settings && !settings->isMediaEnabled()))
return HTMLElement::create($constructorTagName, document);
+
END
;
}
@@ -638,7 +640,7 @@
print F <<END
#include <wtf/HashMap.h>
-#if ENABLE(DASHBOARD_SUPPORT)
+#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(VIDEO)
#include "Document.h"
#include "Settings.h"
#endif
@@ -839,7 +841,8 @@
print F <<END
static JSNode* create${JSInterfaceName}Wrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<$parameters{namespace}Element> element)
{
- if (!MediaPlayer::isAvailable())
+ Settings* settings = element->document()->settings();
+ if (!MediaPlayer::isAvailable() || (settings && !settings->isMediaEnabled()))
return CREATE_DOM_NODE_WRAPPER(exec, globalObject, $parameters{namespace}Element, element.get());
return CREATE_DOM_NODE_WRAPPER(exec, globalObject, ${JSInterfaceName}, element.get());
}
@@ -857,14 +860,29 @@
;
}
} elsif ($wrapperFactoryType eq "V8") {
+ if ($tags{$tagName}{wrapperOnlyIfMediaIsAvailable}) {
+ print F <<END
+static v8::Handle<v8::Value> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element)
+{
+ Settings* settings = element->document()->settings();
+ if (!MediaPlayer::isAvailable() || (settings && !settings->isMediaEnabled()))
+ return toV8(static_cast<$parameters{namespace}Element*>(element));
+ return toV8(static_cast<${JSInterfaceName}*>(element));
+}
+
+END
+;
+ } else {
print F <<END
static v8::Handle<v8::Value> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element)
{
return toV8(static_cast<${JSInterfaceName}*>(element));
}
+
END
;
+ }
}
if ($conditional) {
@@ -895,8 +913,17 @@
printElementIncludes($F);
- print F "\n#include <wtf/StdLibExtras.h>\n\n";
+ print F <<END
+#include <wtf/StdLibExtras.h>
+#if ENABLE(VIDEO)
+#include "Document.h"
+#include "Settings.h"
+#endif
+
+END
+;
+
if ($wrapperFactoryType eq "JS") {
print F <<END
using namespace JSC;
« no previous file with comments | « LayoutTests/media/svg-as-image-with-media-blocked-expected.txt ('k') | WebCore/page/Settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698