Esempio n. 1
0
String Deprecation::deprecationMessage(UseCounter::Feature feature)
{
    switch (feature) {
    // Quota
    case UseCounter::PrefixedStorageInfo:
        return replacedBy("'window.webkitStorageInfo'", "'navigator.webkitTemporaryStorage' or 'navigator.webkitPersistentStorage'");

    case UseCounter::ConsoleMarkTimeline:
        return replacedBy("'console.markTimeline'", "'console.timeStamp'");

    case UseCounter::FileError:
        return "FileError is deprecated. Please use the 'name' or 'message' attributes of DOMError rather than 'code'.";

    case UseCounter::CSSStyleSheetInsertRuleOptionalArg:
        return "Calling CSSStyleSheet.insertRule() with one argument is deprecated. Please pass the index argument as well: insertRule(x, 0).";

    case UseCounter::PrefixedVideoSupportsFullscreen:
        return replacedBy("'HTMLVideoElement.webkitSupportsFullscreen'", "'Document.fullscreenEnabled'");

    case UseCounter::PrefixedVideoDisplayingFullscreen:
        return replacedBy("'HTMLVideoElement.webkitDisplayingFullscreen'", "'Document.fullscreenElement'");

    case UseCounter::PrefixedVideoEnterFullscreen:
        return replacedBy("'HTMLVideoElement.webkitEnterFullscreen()'", "'Element.requestFullscreen()'");

    case UseCounter::PrefixedVideoExitFullscreen:
        return replacedBy("'HTMLVideoElement.webkitExitFullscreen()'", "'Document.exitFullscreen()'");

    case UseCounter::PrefixedVideoEnterFullScreen:
        return replacedBy("'HTMLVideoElement.webkitEnterFullScreen()'", "'Element.requestFullscreen()'");

    case UseCounter::PrefixedVideoExitFullScreen:
        return replacedBy("'HTMLVideoElement.webkitExitFullScreen()'", "'Document.exitFullscreen()'");

    case UseCounter::PrefixedIndexedDB:
        return replacedBy("'webkitIndexedDB'", "'indexedDB'");

    case UseCounter::PrefixedIDBCursorConstructor:
        return replacedBy("'webkitIDBCursor'", "'IDBCursor'");

    case UseCounter::PrefixedIDBDatabaseConstructor:
        return replacedBy("'webkitIDBDatabase'", "'IDBDatabase'");

    case UseCounter::PrefixedIDBFactoryConstructor:
        return replacedBy("'webkitIDBFactory'", "'IDBFactory'");

    case UseCounter::PrefixedIDBIndexConstructor:
        return replacedBy("'webkitIDBIndex'", "'IDBIndex'");

    case UseCounter::PrefixedIDBKeyRangeConstructor:
        return replacedBy("'webkitIDBKeyRange'", "'IDBKeyRange'");

    case UseCounter::PrefixedIDBObjectStoreConstructor:
        return replacedBy("'webkitIDBObjectStore'", "'IDBObjectStore'");

    case UseCounter::PrefixedIDBRequestConstructor:
        return replacedBy("'webkitIDBRequest'", "'IDBRequest'");

    case UseCounter::PrefixedIDBTransactionConstructor:
        return replacedBy("'webkitIDBTransaction'", "'IDBTransaction'");

    case UseCounter::PrefixedRequestAnimationFrame:
        return "'webkitRequestAnimationFrame' is vendor-specific. Please use the standard 'requestAnimationFrame' instead.";

    case UseCounter::PrefixedCancelAnimationFrame:
        return "'webkitCancelAnimationFrame' is vendor-specific. Please use the standard 'cancelAnimationFrame' instead.";

    case UseCounter::PrefixedCancelRequestAnimationFrame:
        return "'webkitCancelRequestAnimationFrame' is vendor-specific. Please use the standard 'cancelAnimationFrame' instead.";

    case UseCounter::SyncXHRWithCredentials:
        return "Setting 'XMLHttpRequest.withCredentials' for synchronous requests is deprecated.";

    case UseCounter::PictureSourceSrc:
        return "<source src> with a <picture> parent is invalid and therefore ignored. Please use <source srcset> instead.";

    case UseCounter::ConsoleTimeline:
        return replacedBy("'console.timeline'", "'console.time'");

    case UseCounter::ConsoleTimelineEnd:
        return replacedBy("'console.timelineEnd'", "'console.timeEnd'");

    case UseCounter::XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload:
        return "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.";

    case UseCounter::GetMatchedCSSRules:
        return "'getMatchedCSSRules()' is deprecated. For more help, check https://code.google.com/p/chromium/issues/detail?id=437569#c2";

    case UseCounter::PrefixedImageSmoothingEnabled:
        return replacedBy("'CanvasRenderingContext2D.webkitImageSmoothingEnabled'", "'CanvasRenderingContext2D.imageSmoothingEnabled'");

    case UseCounter::AudioListenerDopplerFactor:
        return dopplerWillBeRemoved("'AudioListener.dopplerFactor'", 55, "5238926818148352");

    case UseCounter::AudioListenerSpeedOfSound:
        return dopplerWillBeRemoved("'AudioListener.speedOfSound'", 55, "5238926818148352");

    case UseCounter::AudioListenerSetVelocity:
        return dopplerWillBeRemoved("'AudioListener.setVelocity()'", 55, "5238926818148352");

    case UseCounter::PannerNodeSetVelocity:
        return dopplerWillBeRemoved("'PannerNode.setVelocity()'", 55, "5238926818148352");

    case UseCounter::PrefixedWindowURL:
        return replacedBy("'webkitURL'", "'URL'");

    case UseCounter::PrefixedAudioContext:
        return replacedBy("'webkitAudioContext'", "'AudioContext'");

    case UseCounter::PrefixedOfflineAudioContext:
        return replacedBy("'webkitOfflineAudioContext'", "'OfflineAudioContext'");

    case UseCounter::RangeExpand:
        return replacedBy("'Range.expand()'", "'Selection.modify()'");

    // Powerful features on insecure origins (https://goo.gl/rStTGz)
    case UseCounter::DeviceMotionInsecureOrigin:
        return "The devicemotion event is deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case UseCounter::DeviceOrientationInsecureOrigin:
        return "The deviceorientation event is deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case UseCounter::DeviceOrientationAbsoluteInsecureOrigin:
        return "The deviceorientationabsolute event is deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case UseCounter::GeolocationInsecureOrigin:
    case UseCounter::GeolocationInsecureOriginIframe:
        return "getCurrentPosition() and watchPosition() no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case UseCounter::GeolocationInsecureOriginDeprecatedNotRemoved:
    case UseCounter::GeolocationInsecureOriginIframeDeprecatedNotRemoved:
        return "getCurrentPosition() and watchPosition() are deprecated on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case UseCounter::GetUserMediaInsecureOrigin:
    case UseCounter::GetUserMediaInsecureOriginIframe:
        return "getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case UseCounter::EncryptedMediaInsecureOrigin:
        return "requestMediaKeySystemAccess() is deprecated on insecure origins in the specification. Support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case UseCounter::ApplicationCacheManifestSelectInsecureOrigin:
    case UseCounter::ApplicationCacheAPIInsecureOrigin:
        return "Use of the Application Cache is deprecated on insecure origins. Support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case UseCounter::ElementCreateShadowRootMultiple:
        return "Calling Element.createShadowRoot() for an element which already hosts a shadow root is deprecated. See https://www.chromestatus.com/features/4668884095336448 for more details.";

    case UseCounter::CSSDeepCombinator:
        return "/deep/ combinator is deprecated. See https://www.chromestatus.com/features/6750456638341120 for more details.";

    case UseCounter::CSSSelectorPseudoShadow:
        return "::shadow pseudo-element is deprecated. See https://www.chromestatus.com/features/6750456638341120 for more details.";

    case UseCounter::SVGSMILElementInDocument:
    case UseCounter::SVGSMILAnimationInImageRegardlessOfCache:
        return "SVG's SMIL animations (<animate>, <set>, etc.) are deprecated and will be removed. Please use CSS animations or Web animations instead.";

    case UseCounter::PrefixedPerformanceClearResourceTimings:
        return replacedBy("'Performance.webkitClearResourceTimings'", "'Performance.clearResourceTimings'");

    case UseCounter::PrefixedPerformanceSetResourceTimingBufferSize:
        return replacedBy("'Performance.webkitSetResourceTimingBufferSize'", "'Performance.setResourceTimingBufferSize'");

    case UseCounter::PrefixedPerformanceResourceTimingBufferFull:
        return replacedBy("'Performance.onwebkitresourcetimingbufferfull'", "'Performance.onresourcetimingbufferfull'");

    case UseCounter::BluetoothDeviceInstanceId:
        return replacedBy("'BluetoothDevice.instanceID'", "'BluetoothDevice.id'");

    case UseCounter::BluetoothDeviceConnectGATT:
        return replacedWillBeRemoved("'BluetoothDevice.connectGATT'", "'BluetoothDevice.gatt.connect'", 52, "5264933985976320");

    case UseCounter::MediaStreamTrackGetSources:
        return "MediaStreamTrack.getSources is deprecated. See https://www.chromestatus.com/feature/4765305641369600 for more details.";

    case UseCounter::V8TouchEvent_InitTouchEvent_Method:
        return replacedWillBeRemoved("'TouchEvent.initTouchEvent'", "the TouchEvent constructor", 53, "5730982598541312");

    case UseCounter::ObjectObserve:
        return willBeRemoved("'Object.observe'", 50, "6147094632988672");

    case UseCounter::SVGZoomEvent:
        return willBeRemoved("'SVGZoomEvent'", 52, "5760883808534528");

    case UseCounter::WebAnimationHyphenatedProperty:
        return "Hyphenated property names in Web Animations keyframes are invalid and therefore ignored. Please use camelCase instead.";

    case UseCounter::HTMLKeygenElement:
        return willBeRemoved("The <keygen> element", 54, "5716060992962560");

    case UseCounter::ResultsAttribute:
        return willBeRemoved("'results' attribute", 53, "5738199536107520");

    case UseCounter::WebAnimationsEasingAsFunctionLinear:
        return String::format("Specifying animation easing as a function is deprecated and all support will be removed in %s, at which point this will throw a TypeError. This warning may have been triggered by the Web Animations or Polymer polyfills. See http://crbug.com/601672 for details.", milestoneString(54));

    case UseCounter::WindowPostMessageWithLegacyTargetOriginArgument:
        return replacedWillBeRemoved("'window.postMessage(message, transferables, targetOrigin)'", "'window.postMessage(message, targetOrigin, transferables)'", 54, "5719033043222528");

    case UseCounter::EncryptedMediaAllSelectedContentTypesMissingCodecs:
        return "contentType strings without codecs will not be supported by requestMediaKeySystemAccess() in the future. Please specify the desired codec(s) as part of the contentType.";

    case UseCounter::V8KeyboardEvent_KeyIdentifier_AttributeGetter:
        return willBeRemoved("'KeyboardEvent.keyIdentifier'", 53, "5316065118650368");

    case UseCounter::During_Microtask_Alert:
        return willBeRemoved("Invoking 'alert()' during microtask execution", 53, "5647113010544640");

    case UseCounter::During_Microtask_Confirm:
        return willBeRemoved("Invoking 'confirm()' during microtask execution", 53, "5647113010544640");

    case UseCounter::During_Microtask_Print:
        return willBeRemoved("Invoking 'print()' during microtask execution", 53, "5647113010544640");

    case UseCounter::During_Microtask_Prompt:
        return willBeRemoved("Invoking 'prompt()' during microtask execution", 53, "5647113010544640");

    case UseCounter::During_Microtask_SyncXHR:
        return willBeRemoved("Invoking 'send()' on a sync XHR during microtask execution", 53, "5647113010544640");

    case UseCounter::MediaStreamOnEnded:
        return replacedWillBeRemoved("The MediaStream 'ended' event", "the MediaStream 'inactive' event", 53, "5730404371791872");

    // Features that aren't deprecated don't have a deprecation message.
    default:
        return String();
    }
}
Esempio n. 2
0
String UseCounter::deprecationMessage(Feature feature)
{
    switch (feature) {
    // Quota
    case PrefixedStorageInfo:
        return replacedBy("'window.webkitStorageInfo'", "'navigator.webkitTemporaryStorage' or 'navigator.webkitPersistentStorage'");

    // Keyboard Event (DOM Level 3)
    case KeyboardEventKeyLocation:
        return replacedWillBeRemoved("'KeyboardEvent.keyLocation'", "'KeyboardEvent.location'", 50, "4997403308457984");

    case ConsoleMarkTimeline:
        return replacedBy("'console.markTimeline'", "'console.timeStamp'");

    case FileError:
        return "FileError is deprecated. Please use the 'name' or 'message' attributes of DOMError rather than 'code'.";

    case CSSStyleSheetInsertRuleOptionalArg:
        return "Calling CSSStyleSheet.insertRule() with one argument is deprecated. Please pass the index argument as well: insertRule(x, 0).";

    case PrefixedVideoSupportsFullscreen:
        return replacedBy("'HTMLVideoElement.webkitSupportsFullscreen'", "'Document.fullscreenEnabled'");

    case PrefixedVideoDisplayingFullscreen:
        return replacedBy("'HTMLVideoElement.webkitDisplayingFullscreen'", "'Document.fullscreenElement'");

    case PrefixedVideoEnterFullscreen:
        return replacedBy("'HTMLVideoElement.webkitEnterFullscreen()'", "'Element.requestFullscreen()'");

    case PrefixedVideoExitFullscreen:
        return replacedBy("'HTMLVideoElement.webkitExitFullscreen()'", "'Document.exitFullscreen()'");

    case PrefixedVideoEnterFullScreen:
        return replacedBy("'HTMLVideoElement.webkitEnterFullScreen()'", "'Element.requestFullscreen()'");

    case PrefixedVideoExitFullScreen:
        return replacedBy("'HTMLVideoElement.webkitExitFullScreen()'", "'Document.exitFullscreen()'");

    case PrefixedIndexedDB:
        return replacedBy("'webkitIndexedDB'", "'indexedDB'");

    case PrefixedIDBCursorConstructor:
        return replacedBy("'webkitIDBCursor'", "'IDBCursor'");

    case PrefixedIDBDatabaseConstructor:
        return replacedBy("'webkitIDBDatabase'", "'IDBDatabase'");

    case PrefixedIDBFactoryConstructor:
        return replacedBy("'webkitIDBFactory'", "'IDBFactory'");

    case PrefixedIDBIndexConstructor:
        return replacedBy("'webkitIDBIndex'", "'IDBIndex'");

    case PrefixedIDBKeyRangeConstructor:
        return replacedBy("'webkitIDBKeyRange'", "'IDBKeyRange'");

    case PrefixedIDBObjectStoreConstructor:
        return replacedBy("'webkitIDBObjectStore'", "'IDBObjectStore'");

    case PrefixedIDBRequestConstructor:
        return replacedBy("'webkitIDBRequest'", "'IDBRequest'");

    case PrefixedIDBTransactionConstructor:
        return replacedBy("'webkitIDBTransaction'", "'IDBTransaction'");

    case PrefixedRequestAnimationFrame:
        return "'webkitRequestAnimationFrame' is vendor-specific. Please use the standard 'requestAnimationFrame' instead.";

    case PrefixedCancelAnimationFrame:
        return "'webkitCancelAnimationFrame' is vendor-specific. Please use the standard 'cancelAnimationFrame' instead.";

    case PrefixedCancelRequestAnimationFrame:
        return "'webkitCancelRequestAnimationFrame' is vendor-specific. Please use the standard 'cancelAnimationFrame' instead.";

    case SyncXHRWithCredentials:
        return "Setting 'XMLHttpRequest.withCredentials' for synchronous requests is deprecated.";

    case PictureSourceSrc:
        return "<source src> with a <picture> parent is invalid and therefore ignored. Please use <source srcset> instead.";

    case XHRProgressEventPosition:
        return replacedWillBeRemoved("The XMLHttpRequest progress event property 'position'", "'loaded'", 50, "5044837464145920");

    case XHRProgressEventTotalSize:
        return replacedWillBeRemoved("The XMLHttpRequest progress event property 'totalSize'", "'total'", 50, "5044837464145920");

    case ConsoleTimeline:
        return replacedBy("'console.timeline'", "'console.time'");

    case ConsoleTimelineEnd:
        return replacedBy("'console.timelineEnd'", "'console.timeEnd'");

    case XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload:
        return "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.";

    case GetMatchedCSSRules:
        return "'getMatchedCSSRules()' is deprecated. For more help, check https://code.google.com/p/chromium/issues/detail?id=437569#c2";

    case PrefixedImageSmoothingEnabled:
        return replacedBy("'CanvasRenderingContext2D.webkitImageSmoothingEnabled'", "'CanvasRenderingContext2D.imageSmoothingEnabled'");

    case AudioListenerDopplerFactor:
        return "dopplerFactor is deprecated and will be removed in M45 when all doppler effects are removed";

    case AudioListenerSpeedOfSound:
        return "speedOfSound is deprecated and will be removed in M45 when all doppler effects are removed";

    case AudioListenerSetVelocity:
        return "setVelocity() is deprecated and will be removed in M45 when all doppler effects are removed";

    case PrefixedWindowURL:
        return replacedBy("'webkitURL'", "'URL'");

    case PrefixedAudioContext:
        return replacedBy("'webkitAudioContext'", "'AudioContext'");

    case PrefixedOfflineAudioContext:
        return replacedBy("'webkitOfflineAudioContext'", "'OfflineAudioContext'");

    case RangeExpand:
        return replacedBy("'Range.expand()'", "'Selection.modify()'");

    case PrefixedMediaAddKey:
    case PrefixedMediaGenerateKeyRequest:
    case PrefixedMediaCancelKeyRequest:
        return "The prefixed Encrypted Media Extensions APIs are deprecated. Please use 'navigator.requestMediaKeySystemAccess()' instead.";

    case CanPlayTypeKeySystem:
        return replacedBy("canPlayType()'s 'keySystem' parameter", "'navigator.requestMediaKeySystemAccess()'");

    // Powerful features on insecure origins (https://goo.gl/rStTGz)
    case DeviceMotionInsecureOrigin:
        return "The devicemotion event is deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case DeviceOrientationInsecureOrigin:
        return "The deviceorientation event is deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case DeviceOrientationAbsoluteInsecureOrigin:
        return "The deviceorientationabsolute event is deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case GeolocationInsecureOrigin:
        // TODO(jww): This message should be made less ambigous after WebView
        // is fixed so geolocation can be removed there. After that, this
        // should be updated to read similarly to GetUserMediaInsecureOrigin's
        // message.
        return "getCurrentPosition() and watchPosition() are deprecated on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case GetUserMediaInsecureOrigin:
        return "getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case EncryptedMediaInsecureOrigin:
        return "requestMediaKeySystemAccess() is deprecated on insecure origins in the specification. Support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case ElementCreateShadowRootMultiple:
        return "Calling Element.createShadowRoot() for an element which already hosts a shadow root is deprecated. See https://www.chromestatus.com/features/4668884095336448 for more details.";

    case ElementCreateShadowRootMultipleWithUserAgentShadowRoot:
        return "Calling Element.createShadowRoot() for an element which already hosts a user-agent shadow root is deprecated. See https://www.chromestatus.com/features/4668884095336448 for more details.";

    case CSSDeepCombinator:
        return "/deep/ combinator is deprecated. See https://www.chromestatus.com/features/6750456638341120 for more details.";

    case CSSSelectorPseudoShadow:
        return "::shadow pseudo-element is deprecated. See https://www.chromestatus.com/features/6750456638341120 for more details.";

    case SVGSMILElementInDocument:
    case SVGSMILAnimationInImageRegardlessOfCache:
        return "SVG's SMIL animations (<animate>, <set>, etc.) are deprecated and will be removed. Please use CSS animations or Web animations instead.";

    case PrefixedPerformanceClearResourceTimings:
        return replacedBy("'Performance.webkitClearResourceTimings'", "'Performance.clearResourceTimings'");

    case PrefixedPerformanceSetResourceTimingBufferSize:
        return replacedBy("'Performance.webkitSetResourceTimingBufferSize'", "'Performance.setResourceTimingBufferSize'");

    case PrefixedPerformanceResourceTimingBufferFull:
        return replacedBy("'Performance.onwebkitresourcetimingbufferfull'", "'Performance.onresourcetimingbufferfull'");

    case BluetoothDeviceInstanceId:
        return replacedBy("'BluetoothDevice.instanceID'", "'BluetoothDevice.id'");

    case V8SVGElement_OffsetParent_AttributeGetter:
        return willBeRemoved("'SVGElement.offsetParent'", 50, "5724912467574784");

    case V8SVGElement_OffsetTop_AttributeGetter:
        return willBeRemoved("'SVGElement.offsetTop'", 50, "5724912467574784");

    case V8SVGElement_OffsetLeft_AttributeGetter:
        return willBeRemoved("'SVGElement.offsetLeft'", 50, "5724912467574784");

    case V8SVGElement_OffsetWidth_AttributeGetter:
        return willBeRemoved("'SVGElement.offsetWidth'", 50, "5724912467574784");

    case V8SVGElement_OffsetHeight_AttributeGetter:
        return willBeRemoved("'SVGElement.offsetHeight'", 50, "5724912467574784");

    case MediaStreamTrackGetSources:
        return "MediaStreamTrack.getSources is deprecated. See https://www.chromestatus.com/feature/4765305641369600 for more details.";

    case DocumentDefaultCharset:
        return willBeRemoved("'Document.defaultCharset'", 50, "6217124578066432");

    case V8TouchEvent_InitTouchEvent_Method:
        return replacedWillBeRemoved("'TouchEvent.initTouchEvent'", "the TouchEvent constructor", 53, "5730982598541312");

    case RTCPeerConnectionCreateAnswerLegacyNoFailureCallback:
        return "RTCPeerConnection.CreateAnswer without a failure callback is deprecated. The failure callback will be a required parameter in M50. See https://www.chromestatus.com/feature/5663288008376320 for more details";

    case RTCPeerConnectionCreateOfferLegacyNoFailureCallback:
        return "RTCPeerConnection.CreateOffer without a failure callback is deprecated. The failure callback will be a required parameter in M50. See https://www.chromestatus.com/feature/5663288008376320 for more details";

    case ObjectObserve:
        return willBeRemoved("'Object.observe'", 50, "6147094632988672");

    // Features that aren't deprecated don't have a deprecation message.
    default:
        return String();
    }
}
String Deprecation::deprecationMessage(UseCounter::Feature feature)
{
    switch (feature) {
    // Quota
    case UseCounter::PrefixedStorageInfo:
        return replacedBy("'window.webkitStorageInfo'", "'navigator.webkitTemporaryStorage' or 'navigator.webkitPersistentStorage'");

    case UseCounter::ConsoleMarkTimeline:
        return replacedBy("'console.markTimeline'", "'console.timeStamp'");

    case UseCounter::FileError:
        return "FileError is deprecated. Please use the 'name' or 'message' attributes of DOMError rather than 'code'.";

    case UseCounter::CSSStyleSheetInsertRuleOptionalArg:
        return "Calling CSSStyleSheet.insertRule() with one argument is deprecated. Please pass the index argument as well: insertRule(x, 0).";

    case UseCounter::PrefixedVideoSupportsFullscreen:
        return replacedBy("'HTMLVideoElement.webkitSupportsFullscreen'", "'Document.fullscreenEnabled'");

    case UseCounter::PrefixedVideoDisplayingFullscreen:
        return replacedBy("'HTMLVideoElement.webkitDisplayingFullscreen'", "'Document.fullscreenElement'");

    case UseCounter::PrefixedVideoEnterFullscreen:
        return replacedBy("'HTMLVideoElement.webkitEnterFullscreen()'", "'Element.requestFullscreen()'");

    case UseCounter::PrefixedVideoExitFullscreen:
        return replacedBy("'HTMLVideoElement.webkitExitFullscreen()'", "'Document.exitFullscreen()'");

    case UseCounter::PrefixedVideoEnterFullScreen:
        return replacedBy("'HTMLVideoElement.webkitEnterFullScreen()'", "'Element.requestFullscreen()'");

    case UseCounter::PrefixedVideoExitFullScreen:
        return replacedBy("'HTMLVideoElement.webkitExitFullScreen()'", "'Document.exitFullscreen()'");

    case UseCounter::PrefixedIndexedDB:
        return replacedBy("'webkitIndexedDB'", "'indexedDB'");

    case UseCounter::PrefixedIDBCursorConstructor:
        return replacedBy("'webkitIDBCursor'", "'IDBCursor'");

    case UseCounter::PrefixedIDBDatabaseConstructor:
        return replacedBy("'webkitIDBDatabase'", "'IDBDatabase'");

    case UseCounter::PrefixedIDBFactoryConstructor:
        return replacedBy("'webkitIDBFactory'", "'IDBFactory'");

    case UseCounter::PrefixedIDBIndexConstructor:
        return replacedBy("'webkitIDBIndex'", "'IDBIndex'");

    case UseCounter::PrefixedIDBKeyRangeConstructor:
        return replacedBy("'webkitIDBKeyRange'", "'IDBKeyRange'");

    case UseCounter::PrefixedIDBObjectStoreConstructor:
        return replacedBy("'webkitIDBObjectStore'", "'IDBObjectStore'");

    case UseCounter::PrefixedIDBRequestConstructor:
        return replacedBy("'webkitIDBRequest'", "'IDBRequest'");

    case UseCounter::PrefixedIDBTransactionConstructor:
        return replacedBy("'webkitIDBTransaction'", "'IDBTransaction'");

    case UseCounter::PrefixedRequestAnimationFrame:
        return "'webkitRequestAnimationFrame' is vendor-specific. Please use the standard 'requestAnimationFrame' instead.";

    case UseCounter::PrefixedCancelAnimationFrame:
        return "'webkitCancelAnimationFrame' is vendor-specific. Please use the standard 'cancelAnimationFrame' instead.";

    case UseCounter::PrefixedCancelRequestAnimationFrame:
        return "'webkitCancelRequestAnimationFrame' is vendor-specific. Please use the standard 'cancelAnimationFrame' instead.";

    case UseCounter::SyncXHRWithCredentials:
        return "Setting 'XMLHttpRequest.withCredentials' for synchronous requests is deprecated.";

    case UseCounter::PictureSourceSrc:
        return "<source src> with a <picture> parent is invalid and therefore ignored. Please use <source srcset> instead.";

    case UseCounter::ConsoleTimeline:
        return replacedBy("'console.timeline'", "'console.time'");

    case UseCounter::ConsoleTimelineEnd:
        return replacedBy("'console.timelineEnd'", "'console.timeEnd'");

    case UseCounter::XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload:
        return "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.";

    case UseCounter::GetMatchedCSSRules:
        return "'getMatchedCSSRules()' is deprecated. For more help, check https://code.google.com/p/chromium/issues/detail?id=437569#c2";

    case UseCounter::PrefixedImageSmoothingEnabled:
        return replacedBy("'CanvasRenderingContext2D.webkitImageSmoothingEnabled'", "'CanvasRenderingContext2D.imageSmoothingEnabled'");

    case UseCounter::AudioListenerDopplerFactor:
        return dopplerWillBeRemoved("'AudioListener.dopplerFactor'", 55, "5238926818148352");

    case UseCounter::AudioListenerSpeedOfSound:
        return dopplerWillBeRemoved("'AudioListener.speedOfSound'", 55, "5238926818148352");

    case UseCounter::AudioListenerSetVelocity:
        return dopplerWillBeRemoved("'AudioListener.setVelocity()'", 55, "5238926818148352");

    case UseCounter::PannerNodeSetVelocity:
        return dopplerWillBeRemoved("'PannerNode.setVelocity()'", 55, "5238926818148352");

    case UseCounter::PrefixedWindowURL:
        return replacedBy("'webkitURL'", "'URL'");

    case UseCounter::PrefixedAudioContext:
        return replacedBy("'webkitAudioContext'", "'AudioContext'");

    case UseCounter::PrefixedOfflineAudioContext:
        return replacedBy("'webkitOfflineAudioContext'", "'OfflineAudioContext'");

    case UseCounter::RangeExpand:
        return replacedBy("'Range.expand()'", "'Selection.modify()'");

    // Powerful features on insecure origins (https://goo.gl/rStTGz)
    case UseCounter::DeviceMotionInsecureOrigin:
        return "The devicemotion event is deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case UseCounter::DeviceOrientationInsecureOrigin:
        return "The deviceorientation event is deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case UseCounter::DeviceOrientationAbsoluteInsecureOrigin:
        return "The deviceorientationabsolute event is deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case UseCounter::GeolocationInsecureOrigin:
    case UseCounter::GeolocationInsecureOriginIframe:
        // TODO(jww): This message should be made less ambigous after WebView
        // is fixed so geolocation can be removed there. After that, this
        // should be updated to read similarly to GetUserMediaInsecureOrigin's
        // message.
        return "getCurrentPosition() and watchPosition() are deprecated on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case UseCounter::GetUserMediaInsecureOrigin:
    case UseCounter::GetUserMediaInsecureOriginIframe:
        return "getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case UseCounter::EncryptedMediaInsecureOrigin:
        return "requestMediaKeySystemAccess() is deprecated on insecure origins in the specification. Support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case UseCounter::ApplicationCacheManifestSelectInsecureOrigin:
    case UseCounter::ApplicationCacheAPIInsecureOrigin:
        return "Use of the Application Cache is deprecated on insecure origins. Support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.";

    case UseCounter::ElementCreateShadowRootMultiple:
        return "Calling Element.createShadowRoot() for an element which already hosts a shadow root is deprecated. See https://www.chromestatus.com/features/4668884095336448 for more details.";

    case UseCounter::ElementCreateShadowRootMultipleWithUserAgentShadowRoot:
        return "Calling Element.createShadowRoot() for an element which already hosts a user-agent shadow root is deprecated. See https://www.chromestatus.com/features/4668884095336448 for more details.";

    case UseCounter::CSSDeepCombinator:
        return "/deep/ combinator is deprecated. See https://www.chromestatus.com/features/6750456638341120 for more details.";

    case UseCounter::CSSSelectorPseudoShadow:
        return "::shadow pseudo-element is deprecated. See https://www.chromestatus.com/features/6750456638341120 for more details.";

    case UseCounter::SVGSMILElementInDocument:
    case UseCounter::SVGSMILAnimationInImageRegardlessOfCache:
        return "SVG's SMIL animations (<animate>, <set>, etc.) are deprecated and will be removed. Please use CSS animations or Web animations instead.";

    case UseCounter::PrefixedPerformanceClearResourceTimings:
        return replacedBy("'Performance.webkitClearResourceTimings'", "'Performance.clearResourceTimings'");

    case UseCounter::PrefixedPerformanceSetResourceTimingBufferSize:
        return replacedBy("'Performance.webkitSetResourceTimingBufferSize'", "'Performance.setResourceTimingBufferSize'");

    case UseCounter::PrefixedPerformanceResourceTimingBufferFull:
        return replacedBy("'Performance.onwebkitresourcetimingbufferfull'", "'Performance.onresourcetimingbufferfull'");

    case UseCounter::BluetoothDeviceInstanceId:
        return replacedBy("'BluetoothDevice.instanceID'", "'BluetoothDevice.id'");

    case UseCounter::BluetoothDeviceConnectGATT:
        return replacedWillBeRemoved("'BluetoothDevice.connectGATT'", "'BluetoothDevice.gatt.connect'", 52, "5264933985976320");

    case UseCounter::MediaStreamTrackGetSources:
        return "MediaStreamTrack.getSources is deprecated. See https://www.chromestatus.com/feature/4765305641369600 for more details.";

    case UseCounter::V8TouchEvent_InitTouchEvent_Method:
        return replacedWillBeRemoved("'TouchEvent.initTouchEvent'", "the TouchEvent constructor", 53, "5730982598541312");

    case UseCounter::ObjectObserve:
        return willBeRemoved("'Object.observe'", 50, "6147094632988672");

    case UseCounter::SVGZoomEvent:
        return willBeRemoved("'SVGZoomEvent'", 52, "5760883808534528");

    case UseCounter::BorderImageWithBorderStyleNone:
        return "Elements using the 'border-image' CSS property with no 'border-style' set should have no border, but currently do. Setting 'border-style' will be required in M51, around May 2016. See https://www.chromestatus.com/features/5542503914668032 for more details.";

    case UseCounter::WebAnimationHyphenatedProperty:
        return "Hyphenated property names in Web Animations keyframes are invalid and therefore ignored. Please use camelCase instead.";

    case UseCounter::PresentationConnectionStateChangeEventListener:
        return replacedWillBeRemoved("'PresentationConnection.onstateachange'", "'PresentationConnection.on{connect,close,terminate}'", 51, "5662456714100736");

    case UseCounter::HTMLKeygenElement:
        return willBeRemoved("The <keygen> element", 54, "5716060992962560");

    case UseCounter::ResultsAttribute:
        return willBeRemoved("'results' attribute", 53, "5738199536107520");

    // Features that aren't deprecated don't have a deprecation message.
    default:
        return String();
    }
}