Commit 539dd052 authored by Nicholas Verne's avatar Nicholas Verne Committed by Commit Bot

Rehome STATIC_ASSERT_ENUMS

This CL continues to remove asserts from AssertMatchingEnums.cpp and
place them in files nearer their internal definitions.

Bug: 712963
Change-Id: I8cda3922744b053ecbbcb5b6c94a685f419defa4
Reviewed-on: https://chromium-review.googlesource.com/597382
Commit-Queue: Nicholas Verne <nverne@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491313}
parent 6a440a1e
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
*/ */
#include "core/dom/IconURL.h" #include "core/dom/IconURL.h"
#include "platform/wtf/Assertions.h"
#include "public/web/WebIconURL.h"
namespace blink { namespace blink {
...@@ -54,4 +56,9 @@ bool operator==(const IconURL& lhs, const IconURL& rhs) { ...@@ -54,4 +56,9 @@ bool operator==(const IconURL& lhs, const IconURL& rhs) {
lhs.mime_type_ == rhs.mime_type_; lhs.mime_type_ == rhs.mime_type_;
} }
STATIC_ASSERT_ENUM(WebIconURL::kTypeInvalid, kInvalidIcon);
STATIC_ASSERT_ENUM(WebIconURL::kTypeFavicon, kFavicon);
STATIC_ASSERT_ENUM(WebIconURL::kTypeTouch, kTouchIcon);
STATIC_ASSERT_ENUM(WebIconURL::kTypeTouchPrecomposed, kTouchPrecomposedIcon);
} // namespace blink } // namespace blink
...@@ -29,7 +29,9 @@ ...@@ -29,7 +29,9 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "core/events/KeyboardEvent.h" #include "core/events/KeyboardEvent.h"
#include "platform/KeyboardCodes.h" #include "platform/KeyboardCodes.h"
#include "platform/wtf/Assertions.h"
#include "public/platform/WebInputEvent.h" #include "public/platform/WebInputEvent.h"
#include "public/web/WebSettings.h"
namespace blink { namespace blink {
...@@ -289,4 +291,11 @@ bool EditingBehavior::ShouldInsertCharacter(const KeyboardEvent& event) const { ...@@ -289,4 +291,11 @@ bool EditingBehavior::ShouldInsertCharacter(const KeyboardEvent& event) const {
return true; return true;
} }
STATIC_ASSERT_ENUM(WebSettings::kEditingBehaviorMac, kEditingMacBehavior);
STATIC_ASSERT_ENUM(WebSettings::kEditingBehaviorWin, kEditingWindowsBehavior);
STATIC_ASSERT_ENUM(WebSettings::kEditingBehaviorUnix, kEditingUnixBehavior);
STATIC_ASSERT_ENUM(WebSettings::kEditingBehaviorAndroid,
kEditingAndroidBehavior);
} // namespace blink } // namespace blink
...@@ -52,10 +52,12 @@ ...@@ -52,10 +52,12 @@
#include "core/probe/CoreProbes.h" #include "core/probe/CoreProbes.h"
#include "platform/EventDispatchForbiddenScope.h" #include "platform/EventDispatchForbiddenScope.h"
#include "platform/Histogram.h" #include "platform/Histogram.h"
#include "platform/wtf/Assertions.h"
#include "platform/wtf/PtrUtil.h" #include "platform/wtf/PtrUtil.h"
#include "platform/wtf/StdLibExtras.h" #include "platform/wtf/StdLibExtras.h"
#include "platform/wtf/Threading.h" #include "platform/wtf/Threading.h"
#include "platform/wtf/Vector.h" #include "platform/wtf/Vector.h"
#include "public/web/WebSettings.h"
namespace blink { namespace blink {
namespace { namespace {
...@@ -834,4 +836,11 @@ void EventTarget::RemoveAllEventListeners() { ...@@ -834,4 +836,11 @@ void EventTarget::RemoveAllEventListeners() {
} }
} }
STATIC_ASSERT_ENUM(WebSettings::PassiveEventListenerDefault::kFalse,
PassiveListenerDefault::kFalse);
STATIC_ASSERT_ENUM(WebSettings::PassiveEventListenerDefault::kTrue,
PassiveListenerDefault::kTrue);
STATIC_ASSERT_ENUM(WebSettings::PassiveEventListenerDefault::kForceAllTrue,
PassiveListenerDefault::kForceAllTrue);
} // namespace blink } // namespace blink
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#include "bindings/core/v8/ExceptionState.h" #include "bindings/core/v8/ExceptionState.h"
#include "core/dom/DOMException.h" #include "core/dom/DOMException.h"
#include "core/dom/ExceptionCode.h" #include "core/dom/ExceptionCode.h"
#include "platform/wtf/Assertions.h"
#include "public/platform/WebFileError.h"
namespace blink { namespace blink {
...@@ -165,6 +167,20 @@ DOMException* CreateDOMException(ErrorCode code) { ...@@ -165,6 +167,20 @@ DOMException* CreateDOMException(ErrorCode code) {
ErrorCodeToMessage(code)); ErrorCodeToMessage(code));
} }
STATIC_ASSERT_ENUM(kWebFileErrorNotFound, kNotFoundErr);
STATIC_ASSERT_ENUM(kWebFileErrorSecurity, kSecurityErr);
STATIC_ASSERT_ENUM(kWebFileErrorAbort, kAbortErr);
STATIC_ASSERT_ENUM(kWebFileErrorNotReadable, kNotReadableErr);
STATIC_ASSERT_ENUM(kWebFileErrorEncoding, kEncodingErr);
STATIC_ASSERT_ENUM(kWebFileErrorNoModificationAllowed,
kNoModificationAllowedErr);
STATIC_ASSERT_ENUM(kWebFileErrorInvalidState, kInvalidStateErr);
STATIC_ASSERT_ENUM(kWebFileErrorSyntax, kSyntaxErr);
STATIC_ASSERT_ENUM(kWebFileErrorInvalidModification, kInvalidModificationErr);
STATIC_ASSERT_ENUM(kWebFileErrorQuotaExceeded, kQuotaExceededErr);
STATIC_ASSERT_ENUM(kWebFileErrorTypeMismatch, kTypeMismatchErr);
STATIC_ASSERT_ENUM(kWebFileErrorPathExists, kPathExistsErr);
} // namespace FileError } // namespace FileError
} // namespace blink } // namespace blink
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
#include "platform/weborigin/KURL.h" #include "platform/weborigin/KURL.h"
#include "platform/weborigin/KnownPorts.h" #include "platform/weborigin/KnownPorts.h"
#include "platform/weborigin/SecurityOrigin.h" #include "platform/weborigin/SecurityOrigin.h"
#include "platform/wtf/Assertions.h"
#include "platform/wtf/text/WTFString.h" #include "platform/wtf/text/WTFString.h"
#include "public/platform/WebContentSecurityPolicyStruct.h"
namespace blink { namespace blink {
...@@ -273,4 +275,7 @@ DEFINE_TRACE(CSPSource) { ...@@ -273,4 +275,7 @@ DEFINE_TRACE(CSPSource) {
visitor->Trace(policy_); visitor->Trace(policy_);
} }
STATIC_ASSERT_ENUM(kWebWildcardDispositionNoWildcard, CSPSource::kNoWildcard);
STATIC_ASSERT_ENUM(kWebWildcardDispositionHasWildcard, CSPSource::kHasWildcard);
} // namespace blink } // namespace blink
...@@ -93,6 +93,7 @@ ...@@ -93,6 +93,7 @@
#include "public/platform/WebAudioSourceProvider.h" #include "public/platform/WebAudioSourceProvider.h"
#include "public/platform/WebContentDecryptionModule.h" #include "public/platform/WebContentDecryptionModule.h"
#include "public/platform/WebInbandTextTrack.h" #include "public/platform/WebInbandTextTrack.h"
#include "public/platform/WebMediaPlayer.h"
#include "public/platform/WebMediaPlayerSource.h" #include "public/platform/WebMediaPlayerSource.h"
#include "public/platform/WebMediaStream.h" #include "public/platform/WebMediaStream.h"
#include "public/platform/modules/remoteplayback/WebRemotePlaybackAvailability.h" #include "public/platform/modules/remoteplayback/WebRemotePlaybackAvailability.h"
...@@ -4119,4 +4120,15 @@ void HTMLMediaElement::CheckViewportIntersectionTimerFired(TimerBase*) { ...@@ -4119,4 +4120,15 @@ void HTMLMediaElement::CheckViewportIntersectionTimerFired(TimerBase*) {
web_media_player_->BecameDominantVisibleContent(mostly_filling_viewport_); web_media_player_->BecameDominantVisibleContent(mostly_filling_viewport_);
} }
STATIC_ASSERT_ENUM(WebMediaPlayer::kReadyStateHaveNothing,
HTMLMediaElement::kHaveNothing);
STATIC_ASSERT_ENUM(WebMediaPlayer::kReadyStateHaveMetadata,
HTMLMediaElement::kHaveMetadata);
STATIC_ASSERT_ENUM(WebMediaPlayer::kReadyStateHaveCurrentData,
HTMLMediaElement::kHaveCurrentData);
STATIC_ASSERT_ENUM(WebMediaPlayer::kReadyStateHaveFutureData,
HTMLMediaElement::kHaveFutureData);
STATIC_ASSERT_ENUM(WebMediaPlayer::kReadyStateHaveEnoughData,
HTMLMediaElement::kHaveEnoughData);
} // namespace blink } // namespace blink
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "platform/wtf/Assertions.h" #include "platform/wtf/Assertions.h"
#include "public/web/WebNavigationPolicy.h"
namespace blink { namespace blink {
...@@ -64,4 +65,14 @@ bool NavigationPolicyFromMouseEvent(unsigned short button, ...@@ -64,4 +65,14 @@ bool NavigationPolicyFromMouseEvent(unsigned short button,
return true; return true;
} }
STATIC_ASSERT_ENUM(kWebNavigationPolicyIgnore, kNavigationPolicyIgnore);
STATIC_ASSERT_ENUM(kWebNavigationPolicyDownload, kNavigationPolicyDownload);
STATIC_ASSERT_ENUM(kWebNavigationPolicyCurrentTab, kNavigationPolicyCurrentTab);
STATIC_ASSERT_ENUM(kWebNavigationPolicyNewBackgroundTab,
kNavigationPolicyNewBackgroundTab);
STATIC_ASSERT_ENUM(kWebNavigationPolicyNewForegroundTab,
kNavigationPolicyNewForegroundTab);
STATIC_ASSERT_ENUM(kWebNavigationPolicyNewWindow, kNavigationPolicyNewWindow);
STATIC_ASSERT_ENUM(kWebNavigationPolicyNewPopup, kNavigationPolicyNewPopup);
} // namespace blink } // namespace blink
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
*/ */
#include "core/page/PageVisibilityState.h" #include "core/page/PageVisibilityState.h"
#include "platform/wtf/Assertions.h"
#include "public/platform/WebPageVisibilityState.h"
namespace blink { namespace blink {
...@@ -46,4 +48,9 @@ String PageVisibilityStateString(PageVisibilityState state) { ...@@ -46,4 +48,9 @@ String PageVisibilityStateString(PageVisibilityState state) {
return String(); return String();
} }
STATIC_ASSERT_ENUM(kWebPageVisibilityStateVisible, kPageVisibilityStateVisible);
STATIC_ASSERT_ENUM(kWebPageVisibilityStateHidden, kPageVisibilityStateHidden);
STATIC_ASSERT_ENUM(kWebPageVisibilityStatePrerender,
kPageVisibilityStatePrerender);
} // namespace blink } // namespace blink
...@@ -45,11 +45,13 @@ ...@@ -45,11 +45,13 @@
#include "modules/filesystem/FileSystemCallbacks.h" #include "modules/filesystem/FileSystemCallbacks.h"
#include "modules/filesystem/MetadataCallback.h" #include "modules/filesystem/MetadataCallback.h"
#include "platform/weborigin/SecurityOrigin.h" #include "platform/weborigin/SecurityOrigin.h"
#include "platform/wtf/Assertions.h"
#include "platform/wtf/text/StringBuilder.h" #include "platform/wtf/text/StringBuilder.h"
#include "platform/wtf/text/TextEncoding.h" #include "platform/wtf/text/TextEncoding.h"
#include "public/platform/Platform.h" #include "public/platform/Platform.h"
#include "public/platform/WebFileSystem.h" #include "public/platform/WebFileSystem.h"
#include "public/platform/WebFileSystemCallbacks.h" #include "public/platform/WebFileSystemCallbacks.h"
#include "public/platform/WebSecurityOrigin.h"
namespace blink { namespace blink {
...@@ -467,4 +469,9 @@ bool DOMFileSystemBase::WaitForAdditionalResult(int callbacks_id) { ...@@ -467,4 +469,9 @@ bool DOMFileSystemBase::WaitForAdditionalResult(int callbacks_id) {
return FileSystem()->WaitForAdditionalResult(callbacks_id); return FileSystem()->WaitForAdditionalResult(callbacks_id);
} }
STATIC_ASSERT_ENUM(WebFileSystem::kTypeTemporary, kFileSystemTypeTemporary);
STATIC_ASSERT_ENUM(WebFileSystem::kTypePersistent, kFileSystemTypePersistent);
STATIC_ASSERT_ENUM(WebFileSystem::kTypeExternal, kFileSystemTypeExternal);
STATIC_ASSERT_ENUM(WebFileSystem::kTypeIsolated, kFileSystemTypeIsolated);
} // namespace blink } // namespace blink
...@@ -114,4 +114,9 @@ void DeprecatedStorageQuota::requestQuota( ...@@ -114,4 +114,9 @@ void DeprecatedStorageQuota::requestQuota(
success_callback, error_callback); success_callback, error_callback);
} }
STATIC_ASSERT_ENUM(kWebStorageQuotaTypeTemporary,
DeprecatedStorageQuota::kTemporary);
STATIC_ASSERT_ENUM(kWebStorageQuotaTypePersistent,
DeprecatedStorageQuota::kPersistent);
} // namespace blink } // namespace blink
...@@ -14,8 +14,10 @@ ...@@ -14,8 +14,10 @@
#include "modules/permissions/PermissionUtils.h" #include "modules/permissions/PermissionUtils.h"
#include "modules/quota/StorageEstimate.h" #include "modules/quota/StorageEstimate.h"
#include "platform/StorageQuotaCallbacks.h" #include "platform/StorageQuotaCallbacks.h"
#include "platform/wtf/Assertions.h"
#include "platform/wtf/Functional.h" #include "platform/wtf/Functional.h"
#include "public/platform/Platform.h" #include "public/platform/Platform.h"
#include "public/platform/WebStorageQuotaError.h"
namespace blink { namespace blink {
...@@ -166,4 +168,10 @@ void StorageManager::PermissionRequestComplete(ScriptPromiseResolver* resolver, ...@@ -166,4 +168,10 @@ void StorageManager::PermissionRequestComplete(ScriptPromiseResolver* resolver,
resolver->Resolve(status == PermissionStatus::GRANTED); resolver->Resolve(status == PermissionStatus::GRANTED);
} }
STATIC_ASSERT_ENUM(kWebStorageQuotaErrorNotSupported, kNotSupportedError);
STATIC_ASSERT_ENUM(kWebStorageQuotaErrorInvalidModification,
kInvalidModificationError);
STATIC_ASSERT_ENUM(kWebStorageQuotaErrorInvalidAccess, kInvalidAccessError);
STATIC_ASSERT_ENUM(kWebStorageQuotaErrorAbort, kAbortError);
} // namespace blink } // namespace blink
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
*/ */
#include "modules/speech/SpeechRecognitionError.h" #include "modules/speech/SpeechRecognitionError.h"
#include "platform/wtf/Assertions.h"
#include "public/web/WebSpeechRecognizerClient.h"
namespace blink { namespace blink {
...@@ -84,4 +86,23 @@ const AtomicString& SpeechRecognitionError::InterfaceName() const { ...@@ -84,4 +86,23 @@ const AtomicString& SpeechRecognitionError::InterfaceName() const {
return EventNames::SpeechRecognitionError; return EventNames::SpeechRecognitionError;
} }
STATIC_ASSERT_ENUM(WebSpeechRecognizerClient::kOtherError,
SpeechRecognitionError::kErrorCodeOther);
STATIC_ASSERT_ENUM(WebSpeechRecognizerClient::kNoSpeechError,
SpeechRecognitionError::kErrorCodeNoSpeech);
STATIC_ASSERT_ENUM(WebSpeechRecognizerClient::kAbortedError,
SpeechRecognitionError::kErrorCodeAborted);
STATIC_ASSERT_ENUM(WebSpeechRecognizerClient::kAudioCaptureError,
SpeechRecognitionError::kErrorCodeAudioCapture);
STATIC_ASSERT_ENUM(WebSpeechRecognizerClient::kNetworkError,
SpeechRecognitionError::kErrorCodeNetwork);
STATIC_ASSERT_ENUM(WebSpeechRecognizerClient::kNotAllowedError,
SpeechRecognitionError::kErrorCodeNotAllowed);
STATIC_ASSERT_ENUM(WebSpeechRecognizerClient::kServiceNotAllowedError,
SpeechRecognitionError::kErrorCodeServiceNotAllowed);
STATIC_ASSERT_ENUM(WebSpeechRecognizerClient::kBadGrammarError,
SpeechRecognitionError::kErrorCodeBadGrammar);
STATIC_ASSERT_ENUM(WebSpeechRecognizerClient::kLanguageNotSupportedError,
SpeechRecognitionError::kErrorCodeLanguageNotSupported);
} // namespace blink } // namespace blink
...@@ -71,4 +71,8 @@ KURL FilePathToURL(const String& path) { ...@@ -71,4 +71,8 @@ KURL FilePathToURL(const String& path) {
return Platform::Current()->GetFileUtilities()->FilePathToURL(path); return Platform::Current()->GetFileUtilities()->FilePathToURL(path);
} }
STATIC_ASSERT_ENUM(WebFileInfo::kTypeUnknown, FileMetadata::kTypeUnknown);
STATIC_ASSERT_ENUM(WebFileInfo::kTypeFile, FileMetadata::kTypeFile);
STATIC_ASSERT_ENUM(WebFileInfo::kTypeDirectory, FileMetadata::kTypeDirectory);
} // namespace blink } // namespace blink
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include "platform/weborigin/SecurityOrigin.h" #include "platform/weborigin/SecurityOrigin.h"
#include "platform/weborigin/SecurityPolicy.h" #include "platform/weborigin/SecurityPolicy.h"
#include "platform/weborigin/SecurityViolationReportingPolicy.h" #include "platform/weborigin/SecurityViolationReportingPolicy.h"
#include "platform/wtf/Assertions.h"
#include "platform/wtf/text/CString.h" #include "platform/wtf/text/CString.h"
#include "platform/wtf/text/WTFString.h" #include "platform/wtf/text/WTFString.h"
#include "public/platform/Platform.h" #include "public/platform/Platform.h"
...@@ -1670,4 +1671,14 @@ DEFINE_TRACE(ResourceFetcher) { ...@@ -1670,4 +1671,14 @@ DEFINE_TRACE(ResourceFetcher) {
visitor->Trace(resource_timing_info_map_); visitor->Trace(resource_timing_info_map_);
} }
STATIC_ASSERT_ENUM(WebURLRequest::kPriorityUnresolved,
kResourceLoadPriorityUnresolved);
STATIC_ASSERT_ENUM(WebURLRequest::kPriorityVeryLow,
kResourceLoadPriorityVeryLow);
STATIC_ASSERT_ENUM(WebURLRequest::kPriorityLow, kResourceLoadPriorityLow);
STATIC_ASSERT_ENUM(WebURLRequest::kPriorityMedium, kResourceLoadPriorityMedium);
STATIC_ASSERT_ENUM(WebURLRequest::kPriorityHigh, kResourceLoadPriorityHigh);
STATIC_ASSERT_ENUM(WebURLRequest::kPriorityVeryHigh,
kResourceLoadPriorityVeryHigh);
} // namespace blink } // namespace blink
...@@ -28,9 +28,11 @@ ...@@ -28,9 +28,11 @@
#include "platform/HTTPNames.h" #include "platform/HTTPNames.h"
#include "platform/network/HTTPParsers.h" #include "platform/network/HTTPParsers.h"
#include "platform/wtf/Assertions.h"
#include "platform/wtf/CurrentTime.h" #include "platform/wtf/CurrentTime.h"
#include "platform/wtf/PtrUtil.h" #include "platform/wtf/PtrUtil.h"
#include "platform/wtf/StdLibExtras.h" #include "platform/wtf/StdLibExtras.h"
#include "public/platform/WebURLResponse.h"
#include <memory> #include <memory>
...@@ -641,4 +643,14 @@ bool ResourceResponse::Compare(const ResourceResponse& a, ...@@ -641,4 +643,14 @@ bool ResourceResponse::Compare(const ResourceResponse& a,
return true; return true;
} }
STATIC_ASSERT_ENUM(WebURLResponse::kHTTPVersionUnknown,
ResourceResponse::kHTTPVersionUnknown);
STATIC_ASSERT_ENUM(WebURLResponse::kHTTPVersion_0_9,
ResourceResponse::kHTTPVersion_0_9);
STATIC_ASSERT_ENUM(WebURLResponse::kHTTPVersion_1_0,
ResourceResponse::kHTTPVersion_1_0);
STATIC_ASSERT_ENUM(WebURLResponse::kHTTPVersion_1_1,
ResourceResponse::kHTTPVersion_1_1);
STATIC_ASSERT_ENUM(WebURLResponse::kHTTPVersion_2_0,
ResourceResponse::kHTTPVersion_2_0);
} // namespace blink } // namespace blink
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
*/ */
#include "platform/mediastream/MediaStreamSource.h" #include "platform/mediastream/MediaStreamSource.h"
#include "platform/wtf/Assertions.h"
#include "public/platform/WebMediaStreamSource.h"
namespace blink { namespace blink {
...@@ -132,4 +134,15 @@ DEFINE_TRACE(MediaStreamSource) { ...@@ -132,4 +134,15 @@ DEFINE_TRACE(MediaStreamSource) {
visitor->Trace(observers_); visitor->Trace(observers_);
} }
STATIC_ASSERT_ENUM(WebMediaStreamSource::kTypeAudio,
MediaStreamSource::kTypeAudio);
STATIC_ASSERT_ENUM(WebMediaStreamSource::kTypeVideo,
MediaStreamSource::kTypeVideo);
STATIC_ASSERT_ENUM(WebMediaStreamSource::kReadyStateLive,
MediaStreamSource::kReadyStateLive);
STATIC_ASSERT_ENUM(WebMediaStreamSource::kReadyStateMuted,
MediaStreamSource::kReadyStateMuted);
STATIC_ASSERT_ENUM(WebMediaStreamSource::kReadyStateEnded,
MediaStreamSource::kReadyStateEnded);
} // namespace blink } // namespace blink
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
#include "platform/network/ContentSecurityPolicyParsers.h" #include "platform/network/ContentSecurityPolicyParsers.h"
#include "platform/wtf/ASCIICType.h" #include "platform/wtf/ASCIICType.h"
#include "platform/wtf/Assertions.h"
#include "platform/wtf/text/StringUTF8Adaptor.h" #include "platform/wtf/text/StringUTF8Adaptor.h"
#include "public/platform/WebContentSecurityPolicy.h"
namespace blink { namespace blink {
...@@ -55,4 +57,13 @@ bool IsMediaTypeCharacter(UChar c) { ...@@ -55,4 +57,13 @@ bool IsMediaTypeCharacter(UChar c) {
return !IsASCIISpace(c) && c != '/'; return !IsASCIISpace(c) && c != '/';
} }
STATIC_ASSERT_ENUM(kWebContentSecurityPolicyTypeReport,
kContentSecurityPolicyHeaderTypeReport);
STATIC_ASSERT_ENUM(kWebContentSecurityPolicyTypeEnforce,
kContentSecurityPolicyHeaderTypeEnforce);
STATIC_ASSERT_ENUM(kWebContentSecurityPolicySourceHTTP,
kContentSecurityPolicyHeaderSourceHTTP);
STATIC_ASSERT_ENUM(kWebContentSecurityPolicySourceMeta,
kContentSecurityPolicyHeaderSourceMeta);
} // namespace blink } // namespace blink
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "platform/scroll/ScrollbarTheme.h" #include "platform/scroll/ScrollbarTheme.h"
#include "public/platform/WebGestureEvent.h" #include "public/platform/WebGestureEvent.h"
#include "public/platform/WebMouseEvent.h" #include "public/platform/WebMouseEvent.h"
#include "public/platform/WebScrollbar.h"
namespace blink { namespace blink {
...@@ -645,4 +646,36 @@ void Scrollbar::SetNeedsPaintInvalidation(ScrollbarPart invalid_parts) { ...@@ -645,4 +646,36 @@ void Scrollbar::SetNeedsPaintInvalidation(ScrollbarPart invalid_parts) {
scrollable_area_->SetScrollbarNeedsPaintInvalidation(Orientation()); scrollable_area_->SetScrollbarNeedsPaintInvalidation(Orientation());
} }
STATIC_ASSERT_ENUM(WebScrollbar::ScrollingMode::kAuto, kScrollbarAuto);
STATIC_ASSERT_ENUM(WebScrollbar::ScrollingMode::kAlwaysOff,
kScrollbarAlwaysOff);
STATIC_ASSERT_ENUM(WebScrollbar::ScrollingMode::kAlwaysOn, kScrollbarAlwaysOn);
STATIC_ASSERT_ENUM(WebScrollbar::kHorizontal, kHorizontalScrollbar);
STATIC_ASSERT_ENUM(WebScrollbar::kVertical, kVerticalScrollbar);
STATIC_ASSERT_ENUM(WebScrollbar::kScrollByLine, kScrollByLine);
STATIC_ASSERT_ENUM(WebScrollbar::kScrollByPage, kScrollByPage);
STATIC_ASSERT_ENUM(WebScrollbar::kScrollByDocument, kScrollByDocument);
STATIC_ASSERT_ENUM(WebScrollbar::kScrollByPixel, kScrollByPixel);
STATIC_ASSERT_ENUM(WebScrollbar::kRegularScrollbar, kRegularScrollbar);
STATIC_ASSERT_ENUM(WebScrollbar::kSmallScrollbar, kSmallScrollbar);
STATIC_ASSERT_ENUM(WebScrollbar::kNoPart, kNoPart);
STATIC_ASSERT_ENUM(WebScrollbar::kBackButtonStartPart, kBackButtonStartPart);
STATIC_ASSERT_ENUM(WebScrollbar::kForwardButtonStartPart,
kForwardButtonStartPart);
STATIC_ASSERT_ENUM(WebScrollbar::kBackTrackPart, kBackTrackPart);
STATIC_ASSERT_ENUM(WebScrollbar::kThumbPart, kThumbPart);
STATIC_ASSERT_ENUM(WebScrollbar::kForwardTrackPart, kForwardTrackPart);
STATIC_ASSERT_ENUM(WebScrollbar::kBackButtonEndPart, kBackButtonEndPart);
STATIC_ASSERT_ENUM(WebScrollbar::kForwardButtonEndPart, kForwardButtonEndPart);
STATIC_ASSERT_ENUM(WebScrollbar::kScrollbarBGPart, kScrollbarBGPart);
STATIC_ASSERT_ENUM(WebScrollbar::kTrackBGPart, kTrackBGPart);
STATIC_ASSERT_ENUM(WebScrollbar::kAllParts, kAllParts);
STATIC_ASSERT_ENUM(kWebScrollbarOverlayColorThemeDark,
kScrollbarOverlayColorThemeDark);
STATIC_ASSERT_ENUM(kWebScrollbarOverlayColorThemeLight,
kScrollbarOverlayColorThemeLight);
} // namespace blink } // namespace blink
...@@ -34,11 +34,13 @@ ...@@ -34,11 +34,13 @@
#include "platform/weborigin/OriginAccessEntry.h" #include "platform/weborigin/OriginAccessEntry.h"
#include "platform/weborigin/SchemeRegistry.h" #include "platform/weborigin/SchemeRegistry.h"
#include "platform/weborigin/SecurityOrigin.h" #include "platform/weborigin/SecurityOrigin.h"
#include "platform/wtf/Assertions.h"
#include "platform/wtf/HashMap.h" #include "platform/wtf/HashMap.h"
#include "platform/wtf/HashSet.h" #include "platform/wtf/HashSet.h"
#include "platform/wtf/PtrUtil.h" #include "platform/wtf/PtrUtil.h"
#include "platform/wtf/Threading.h" #include "platform/wtf/Threading.h"
#include "platform/wtf/text/StringHash.h" #include "platform/wtf/text/StringHash.h"
#include "public/platform/WebReferrerPolicy.h"
namespace blink { namespace blink {
...@@ -344,4 +346,18 @@ bool SecurityPolicy::ReferrerPolicyFromHeaderValue( ...@@ -344,4 +346,18 @@ bool SecurityPolicy::ReferrerPolicyFromHeaderValue(
return true; return true;
} }
STATIC_ASSERT_ENUM(kWebReferrerPolicyAlways, kReferrerPolicyAlways);
STATIC_ASSERT_ENUM(kWebReferrerPolicyDefault, kReferrerPolicyDefault);
STATIC_ASSERT_ENUM(kWebReferrerPolicyNoReferrerWhenDowngrade,
kReferrerPolicyNoReferrerWhenDowngrade);
STATIC_ASSERT_ENUM(kWebReferrerPolicyNever, kReferrerPolicyNever);
STATIC_ASSERT_ENUM(kWebReferrerPolicyOrigin, kReferrerPolicyOrigin);
STATIC_ASSERT_ENUM(kWebReferrerPolicyOriginWhenCrossOrigin,
kReferrerPolicyOriginWhenCrossOrigin);
STATIC_ASSERT_ENUM(kWebReferrerPolicySameOrigin, kReferrerPolicySameOrigin);
STATIC_ASSERT_ENUM(kWebReferrerPolicyStrictOrigin, kReferrerPolicyStrictOrigin);
STATIC_ASSERT_ENUM(
kWebReferrerPolicyNoReferrerWhenDowngradeOriginWhenCrossOrigin,
kReferrerPolicyNoReferrerWhenDowngradeOriginWhenCrossOrigin);
} // namespace blink } // namespace blink
...@@ -63,6 +63,8 @@ class BLINK_PLATFORM_EXPORT WebScrollbar { ...@@ -63,6 +63,8 @@ class BLINK_PLATFORM_EXPORT WebScrollbar {
kAllParts = 0xffffffff kAllParts = 0xffffffff
}; };
enum class ScrollingMode { kAuto, kAlwaysOff, kAlwaysOn, kLast = kAlwaysOn };
virtual ~WebScrollbar() {} virtual ~WebScrollbar() {}
// Return true if this is an overlay scrollbar. // Return true if this is an overlay scrollbar.
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define WebFrameOwnerProperties_h #define WebFrameOwnerProperties_h
#include "public/platform/WebFeaturePolicy.h" #include "public/platform/WebFeaturePolicy.h"
#include "public/platform/WebScrollbar.h"
#include "public/platform/WebString.h" #include "public/platform/WebString.h"
#include "public/platform/WebVector.h" #include "public/platform/WebVector.h"
...@@ -14,7 +15,7 @@ ...@@ -14,7 +15,7 @@
namespace blink { namespace blink {
struct WebFrameOwnerProperties { struct WebFrameOwnerProperties {
enum class ScrollingMode { kAuto, kAlwaysOff, kAlwaysOn, kLast = kAlwaysOn }; using ScrollingMode = WebScrollbar::ScrollingMode;
WebString name; // browsing context container's name WebString name; // browsing context container's name
ScrollingMode scrolling_mode; ScrollingMode scrolling_mode;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment