Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/frame/Deprecation.h" | 5 #include "core/frame/Deprecation.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/dom/ExecutionContext.h" | 8 #include "core/dom/ExecutionContext.h" |
| 9 #include "core/frame/FrameConsole.h" | 9 #include "core/frame/FrameConsole.h" |
| 10 #include "core/frame/FrameHost.h" | 10 #include "core/frame/FrameHost.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 | 47 |
| 48 String willBeRemoved(const char* feature, | 48 String willBeRemoved(const char* feature, |
| 49 Milestone milestone, | 49 Milestone milestone, |
| 50 const char* details) { | 50 const char* details) { |
| 51 return String::format( | 51 return String::format( |
| 52 "%s is deprecated and will be removed in %s. See " | 52 "%s is deprecated and will be removed in %s. See " |
| 53 "https://www.chromestatus.com/features/%s for more details.", | 53 "https://www.chromestatus.com/features/%s for more details.", |
| 54 feature, milestoneString(milestone), details); | 54 feature, milestoneString(milestone), details); |
| 55 } | 55 } |
| 56 | 56 |
| 57 #if 0 | |
|
foolip
2016/11/21 20:35:38
Yeah, I guess this works. I have deleted one of th
| |
| 58 // TODO(jsbell): Currently unused, but likely to be needed in the future. | |
| 57 String replacedWillBeRemoved(const char* feature, | 59 String replacedWillBeRemoved(const char* feature, |
| 58 const char* replacement, | 60 const char* replacement, |
| 59 Milestone milestone, | 61 Milestone milestone, |
| 60 const char* details) { | 62 const char* details) { |
| 61 return String::format( | 63 return String::format( |
| 62 "%s is deprecated and will be removed in %s. Please use %s instead. See " | 64 "%s is deprecated and will be removed in %s. Please use %s instead. See " |
| 63 "https://www.chromestatus.com/features/%s for more details.", | 65 "https://www.chromestatus.com/features/%s for more details.", |
| 64 feature, milestoneString(milestone), replacement, details); | 66 feature, milestoneString(milestone), replacement, details); |
| 65 } | 67 } |
| 68 #endif | |
| 66 | 69 |
| 67 } // anonymous namespace | 70 } // anonymous namespace |
| 68 | 71 |
| 69 namespace blink { | 72 namespace blink { |
| 70 | 73 |
| 71 Deprecation::Deprecation() : m_muteCount(0) { | 74 Deprecation::Deprecation() : m_muteCount(0) { |
| 72 m_cssPropertyDeprecationBits.ensureSize(lastUnresolvedCSSProperty + 1); | 75 m_cssPropertyDeprecationBits.ensureSize(lastUnresolvedCSSProperty + 1); |
| 73 } | 76 } |
| 74 | 77 |
| 75 Deprecation::~Deprecation() {} | 78 Deprecation::~Deprecation() {} |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 "'Document.exitFullscreen()'"); | 233 "'Document.exitFullscreen()'"); |
| 231 | 234 |
| 232 case UseCounter::PrefixedVideoEnterFullScreen: | 235 case UseCounter::PrefixedVideoEnterFullScreen: |
| 233 return replacedBy("'HTMLVideoElement.webkitEnterFullScreen()'", | 236 return replacedBy("'HTMLVideoElement.webkitEnterFullScreen()'", |
| 234 "'Element.requestFullscreen()'"); | 237 "'Element.requestFullscreen()'"); |
| 235 | 238 |
| 236 case UseCounter::PrefixedVideoExitFullScreen: | 239 case UseCounter::PrefixedVideoExitFullScreen: |
| 237 return replacedBy("'HTMLVideoElement.webkitExitFullScreen()'", | 240 return replacedBy("'HTMLVideoElement.webkitExitFullScreen()'", |
| 238 "'Document.exitFullscreen()'"); | 241 "'Document.exitFullscreen()'"); |
| 239 | 242 |
| 240 case UseCounter::PrefixedIndexedDB: | |
| 241 return replacedWillBeRemoved("'webkitIndexedDB'", "'indexedDB'", M57, | |
| 242 "5775330191081472"); | |
| 243 | |
| 244 case UseCounter::PrefixedIDBCursorConstructor: | |
| 245 return replacedWillBeRemoved("'webkitIDBCursor'", "'IDBCursor'", M57, | |
| 246 "5775330191081472"); | |
| 247 | |
| 248 case UseCounter::PrefixedIDBDatabaseConstructor: | |
| 249 return replacedWillBeRemoved("'webkitIDBDatabase'", "'IDBDatabase'", M57, | |
| 250 "5775330191081472"); | |
| 251 | |
| 252 case UseCounter::PrefixedIDBFactoryConstructor: | |
| 253 return replacedWillBeRemoved("'webkitIDBFactory'", "'IDBFactory'", M57, | |
| 254 "5775330191081472"); | |
| 255 | |
| 256 case UseCounter::PrefixedIDBIndexConstructor: | |
| 257 return replacedWillBeRemoved("'webkitIDBIndex'", "'IDBIndex'", M57, | |
| 258 "5775330191081472"); | |
| 259 | |
| 260 case UseCounter::PrefixedIDBKeyRangeConstructor: | |
| 261 return replacedWillBeRemoved("'webkitIDBKeyRange'", "'IDBKeyRange'", M57, | |
| 262 "5775330191081472"); | |
| 263 | |
| 264 case UseCounter::PrefixedIDBObjectStoreConstructor: | |
| 265 return replacedWillBeRemoved("'webkitIDBObjectStore'", "'IDBObjectStore'", | |
| 266 M57, "5775330191081472"); | |
| 267 | |
| 268 case UseCounter::PrefixedIDBRequestConstructor: | |
| 269 return replacedWillBeRemoved("'webkitIDBRequest'", "'IDBRequest'", M57, | |
| 270 "5775330191081472"); | |
| 271 | |
| 272 case UseCounter::PrefixedIDBTransactionConstructor: | |
| 273 return replacedWillBeRemoved("'webkitIDBTransaction'", "'IDBTransaction'", | |
| 274 M57, "5775330191081472"); | |
| 275 | |
| 276 case UseCounter::PrefixedRequestAnimationFrame: | 243 case UseCounter::PrefixedRequestAnimationFrame: |
| 277 return "'webkitRequestAnimationFrame' is vendor-specific. Please use the " | 244 return "'webkitRequestAnimationFrame' is vendor-specific. Please use the " |
| 278 "standard 'requestAnimationFrame' instead."; | 245 "standard 'requestAnimationFrame' instead."; |
| 279 | 246 |
| 280 case UseCounter::PrefixedCancelAnimationFrame: | 247 case UseCounter::PrefixedCancelAnimationFrame: |
| 281 return "'webkitCancelAnimationFrame' is vendor-specific. Please use the " | 248 return "'webkitCancelAnimationFrame' is vendor-specific. Please use the " |
| 282 "standard 'cancelAnimationFrame' instead."; | 249 "standard 'cancelAnimationFrame' instead."; |
| 283 | 250 |
| 284 case UseCounter::PictureSourceSrc: | 251 case UseCounter::PictureSourceSrc: |
| 285 return "<source src> with a <picture> parent is invalid and therefore " | 252 return "<source src> with a <picture> parent is invalid and therefore " |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 447 return willBeRemoved("HTMLObjectElement legacy caller", M58, | 414 return willBeRemoved("HTMLObjectElement legacy caller", M58, |
| 448 "5715026367217664"); | 415 "5715026367217664"); |
| 449 | 416 |
| 450 // Features that aren't deprecated don't have a deprecation message. | 417 // Features that aren't deprecated don't have a deprecation message. |
| 451 default: | 418 default: |
| 452 return String(); | 419 return String(); |
| 453 } | 420 } |
| 454 } | 421 } |
| 455 | 422 |
| 456 } // namespace blink | 423 } // namespace blink |
| OLD | NEW |