diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-31 22:04:12 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-31 22:04:12 +0000 |
commit | 6ea03c81c023985462cc85ac1f08015c7af41ff2 (patch) | |
tree | 327da1cb17e38a23d3f995e32b5033ae35fe70f7 | |
parent | 67747a95c47dfb44168e68db6d36286e2029571b (diff) | |
download | chromium_src-6ea03c81c023985462cc85ac1f08015c7af41ff2.zip chromium_src-6ea03c81c023985462cc85ac1f08015c7af41ff2.tar.gz chromium_src-6ea03c81c023985462cc85ac1f08015c7af41ff2.tar.bz2 |
Updated project files and added V8 bindings for HTML5 media/audio/video/sourcetags. Required some changes to CodeGeneratorV8.pm in order to generate headerguards. I left video disabled, but for those interested in building with HTML5media tags add ENABLE_VIDEO=1 to webkit_common_defines.vsprops and addENABLE_VIDEO to the FEATURE_DEFINES string in the build-generated-files.shscript.
Review URL: http://codereview.chromium.org/8198
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4332 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/build/V8Bindings/SConscript | 5 | ||||
-rw-r--r-- | webkit/build/V8Bindings/V8Bindings.vcproj | 48 | ||||
-rw-r--r-- | webkit/build/WebCore/SConscript | 5 | ||||
-rw-r--r-- | webkit/build/WebCore/WebCore.vcproj | 40 | ||||
-rw-r--r-- | webkit/build/port/port.vcproj | 8 | ||||
-rw-r--r-- | webkit/build/webkit_common_defines.vsprops | 2 | ||||
-rw-r--r-- | webkit/port/DerivedSources.make | 6 | ||||
-rw-r--r-- | webkit/port/bindings/scripts/CodeGeneratorV8.pm | 23 | ||||
-rw-r--r-- | webkit/port/bindings/v8/v8_index.cpp | 9 | ||||
-rw-r--r-- | webkit/port/bindings/v8/v8_index.h | 19 | ||||
-rw-r--r-- | webkit/port/bindings/v8/v8_proxy.cpp | 11 | ||||
-rw-r--r-- | webkit/port/platform/MIMETypeRegistry.cpp | 8 | ||||
-rw-r--r-- | webkit/port/platform/graphics/chromium/MediaPlayerPrivateChromium.cpp | 165 | ||||
-rw-r--r-- | webkit/port/platform/graphics/chromium/MediaPlayerPrivateChromium.h | 71 |
14 files changed, 416 insertions, 4 deletions
diff --git a/webkit/build/V8Bindings/SConscript b/webkit/build/V8Bindings/SConscript index c8e9cf5..0229d44 100644 --- a/webkit/build/V8Bindings/SConscript +++ b/webkit/build/V8Bindings/SConscript @@ -93,6 +93,7 @@ inputs = [ '$DERIVED_DIR/V8HTMLAnchorElement.cpp', '$DERIVED_DIR/V8HTMLAppletElement.cpp', '$DERIVED_DIR/V8HTMLAreaElement.cpp', + '$DERIVED_DIR/V8HTMLAudioElement.cpp', '$DERIVED_DIR/V8HTMLBaseElement.cpp', '$DERIVED_DIR/V8HTMLBaseFontElement.cpp', '$DERIVED_DIR/V8HTMLBlockquoteElement.cpp', @@ -126,6 +127,7 @@ inputs = [ '$DERIVED_DIR/V8HTMLLinkElement.cpp', '$DERIVED_DIR/V8HTMLMapElement.cpp', '$DERIVED_DIR/V8HTMLMarqueeElement.cpp', + '$DERIVED_DIR/V8HTMLMediaElement.cpp', '$DERIVED_DIR/V8HTMLMenuElement.cpp', '$DERIVED_DIR/V8HTMLMetaElement.cpp', '$DERIVED_DIR/V8HTMLModElement.cpp', @@ -150,10 +152,12 @@ inputs = [ '$DERIVED_DIR/V8HTMLTextAreaElement.cpp', '$DERIVED_DIR/V8HTMLTitleElement.cpp', '$DERIVED_DIR/V8HTMLUListElement.cpp', + '$DERIVED_DIR/V8HTMLVideoElement.cpp', '$DERIVED_DIR/V8ImageData.cpp', '$DERIVED_DIR/V8InspectorController.cpp', '$DERIVED_DIR/V8KeyboardEvent.cpp', '$DERIVED_DIR/V8Location.cpp', + '$DERIVED_DIR/V8MediaError.cpp', '$DERIVED_DIR/V8MediaList.cpp', '$DERIVED_DIR/V8MessageChannel.cpp', '$DERIVED_DIR/V8MessageEvent.cpp', @@ -292,6 +296,7 @@ inputs = [ '$DERIVED_DIR/V8Text.cpp', '$DERIVED_DIR/V8TextEvent.cpp', '$DERIVED_DIR/V8TextMetrics.cpp', + '$DERIVED_DIR/V8TimeRanges.cpp', '$DERIVED_DIR/V8TreeWalker.cpp', '$DERIVED_DIR/V8UIEvent.cpp', '$DERIVED_DIR/V8UndetectableHTMLCollection.cpp', diff --git a/webkit/build/V8Bindings/V8Bindings.vcproj b/webkit/build/V8Bindings/V8Bindings.vcproj index da3775c..12041b7 100644 --- a/webkit/build/V8Bindings/V8Bindings.vcproj +++ b/webkit/build/V8Bindings/V8Bindings.vcproj @@ -544,6 +544,14 @@ > </File> <File + RelativePath="$(IntDir)\DerivedSources\V8HTMLAudioElement.cpp" + > + </File> + <File + RelativePath="$(IntDir)\DerivedSources\V8HTMLAudioElement.h" + > + </File> + <File RelativePath="$(IntDir)\DerivedSources\V8HTMLBaseElement.cpp" > </File> @@ -808,6 +816,14 @@ > </File> <File + RelativePath="$(IntDir)\DerivedSources\V8HTMLMediaElement.cpp" + > + </File> + <File + RelativePath="$(IntDir)\DerivedSources\V8HTMLMediaElement.h" + > + </File> + <File RelativePath="$(IntDir)\DerivedSources\V8HTMLMenuElement.cpp" > </File> @@ -920,6 +936,14 @@ > </File> <File + RelativePath="$(IntDir)\DerivedSources\V8HTMLSourceElement.cpp" + > + </File> + <File + RelativePath="$(IntDir)\DerivedSources\V8HTMLSourceElement.h" + > + </File> + <File RelativePath="$(IntDir)\DerivedSources\V8HTMLStyleElement.cpp" > </File> @@ -1000,6 +1024,14 @@ > </File> <File + RelativePath="$(IntDir)\DerivedSources\V8HTMLVideoElement.cpp" + > + </File> + <File + RelativePath="$(IntDir)\DerivedSources\V8HTMLVideoElement.h" + > + </File> + <File RelativePath="$(IntDir)\DerivedSources\V8ImageData.cpp" > </File> @@ -1032,6 +1064,14 @@ > </File> <File + RelativePath="$(IntDir)\DerivedSources\V8MediaError.cpp" + > + </File> + <File + RelativePath="$(IntDir)\DerivedSources\V8MediaError.h" + > + </File> + <File RelativePath="$(IntDir)\DerivedSources\V8MediaList.cpp" > </File> @@ -2136,6 +2176,14 @@ > </File> <File + RelativePath="$(IntDir)\DerivedSources\V8TimeRanges.cpp" + > + </File> + <File + RelativePath="$(IntDir)\DerivedSources\V8TimeRanges.h" + > + </File> + <File RelativePath="$(IntDir)\DerivedSources\V8TreeWalker.cpp" > </File> diff --git a/webkit/build/WebCore/SConscript b/webkit/build/WebCore/SConscript index e0a29dd..032ce63 100644 --- a/webkit/build/WebCore/SConscript +++ b/webkit/build/WebCore/SConscript @@ -291,6 +291,7 @@ input_files = [ '$WEBCORE_DIR/html/HTMLQuoteElement.cpp', '$WEBCORE_DIR/html/HTMLScriptElement.cpp', '$WEBCORE_DIR/html/HTMLSelectElement.cpp', + '$WEBCORE_DIR/html/HTMLSourceElement.cpp', '$WEBCORE_DIR/html/HTMLStyleElement.cpp', '$WEBCORE_DIR/html/HTMLTableCaptionElement.cpp', '$WEBCORE_DIR/html/HTMLTableCellElement.cpp', @@ -330,6 +331,7 @@ input_files = [ '$WEBCORE_DIR/loader/ImageLoader.cpp', '$WEBCORE_DIR/loader/loader.cpp', '$WEBCORE_DIR/loader/MainResourceLoader.cpp', + '$WEBCORE_DIR/loader/MediaDocument.cpp', '$WEBCORE_DIR/loader/NavigationAction.cpp', '$WEBCORE_DIR/loader/NetscapePlugInStreamLoader.cpp', '$WEBCORE_DIR/loader/PluginDocument.cpp', @@ -423,6 +425,8 @@ input_files = [ '$WEBCORE_DIR/platform/graphics/GraphicsTypes.cpp', '$WEBCORE_DIR/platform/graphics/Image.cpp', '$WEBCORE_DIR/platform/graphics/IntRect.cpp', + '$WEBCORE_DIR/platform/graphics/MediaPlayer.cpp', + '$PORT_DIR/platform/graphics/chromium/MediaPlayerPrivateChromium.cpp', '$WEBCORE_DIR/platform/graphics/Path.cpp', '$WEBCORE_DIR/platform/graphics/PathTraversalState.cpp', '$WEBCORE_DIR/platform/graphics/Pattern.cpp', @@ -511,6 +515,7 @@ input_files = [ '$WEBCORE_DIR/rendering/RenderListItem.cpp', '$WEBCORE_DIR/rendering/RenderListMarker.cpp', '$WEBCORE_DIR/rendering/RenderMarquee.cpp', + '$WEBCORE_DIR/rendering/RenderMedia.cpp', '$WEBCORE_DIR/rendering/RenderMenuList.cpp', '$WEBCORE_DIR/rendering/RenderObject.cpp', '$WEBCORE_DIR/rendering/RenderPart.cpp', diff --git a/webkit/build/WebCore/WebCore.vcproj b/webkit/build/WebCore/WebCore.vcproj index 1512dc7..7a1be9c 100644 --- a/webkit/build/WebCore/WebCore.vcproj +++ b/webkit/build/WebCore/WebCore.vcproj @@ -662,6 +662,14 @@ > </File> <File + RelativePath="..\..\..\third_party\WebKit\WebCore\loader\MediaDocument.cpp" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\WebCore\loader\MediaDocument.h" + > + </File> + <File RelativePath="..\..\..\third_party\WebKit\WebCore\loader\NavigationAction.cpp" > </File> @@ -1257,6 +1265,14 @@ > </File> <File + RelativePath="..\..\..\third_party\WebKit\WebCore\platform\graphics\MediaPlayer.cpp" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\WebCore\platform\graphics\MediaPlayer.h" + > + </File> + <File RelativePath="..\..\..\third_party\WebKit\WebCore\platform\graphics\Path.cpp" > </File> @@ -2486,6 +2502,14 @@ > </File> <File + RelativePath="..\..\..\third_party\WebKit\WebCore\rendering\RenderMedia.cpp" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\WebCore\rendering\RenderMedia.h" + > + </File> + <File RelativePath="..\..\..\third_party\WebKit\WebCore\rendering\RenderMenuList.cpp" > </File> @@ -4954,6 +4978,14 @@ > </File> <File + RelativePath="..\..\..\third_party\WebKit\WebCore\html\HTMLSourceElement.cpp" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\WebCore\html\HTMLSourceElement.h" + > + </File> + <File RelativePath="..\..\..\third_party\WebKit\WebCore\html\HTMLStyleElement.cpp" > </File> @@ -5089,6 +5121,14 @@ RelativePath="..\..\..\third_party\WebKit\WebCore\html\PreloadScanner.h" > </File> + <File + RelativePath="..\..\..\third_party\WebKit\WebCore\html\TimeRanges.cpp" + > + </File> + <File + RelativePath="..\..\..\third_party\WebKit\WebCore\html\TimeRanges.h" + > + </File> </Filter> <Filter Name="history" diff --git a/webkit/build/port/port.vcproj b/webkit/build/port/port.vcproj index 6f5393b..17e2ba0 100644 --- a/webkit/build/port/port.vcproj +++ b/webkit/build/port/port.vcproj @@ -1018,6 +1018,14 @@ > </File> <File + RelativePath="..\..\port\platform\graphics\chromium\MediaPlayerPrivateChromium.cpp" + > + </File> + <File + RelativePath="..\..\port\platform\graphics\chromium\MediaPlayerPrivateChromium.h" + > + </File> + <File RelativePath="..\..\port\platform\graphics\chromium\PlatformIcon.h" > </File> diff --git a/webkit/build/webkit_common_defines.vsprops b/webkit/build/webkit_common_defines.vsprops index 7f42fc2..dcf24fc 100644 --- a/webkit/build/webkit_common_defines.vsprops +++ b/webkit/build/webkit_common_defines.vsprops @@ -6,6 +6,6 @@ > <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="ENABLE_DATABASE=0;ENABLE_DASHBOARD_SUPPORT=0;ENABLE_JAVASCRIPT_DEBUGGER=0;ENABLE_JSC_MULTIPLE_THREADS=0;ENABLE_ICONDATABASE=0;ENABLE_XSLT=1;ENABLE_XPATH=1;ENABLE_SVG=1;ENABLE_SVG_ANIMATION=1;ENABLE_SVG_AS_IMAGE=1;ENABLE_SVG_USE=1;ENABLE_SVG_FOREIGN_OBJECT=1;ENABLE_SVG_FONTS=1;WEBCORE_NAVIGATOR_PLATFORM="\"Win32\"";USE_GOOGLE_URL_LIBRARY;USE_SYSTEM_MALLOC=1;CRASH=__debugbreak;BUILDING_CHROMIUM__=1;" + PreprocessorDefinitions="ENABLE_DATABASE=0;ENABLE_DASHBOARD_SUPPORT=0;ENABLE_JAVASCRIPT_DEBUGGER=0;ENABLE_JSC_MULTIPLE_THREADS=0;ENABLE_ICONDATABASE=0;ENABLE_XSLT=1;ENABLE_XPATH=1;ENABLE_SVG=1;ENABLE_SVG_ANIMATION=1;ENABLE_SVG_AS_IMAGE=1;ENABLE_SVG_USE=1;ENABLE_SVG_FOREIGN_OBJECT=1;ENABLE_SVG_FONTS=1;ENABLE_VIDEO=0;WEBCORE_NAVIGATOR_PLATFORM="\"Win32\"";USE_GOOGLE_URL_LIBRARY;USE_SYSTEM_MALLOC=1;CRASH=__debugbreak;BUILDING_CHROMIUM__=1;" /> </VisualStudioPropertySheet> diff --git a/webkit/port/DerivedSources.make b/webkit/port/DerivedSources.make index e832dec..2e94a2e 100644 --- a/webkit/port/DerivedSources.make +++ b/webkit/port/DerivedSources.make @@ -673,6 +673,7 @@ all : \ V8HTMLAnchorElement.h \ V8HTMLAppletElement.h \ V8HTMLAreaElement.h \ + V8HTMLAudioElement.h \ V8HTMLBaseElement.h \ V8HTMLBaseFontElement.h \ V8HTMLBlockquoteElement.h \ @@ -706,6 +707,7 @@ all : \ V8HTMLLinkElement.h \ V8HTMLMapElement.h \ V8HTMLMarqueeElement.h \ + V8HTMLMediaElement.h \ V8HTMLMenuElement.h \ V8HTMLMetaElement.h \ V8HTMLModElement.h \ @@ -720,6 +722,7 @@ all : \ V8HTMLQuoteElement.h \ V8HTMLScriptElement.h \ V8HTMLSelectElement.h \ + V8HTMLSourceElement.h \ V8HTMLStyleElement.h \ V8HTMLTableCaptionElement.h \ V8HTMLTableCellElement.h \ @@ -730,9 +733,11 @@ all : \ V8HTMLTextAreaElement.h \ V8HTMLTitleElement.h \ V8HTMLUListElement.h \ + V8HTMLVideoElement.h \ V8History.h \ V8ImageData.h \ V8KeyboardEvent.h \ + V8MediaError.h \ V8MediaList.h \ V8MessageChannel.h \ V8MessageEvent.h \ @@ -891,6 +896,7 @@ all : \ V8Text.h \ V8TextMetrics.h \ V8TextEvent.h \ + V8TimeRanges.h \ V8TreeWalker.h \ V8UIEvent.h \ V8VoidCallback.h \ diff --git a/webkit/port/bindings/scripts/CodeGeneratorV8.pm b/webkit/port/bindings/scripts/CodeGeneratorV8.pm index 87353ca..1da6318 100644 --- a/webkit/port/bindings/scripts/CodeGeneratorV8.pm +++ b/webkit/port/bindings/scripts/CodeGeneratorV8.pm @@ -254,6 +254,8 @@ sub GenerateHeader # - Add header protection if ($className =~ /^V8SVG/) { push(@headerContent, "\n#if ENABLE(SVG)\n"); + } elsif (IsVideoClassName($className)) { + push(@headerContent, "\n#if ENABLE(VIDEO)\n"); } push(@headerContent, "\n#ifndef $className" . "_H"); @@ -290,6 +292,8 @@ END if ($className =~ /^V8SVG/) { push(@headerContent, "\n#endif // ENABLE(SVG)\n"); + } elsif (IsVideoClassName($className)) { + push(@headerContent, "\n#endif // ENABLE(VIDEO)\n"); } } @@ -849,6 +853,8 @@ sub GenerateImplementation if ($className =~ /^V8SVG/) { push(@implFixedHeader, "#if ENABLE(SVG)\n\n"); + } elsif (IsVideoClassName($className)) { + push(@implFixedHeader, "#if ENABLE(VIDEO)\n\n"); } if ($className =~ /^V8SVGAnimated/) { @@ -1211,6 +1217,8 @@ END if ($className =~ /^V8SVG/) { push(@implContent, "\n#endif // ENABLE(SVG)\n"); + } elsif (IsVideoClassName($className)) { + push(@implContent, "\n#endif // ENABLE(VIDEO)\n"); } } @@ -1431,6 +1439,7 @@ sub IsRefPtrType return 1 if $type eq "HTMLElement"; return 1 if $type eq "HTMLOptionsCollection"; return 1 if $type eq "ImageData"; + return 1 if $type eq "MediaError"; return 1 if $type eq "MimeType"; return 1 if $type eq "Node"; return 1 if $type eq "NodeList"; @@ -1442,6 +1451,7 @@ sub IsRefPtrType return 1 if $type eq "Range"; return 1 if $type eq "Text"; return 1 if $type eq "TextMetrics"; + return 1 if $type eq "TimeRanges"; return 1 if $type eq "TreeWalker"; return 1 if $type eq "XPathExpression"; return 1 if $type eq "XPathNSResolver"; @@ -1457,6 +1467,19 @@ sub IsRefPtrType return 0; } +sub IsVideoClassName +{ + my $class = shift; + return 1 if $class eq "V8HTMLAudioElement"; + return 1 if $class eq "V8HTMLMediaElement"; + return 1 if $class eq "V8HTMLSourceElement"; + return 1 if $class eq "V8HTMLVideoElement"; + return 1 if $class eq "V8MediaError"; + return 1 if $class eq "V8TimeRanges"; + + return 0; +} + sub GetNativeType { my $type = shift; diff --git a/webkit/port/bindings/v8/v8_index.cpp b/webkit/port/bindings/v8/v8_index.cpp index d785d73..8909b76 100644 --- a/webkit/port/bindings/v8/v8_index.cpp +++ b/webkit/port/bindings/v8/v8_index.cpp @@ -343,6 +343,15 @@ #include "V8SVGZoomEvent.h" #endif +#if ENABLE(VIDEO) +#include "V8HTMLAudioElement.h" +#include "V8HTMLMediaElement.h" +#include "V8HTMLSourceElement.h" +#include "V8HTMLVideoElement.h" +#include "V8MediaError.h" +#include "V8TimeRanges.h" +#endif + namespace WebCore { FunctionTemplateFactory V8ClassIndex::GetFactory(V8WrapperType type) { diff --git a/webkit/port/bindings/v8/v8_index.h b/webkit/port/bindings/v8/v8_index.h index eb846fd..e192291 100644 --- a/webkit/port/bindings/v8/v8_index.h +++ b/webkit/port/bindings/v8/v8_index.h @@ -15,6 +15,19 @@ class XMLHttpRequest; typedef v8::Persistent<v8::FunctionTemplate> (*FunctionTemplateFactory)(); +#if ENABLE(VIDEO) +#define VIDEO_HTMLELEMENT_TYPES(V) \ + V(HTMLAUDIOELEMENT, HTMLAudioElement) \ + V(HTMLMEDIAELEMENT, HTMLMediaElement) \ + V(HTMLSOURCEELEMENT, HTMLSourceElement) \ + V(HTMLVIDEOELEMENT, HTMLVideoElement) +#define VIDEO_NONNODE_WRAPPER_TYPES(V) \ + V(MEDIAERROR, MediaError) \ + V(TIMERANGES, TimeRanges) +#else +#define VIDEO_HTMLELEMENT_TYPES(V) +#define VIDEO_NONNODE_WRAPPER_TYPES(V) +#endif #define NODE_WRAPPER_TYPES(V) \ V(ATTR, Attr) \ @@ -91,7 +104,8 @@ typedef v8::Persistent<v8::FunctionTemplate> (*FunctionTemplateFactory)(); V(HTMLTEXTAREAELEMENT, HTMLTextAreaElement) \ V(HTMLTITLEELEMENT, HTMLTitleElement) \ V(HTMLULISTELEMENT, HTMLUListElement) \ - V(HTMLELEMENT, HTMLElement) + V(HTMLELEMENT, HTMLElement) \ + VIDEO_HTMLELEMENT_TYPES(V) #if ENABLE(SVG_ANIMATION) #define SVG_ANIMATION_ELEMENT_TYPES(V) \ @@ -297,7 +311,8 @@ typedef v8::Persistent<v8::FunctionTemplate> (*FunctionTemplateFactory)(); V(XPATHEXPRESSION, XPathExpression) \ V(XPATHNSRESOLVER, XPathNSResolver) \ V(XPATHRESULT, XPathResult) \ - V(XSLTPROCESSOR, XSLTProcessor) + V(XSLTPROCESSOR, XSLTProcessor) \ + VIDEO_NONNODE_WRAPPER_TYPES(V) #if ENABLE(SVG) #define SVGNODE_WRAPPER_TYPES(V) \ diff --git a/webkit/port/bindings/v8/v8_proxy.cpp b/webkit/port/bindings/v8/v8_proxy.cpp index 4e84ae1..fb92d44 100644 --- a/webkit/port/bindings/v8/v8_proxy.cpp +++ b/webkit/port/bindings/v8/v8_proxy.cpp @@ -2225,6 +2225,14 @@ bool V8Proxy::IsWrapperOfType(v8::Handle<v8::Value> value, return V8ClassIndex::FromInt(type->Int32Value()) == classType; } +#if ENABLE(VIDEO) +#define FOR_EACH_VIDEO_TAG(macro) \ + macro(audio, AUDIO) \ + macro(source, SOURCE) \ + macro(video, VIDEO) +#else +#define FOR_EACH_VIDEO_TAG(macro) +#endif #define FOR_EACH_TAG(macro) \ macro(a, ANCHOR) \ @@ -2296,7 +2304,8 @@ bool V8Proxy::IsWrapperOfType(v8::Handle<v8::Value> value, macro(textarea, TEXTAREA) \ macro(title, TITLE) \ macro(ul, ULIST) \ - macro(xmp, PRE) + macro(xmp, PRE) \ + FOR_EACH_VIDEO_TAG(macro) V8ClassIndex::V8WrapperType V8Proxy::GetHTMLElementType(HTMLElement* element) { diff --git a/webkit/port/platform/MIMETypeRegistry.cpp b/webkit/port/platform/MIMETypeRegistry.cpp index 1c3f38b..58c7285 100644 --- a/webkit/port/platform/MIMETypeRegistry.cpp +++ b/webkit/port/platform/MIMETypeRegistry.cpp @@ -26,6 +26,7 @@ #include "config.h" #include "CString.h" #include "MIMETypeRegistry.h" +#include "MediaPlayer.h" #include "StringHash.h" #include <wtf/HashMap.h> #include <wtf/HashSet.h> @@ -103,6 +104,13 @@ bool MIMETypeRegistry::isSupportedNonImageMIMEType(const String& mimeType) && net::IsSupportedNonImageMimeType(mimeType.latin1().data()); } +#if ENABLE(VIDEO) +bool MIMETypeRegistry::isSupportedMediaMIMEType(const String& mimeType) +{ + return MediaPlayer::supportsType(mimeType); +} +#endif + bool MIMETypeRegistry::isJavaAppletMIMEType(const String& mimeType) { // Since this set is very limited and is likely to remain so we won't bother with the overhead diff --git a/webkit/port/platform/graphics/chromium/MediaPlayerPrivateChromium.cpp b/webkit/port/platform/graphics/chromium/MediaPlayerPrivateChromium.cpp new file mode 100644 index 0000000..6081d2f --- /dev/null +++ b/webkit/port/platform/graphics/chromium/MediaPlayerPrivateChromium.cpp @@ -0,0 +1,165 @@ +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file.
+
+#include "config.h"
+
+#if ENABLE(VIDEO)
+
+#include "MediaPlayerPrivateChromium.h"
+
+namespace WebCore {
+
+MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player)
+ : m_player(player)
+ , m_networkState(MediaPlayer::Empty)
+ , m_readyState(MediaPlayer::DataUnavailable)
+{
+}
+
+MediaPlayerPrivate::~MediaPlayerPrivate()
+{
+}
+
+IntSize MediaPlayerPrivate::naturalSize() const
+{
+ return IntSize(0, 0);
+}
+
+bool MediaPlayerPrivate::hasVideo() const
+{
+ return false;
+}
+
+void MediaPlayerPrivate::load(const String& url)
+{
+ // Always fail for now
+ m_networkState = MediaPlayer::LoadFailed;
+ m_readyState = MediaPlayer::DataUnavailable;
+ m_player->networkStateChanged();
+ m_player->readyStateChanged();
+}
+
+void MediaPlayerPrivate::cancelLoad()
+{
+}
+
+void MediaPlayerPrivate::play()
+{
+}
+
+void MediaPlayerPrivate::pause()
+{
+}
+
+bool MediaPlayerPrivate::paused() const
+{
+ return true;
+}
+
+bool MediaPlayerPrivate::seeking() const
+{
+ return false;
+}
+
+float MediaPlayerPrivate::duration() const
+{
+ return 0.0f;
+}
+
+float MediaPlayerPrivate::currentTime() const
+{
+ return 0.0f;
+}
+
+void MediaPlayerPrivate::seek(float time)
+{
+}
+
+void MediaPlayerPrivate::setEndTime(float)
+{
+}
+
+void MediaPlayerPrivate::setRate(float)
+{
+}
+
+void MediaPlayerPrivate::setVolume(float)
+{
+}
+
+int MediaPlayerPrivate::dataRate() const
+{
+ return 0;
+}
+
+MediaPlayer::NetworkState MediaPlayerPrivate::networkState() const
+{
+ return m_networkState;
+}
+
+MediaPlayer::ReadyState MediaPlayerPrivate::readyState() const
+{
+ return m_readyState;
+}
+
+float MediaPlayerPrivate::maxTimeBuffered() const
+{
+ return 0.0f;
+}
+
+float MediaPlayerPrivate::maxTimeSeekable() const
+{
+ return 0.0f;
+}
+
+unsigned MediaPlayerPrivate::bytesLoaded() const
+{
+ return 0;
+}
+
+bool MediaPlayerPrivate::totalBytesKnown() const
+{
+ return false;
+}
+
+unsigned MediaPlayerPrivate::totalBytes() const
+{
+ return 0;
+}
+
+void MediaPlayerPrivate::setVisible(bool)
+{
+}
+
+void MediaPlayerPrivate::setRect(const IntRect&)
+{
+}
+
+void MediaPlayerPrivate::loadStateChanged()
+{
+}
+
+void MediaPlayerPrivate::didEnd()
+{
+}
+
+void MediaPlayerPrivate::paint(GraphicsContext* p, const IntRect& r)
+{
+}
+
+void MediaPlayerPrivate::getSupportedTypes(HashSet<String>& types)
+{
+ // We support nothing right now!
+}
+
+bool MediaPlayerPrivate::isAvailable()
+{
+ // Must return true in order to build HTMLMedia/Video/AudioElements,
+ // otherwise WebKit will replace the tags with an empty tag
+ return true;
+}
+
+}
+
+#endif
diff --git a/webkit/port/platform/graphics/chromium/MediaPlayerPrivateChromium.h b/webkit/port/platform/graphics/chromium/MediaPlayerPrivateChromium.h new file mode 100644 index 0000000..42280df --- /dev/null +++ b/webkit/port/platform/graphics/chromium/MediaPlayerPrivateChromium.h @@ -0,0 +1,71 @@ +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file.
+
+#ifndef MediaPlayerPrivateChromium_h
+#define MediaPlayerPrivateChromium_h
+
+#if ENABLE(VIDEO)
+
+#include "MediaPlayer.h"
+
+namespace WebCore {
+
+ class MediaPlayerPrivate : public Noncopyable {
+ public:
+ MediaPlayerPrivate(MediaPlayer*);
+ ~MediaPlayerPrivate();
+
+ IntSize naturalSize() const;
+ bool hasVideo() const;
+
+ void load(const String& url);
+ void cancelLoad();
+
+ void play();
+ void pause();
+
+ bool paused() const;
+ bool seeking() const;
+
+ float duration() const;
+ float currentTime() const;
+ void seek(float time);
+ void setEndTime(float);
+
+ void setRate(float);
+ void setVolume(float);
+
+ int dataRate() const;
+
+ MediaPlayer::NetworkState networkState() const;
+ MediaPlayer::ReadyState readyState() const;
+
+ float maxTimeBuffered() const;
+ float maxTimeSeekable() const;
+ unsigned bytesLoaded() const;
+ bool totalBytesKnown() const;
+ unsigned totalBytes() const;
+
+ void setVisible(bool);
+ void setRect(const IntRect&);
+
+ void loadStateChanged();
+ void didEnd();
+
+ void paint(GraphicsContext*, const IntRect&);
+
+ static void getSupportedTypes(HashSet<String>& types);
+ static bool isAvailable();
+
+ private:
+ MediaPlayer* m_player;
+ MediaPlayer::NetworkState m_networkState;
+ MediaPlayer::ReadyState m_readyState;
+ };
+
+}
+
+#endif
+
+#endif // MediaPlayerPrivateChromium_h
|