From c30bd2ef973d90ae6b658432b9296c4f9f368bbc Mon Sep 17 00:00:00 2001 From: "commit-queue@webkit.org" Date: Tue, 17 Apr 2012 00:48:17 +0000 Subject: [PATCH] Fix WebKit style violations in Chromium WebMediaPlayer.h & WebMediaPlayerClient.h https://bugs.webkit.org/show_bug.cgi?id=84046 Patch by Aaron Colwell on 2012-04-16 Reviewed by Darin Fisher. * WebKit.gyp: * public/WebMediaPlayer.h: (WebKit): * public/WebMediaPlayerClient.h: * public/WebTimeRange.h: Copied from Source/WebKit/chromium/public/WebMediaPlayerClient.h. (WebKit): (WebKit::WebTimeRange::WebTimeRange): (WebTimeRange): * src/AssertMatchingEnums.cpp: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114329 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebKit/chromium/ChangeLog | 17 +++++ Source/WebKit/chromium/WebKit.gyp | 1 + Source/WebKit/chromium/public/WebMediaPlayer.h | 87 +++++++++++++--------- .../WebKit/chromium/public/WebMediaPlayerClient.h | 18 +++-- Source/WebKit/chromium/public/WebTimeRange.h | 50 +++++++++++++ Source/WebKit/chromium/src/AssertMatchingEnums.cpp | 66 +++++++++------- 6 files changed, 169 insertions(+), 70 deletions(-) create mode 100644 Source/WebKit/chromium/public/WebTimeRange.h diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog index e461cde..08fef83 100644 --- a/Source/WebKit/chromium/ChangeLog +++ b/Source/WebKit/chromium/ChangeLog @@ -1,3 +1,20 @@ +2012-04-16 Aaron Colwell + + Fix WebKit style violations in Chromium WebMediaPlayer.h & WebMediaPlayerClient.h + https://bugs.webkit.org/show_bug.cgi?id=84046 + + Reviewed by Darin Fisher. + + * WebKit.gyp: + * public/WebMediaPlayer.h: + (WebKit): + * public/WebMediaPlayerClient.h: + * public/WebTimeRange.h: Copied from Source/WebKit/chromium/public/WebMediaPlayerClient.h. + (WebKit): + (WebKit::WebTimeRange::WebTimeRange): + (WebTimeRange): + * src/AssertMatchingEnums.cpp: + 2012-04-16 Terry Anderson [chromium] Allow WebGestureEvent to store four floating point values diff --git a/Source/WebKit/chromium/WebKit.gyp b/Source/WebKit/chromium/WebKit.gyp index fe4c3dd..84eb063 100644 --- a/Source/WebKit/chromium/WebKit.gyp +++ b/Source/WebKit/chromium/WebKit.gyp @@ -272,6 +272,7 @@ 'public/WebTextFieldDecoratorClient.h', 'public/WebTextInputType.h', 'public/WebTextRun.h', + 'public/WebTimeRange.h', 'public/WebURLLoaderOptions.h', 'public/WebUserMediaClient.h', 'public/WebUserMediaRequest.h', diff --git a/Source/WebKit/chromium/public/WebMediaPlayer.h b/Source/WebKit/chromium/public/WebMediaPlayer.h index 2049b59..c293cee 100644 --- a/Source/WebKit/chromium/public/WebMediaPlayer.h +++ b/Source/WebKit/chromium/public/WebMediaPlayer.h @@ -31,9 +31,9 @@ #ifndef WebMediaPlayer_h #define WebMediaPlayer_h +#include "WebTimeRange.h" #include "WebVideoFrame.h" #include "platform/WebCanvas.h" -#include "platform/WebVector.h" namespace WebKit { @@ -46,61 +46,76 @@ class WebURL; struct WebRect; struct WebSize; -struct WebTimeRange { - WebTimeRange() : start(0), end(0) {} - WebTimeRange(float s, float e) : start(s), end(e) {} - - float start; - float end; -}; - -typedef WebVector WebTimeRanges; - class WebMediaPlayer { public: enum NetworkState { - Empty, - Idle, - Loading, - Loaded, - FormatError, - NetworkError, - DecodeError, + NetworkStateEmpty, + NetworkStateIdle, + NetworkStateLoading, + NetworkStateLoaded, + NetworkStateFormatError, + NetworkStateNetworkError, + NetworkStateDecodeError, + Empty = NetworkStateEmpty, + Idle = NetworkStateIdle, + Loading = NetworkStateLoading, + Loaded = NetworkStateLoaded, + FormatError = NetworkStateFormatError, + NetworkError = NetworkStateNetworkError, + DecodeError = NetworkStateDecodeError, }; enum ReadyState { - HaveNothing, - HaveMetadata, - HaveCurrentData, - HaveFutureData, - HaveEnoughData, + ReadyStateHaveNothing, + ReadyStateHaveMetadata, + ReadyStateHaveCurrentData, + ReadyStateHaveFutureData, + ReadyStateHaveEnoughData, + HaveNothing = ReadyStateHaveNothing, + HaveMetadata = ReadyStateHaveMetadata, + HaveCurrentData = ReadyStateHaveCurrentData, + HaveFutureData = ReadyStateHaveFutureData, + HaveEnoughData = ReadyStateHaveEnoughData, }; enum MovieLoadType { - Unknown, - Download, - StoredStream, - LiveStream, + MovieLoadTypeUnknown, + MovieLoadTypeDownload, + MovieLoadTypeStoredStream, + MovieLoadTypeLiveStream, + Unknown = MovieLoadTypeUnknown, + Download = MovieLoadTypeDownload, + StoredStream = MovieLoadTypeStoredStream, + LiveStream = MovieLoadTypeLiveStream, }; enum Preload { - None, - MetaData, - Auto, + PreloadNone, + PreloadMetaData, + PreloadAuto, + None = PreloadNone, + MetaData = PreloadMetaData, + Auto = PreloadAuto, }; enum EndOfStreamStatus { - EosNoError, - EosNetworkError, - EosDecodeError, + EndOfStreamStatusNoError, + EndOfStreamStatusNetworkError, + EndOfStreamStatusDecodeError, + EosNoError = EndOfStreamStatusNoError, + EosNetworkError = EndOfStreamStatusNetworkError, + EosDecodeError = EndOfStreamStatusDecodeError, }; // Represents synchronous exceptions that can be thrown from the Encrypted // Media methods. This is different from the asynchronous MediaKeyError. enum MediaKeyException { - NoError, - InvalidPlayerState, - KeySystemNotSupported + MediaKeyExceptionNoError, + MediaKeyExceptionInvalidPlayerState, + MediaKeyExceptionKeySystemNotSupported, + NoError = MediaKeyExceptionNoError, + InvalidPlayerState = MediaKeyExceptionInvalidPlayerState, + KeySystemNotSupported = MediaKeyExceptionKeySystemNotSupported, }; virtual ~WebMediaPlayer() {} diff --git a/Source/WebKit/chromium/public/WebMediaPlayerClient.h b/Source/WebKit/chromium/public/WebMediaPlayerClient.h index c9d31e4..786bf5a 100644 --- a/Source/WebKit/chromium/public/WebMediaPlayerClient.h +++ b/Source/WebKit/chromium/public/WebMediaPlayerClient.h @@ -41,12 +41,18 @@ class WebURL; class WebMediaPlayerClient { public: enum MediaKeyErrorCode { - UnknownError = 1, - ClientError, - ServiceError, - OutputError, - HardwareChangeError, - DomainError + MediaKeyErrorCodeUnknown = 1, + MediaKeyErrorCodeClient, + MediaKeyErrorCodeService, + MediaKeyErrorCodeOutput, + MediaKeyErrorCodeHardwareChange, + MediaKeyErrorCodeDomain, + UnknownError = MediaKeyErrorCodeUnknown, + ClientError = MediaKeyErrorCodeClient, + ServiceError = MediaKeyErrorCodeService, + OutputError = MediaKeyErrorCodeOutput, + HardwareChangeError = MediaKeyErrorCodeHardwareChange, + DomainError = MediaKeyErrorCodeDomain, }; virtual void networkStateChanged() = 0; diff --git a/Source/WebKit/chromium/public/WebTimeRange.h b/Source/WebKit/chromium/public/WebTimeRange.h new file mode 100644 index 0000000..d1a3a20 --- /dev/null +++ b/Source/WebKit/chromium/public/WebTimeRange.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebTimeRange_h +#define WebTimeRange_h + +#include "platform/WebVector.h" + +namespace WebKit { + +struct WebTimeRange { + WebTimeRange() : start(0), end(0) { } + WebTimeRange(float s, float e) : start(s), end(e) { } + + float start; + float end; +}; + +typedef WebVector WebTimeRanges; + +} // namespace WebKit + +#endif diff --git a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp index 4851ec9..5cf657f 100644 --- a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -368,36 +368,46 @@ COMPILE_ASSERT_MATCHING_ENUM(WebNode::NotationNode, Node::NOTATION_NODE); COMPILE_ASSERT_MATCHING_ENUM(WebNode::XPathNamespaceNode, Node::XPATH_NAMESPACE_NODE); #if ENABLE(VIDEO) -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::Empty, MediaPlayer::Empty); -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::Idle, MediaPlayer::Idle); -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::Loading, MediaPlayer::Loading); -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::Loaded, MediaPlayer::Loaded); -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::FormatError, MediaPlayer::FormatError); -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::NetworkError, MediaPlayer::NetworkError); -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::DecodeError, MediaPlayer::DecodeError); - -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::HaveNothing, MediaPlayer::HaveNothing); -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::HaveMetadata, MediaPlayer::HaveMetadata); -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::HaveCurrentData, MediaPlayer::HaveCurrentData); -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::HaveFutureData, MediaPlayer::HaveFutureData); -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::HaveEnoughData, MediaPlayer::HaveEnoughData); - -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::Unknown, MediaPlayer::Unknown); -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::Download, MediaPlayer::Download); -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::StoredStream, MediaPlayer::StoredStream); -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::LiveStream, MediaPlayer::LiveStream); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::NetworkStateEmpty, MediaPlayer::Empty); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::NetworkStateIdle, MediaPlayer::Idle); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::NetworkStateLoading, MediaPlayer::Loading); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::NetworkStateLoaded, MediaPlayer::Loaded); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::NetworkStateFormatError, MediaPlayer::FormatError); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::NetworkStateNetworkError, MediaPlayer::NetworkError); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::NetworkStateDecodeError, MediaPlayer::DecodeError); + +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::ReadyStateHaveNothing, MediaPlayer::HaveNothing); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::ReadyStateHaveMetadata, MediaPlayer::HaveMetadata); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::ReadyStateHaveCurrentData, MediaPlayer::HaveCurrentData); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::ReadyStateHaveFutureData, MediaPlayer::HaveFutureData); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::ReadyStateHaveEnoughData, MediaPlayer::HaveEnoughData); + +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::MovieLoadTypeUnknown, MediaPlayer::Unknown); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::MovieLoadTypeDownload, MediaPlayer::Download); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::MovieLoadTypeStoredStream, MediaPlayer::StoredStream); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::MovieLoadTypeLiveStream, MediaPlayer::LiveStream); + +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::PreloadNone, MediaPlayer::None); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::PreloadMetaData, MediaPlayer::MetaData); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::PreloadAuto, MediaPlayer::Auto); #if ENABLE(ENCRYPTED_MEDIA) -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::NoError, MediaPlayer::NoError); -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::InvalidPlayerState, MediaPlayer::InvalidPlayerState); -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::KeySystemNotSupported, MediaPlayer::KeySystemNotSupported); - -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayerClient::UnknownError, MediaPlayerClient::UnknownError); -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayerClient::ClientError, MediaPlayerClient::ClientError); -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayerClient::ServiceError, MediaPlayerClient::ServiceError); -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayerClient::OutputError, MediaPlayerClient::OutputError); -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayerClient::HardwareChangeError, MediaPlayerClient::HardwareChangeError); -COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayerClient::DomainError, MediaPlayerClient::DomainError); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::EndOfStreamStatusNoError, MediaPlayer::EosNoError); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::EndOfStreamStatusNetworkError, MediaPlayer::EosNetworkError); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::EndOfStreamStatusDecodeError, MediaPlayer::EosDecodeError); +#endif + +#if ENABLE(ENCRYPTED_MEDIA) +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::MediaKeyExceptionNoError, MediaPlayer::NoError); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::MediaKeyExceptionInvalidPlayerState, MediaPlayer::InvalidPlayerState); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported, MediaPlayer::KeySystemNotSupported); + +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayerClient::MediaKeyErrorCodeUnknown, MediaPlayerClient::UnknownError); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayerClient::MediaKeyErrorCodeClient, MediaPlayerClient::ClientError); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayerClient::MediaKeyErrorCodeService, MediaPlayerClient::ServiceError); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayerClient::MediaKeyErrorCodeOutput, MediaPlayerClient::OutputError); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayerClient::MediaKeyErrorCodeHardwareChange, MediaPlayerClient::HardwareChangeError); +COMPILE_ASSERT_MATCHING_ENUM(WebMediaPlayerClient::MediaKeyErrorCodeDomain, MediaPlayerClient::DomainError); #endif #endif -- 2.7.4