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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 String replacedBy(const char* feature, const char* replacement) | 50 String replacedBy(const char* feature, const char* replacement) |
51 { | 51 { |
52 return String::format("%s is deprecated. Please use %s instead.", feature, r
eplacement); | 52 return String::format("%s is deprecated. Please use %s instead.", feature, r
eplacement); |
53 } | 53 } |
54 | 54 |
55 String willBeRemoved(const char* feature, Milestone milestone, const char* detai
ls) | 55 String willBeRemoved(const char* feature, Milestone milestone, const char* detai
ls) |
56 { | 56 { |
57 return String::format("%s is deprecated and will be removed in %s. See https
://www.chromestatus.com/features/%s for more details.", feature, milestoneString
(milestone), details); | 57 return String::format("%s is deprecated and will be removed in %s. See https
://www.chromestatus.com/features/%s for more details.", feature, milestoneString
(milestone), details); |
58 } | 58 } |
59 | 59 |
60 String dopplerWillBeRemoved(const char* feature, Milestone milestone, const char
* details) | |
61 { | |
62 return String::format("%s is deprecated and will be removed in %s. It has no
effect as the Web Audio doppler effects have already been removed internally. S
ee https://www.chromestatus.com/features/%s for more details.", feature, milesto
neString(milestone), details); | |
63 } | |
64 | |
65 } // anonymous namespace | 60 } // anonymous namespace |
66 | 61 |
67 namespace blink { | 62 namespace blink { |
68 | 63 |
69 Deprecation::Deprecation() | 64 Deprecation::Deprecation() |
70 : m_muteCount(0) | 65 : m_muteCount(0) |
71 { | 66 { |
72 m_cssPropertyDeprecationBits.ensureSize(lastUnresolvedCSSProperty + 1); | 67 m_cssPropertyDeprecationBits.ensureSize(lastUnresolvedCSSProperty + 1); |
73 } | 68 } |
74 | 69 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 253 |
259 case UseCounter::ConsoleTimelineEnd: | 254 case UseCounter::ConsoleTimelineEnd: |
260 return replacedBy("'console.timelineEnd'", "'console.timeEnd'"); | 255 return replacedBy("'console.timelineEnd'", "'console.timeEnd'"); |
261 | 256 |
262 case UseCounter::XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload: | 257 case UseCounter::XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload: |
263 return "Synchronous XMLHttpRequest on the main thread is deprecated beca
use of its detrimental effects to the end user's experience. For more help, chec
k https://xhr.spec.whatwg.org/."; | 258 return "Synchronous XMLHttpRequest on the main thread is deprecated beca
use of its detrimental effects to the end user's experience. For more help, chec
k https://xhr.spec.whatwg.org/."; |
264 | 259 |
265 case UseCounter::GetMatchedCSSRules: | 260 case UseCounter::GetMatchedCSSRules: |
266 return "'getMatchedCSSRules()' is deprecated. For more help, check https
://code.google.com/p/chromium/issues/detail?id=437569#c2"; | 261 return "'getMatchedCSSRules()' is deprecated. For more help, check https
://code.google.com/p/chromium/issues/detail?id=437569#c2"; |
267 | 262 |
268 case UseCounter::AudioListenerDopplerFactor: | |
269 return dopplerWillBeRemoved("'AudioListener.dopplerFactor'", M55, "52389
26818148352"); | |
270 | |
271 case UseCounter::AudioListenerSpeedOfSound: | |
272 return dopplerWillBeRemoved("'AudioListener.speedOfSound'", M55, "523892
6818148352"); | |
273 | |
274 case UseCounter::AudioListenerSetVelocity: | |
275 return dopplerWillBeRemoved("'AudioListener.setVelocity()'", M55, "52389
26818148352"); | |
276 | |
277 case UseCounter::PannerNodeSetVelocity: | |
278 return dopplerWillBeRemoved("'PannerNode.setVelocity()'", M55, "52389268
18148352"); | |
279 | |
280 case UseCounter::PrefixedWindowURL: | 263 case UseCounter::PrefixedWindowURL: |
281 return replacedBy("'webkitURL'", "'URL'"); | 264 return replacedBy("'webkitURL'", "'URL'"); |
282 | 265 |
283 case UseCounter::PrefixedAudioContext: | 266 case UseCounter::PrefixedAudioContext: |
284 return replacedBy("'webkitAudioContext'", "'AudioContext'"); | 267 return replacedBy("'webkitAudioContext'", "'AudioContext'"); |
285 | 268 |
286 case UseCounter::PrefixedOfflineAudioContext: | 269 case UseCounter::PrefixedOfflineAudioContext: |
287 return replacedBy("'webkitOfflineAudioContext'", "'OfflineAudioContext'"
); | 270 return replacedBy("'webkitOfflineAudioContext'", "'OfflineAudioContext'"
); |
288 | 271 |
289 case UseCounter::RangeExpand: | 272 case UseCounter::RangeExpand: |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 case UseCounter::ScriptInvalidTypeOrLanguage: | 369 case UseCounter::ScriptInvalidTypeOrLanguage: |
387 return willBeRemoved("Fetching scripts with an invalid type/language att
ributes", M56, "5760718284521472"); | 370 return willBeRemoved("Fetching scripts with an invalid type/language att
ributes", M56, "5760718284521472"); |
388 | 371 |
389 // Features that aren't deprecated don't have a deprecation message. | 372 // Features that aren't deprecated don't have a deprecation message. |
390 default: | 373 default: |
391 return String(); | 374 return String(); |
392 } | 375 } |
393 } | 376 } |
394 | 377 |
395 } // namespace blink | 378 } // namespace blink |
OLD | NEW |