Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: third_party/WebKit/Source/core/frame/Deprecation.cpp

Issue 2681723003: Add a deprecation warning for notifications on insecure contexts. (Closed)
Patch Set: Rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "core/frame/LocalFrame.h" 11 #include "core/frame/LocalFrame.h"
12 #include "core/inspector/ConsoleMessage.h" 12 #include "core/inspector/ConsoleMessage.h"
13 #include "core/workers/WorkerOrWorkletGlobalScope.h" 13 #include "core/workers/WorkerOrWorkletGlobalScope.h"
14 14
15 namespace { 15 namespace {
16 16
17 enum Milestone { 17 enum Milestone {
18 M56, 18 M56,
19 M57, 19 M57,
20 M58, 20 M58,
21 M59, 21 M59,
22 M60,
22 }; 23 };
23 24
24 const char* milestoneString(Milestone milestone) { 25 const char* milestoneString(Milestone milestone) {
25 // These are the Estimated Stable Dates: 26 // These are the Estimated Stable Dates:
26 // https://www.chromium.org/developers/calendar 27 // https://www.chromium.org/developers/calendar
27 28
28 switch (milestone) { 29 switch (milestone) {
29 case M56: 30 case M56:
30 return "M56, around January 2017"; 31 return "M56, around January 2017";
31 case M57: 32 case M57:
32 return "M57, around March 2017"; 33 return "M57, around March 2017";
33 case M58: 34 case M58:
34 return "M58, around April 2017"; 35 return "M58, around April 2017";
35 case M59: 36 case M59:
36 return "M59, around June 2017"; 37 return "M59, around June 2017";
38 case M60:
39 return "M60, around August 2017";
37 } 40 }
38 41
39 ASSERT_NOT_REACHED(); 42 ASSERT_NOT_REACHED();
40 return nullptr; 43 return nullptr;
41 } 44 }
42 45
43 String replacedBy(const char* feature, const char* replacement) { 46 String replacedBy(const char* feature, const char* replacement) {
44 return String::format("%s is deprecated. Please use %s instead.", feature, 47 return String::format("%s is deprecated. Please use %s instead.", feature,
45 replacement); 48 replacement);
46 } 49 }
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 "https://www.chromestatus.com/features/6107495151960064 for more " 350 "https://www.chromestatus.com/features/6107495151960064 for more "
348 "details."; 351 "details.";
349 352
350 case UseCounter::ApplicationCacheManifestSelectInsecureOrigin: 353 case UseCounter::ApplicationCacheManifestSelectInsecureOrigin:
351 case UseCounter::ApplicationCacheAPIInsecureOrigin: 354 case UseCounter::ApplicationCacheAPIInsecureOrigin:
352 return "Use of the Application Cache is deprecated on insecure origins. " 355 return "Use of the Application Cache is deprecated on insecure origins. "
353 "Support will be removed in the future. You should consider " 356 "Support will be removed in the future. You should consider "
354 "switching your application to a secure origin, such as HTTPS. " 357 "switching your application to a secure origin, such as HTTPS. "
355 "See https://goo.gl/rStTGz for more details."; 358 "See https://goo.gl/rStTGz for more details.";
356 359
360 case UseCounter::NotificationInsecureOrigin:
361 case UseCounter::NotificationAPIInsecureOriginIframe:
362 case UseCounter::NotificationPermissionRequestedInsecureOrigin:
363 return String::format(
364 "Using the Notification API on insecure origins is "
365 "deprecated and will be removed in %s. You should consider "
366 "switching your application to a secure origin, such as HTTPS. See "
367 "https://goo.gl/rStTGz for more details.",
368 milestoneString(M60));
369
357 case UseCounter::ElementCreateShadowRootMultiple: 370 case UseCounter::ElementCreateShadowRootMultiple:
358 return "Calling Element.createShadowRoot() for an element which already " 371 return "Calling Element.createShadowRoot() for an element which already "
359 "hosts a shadow root is deprecated. See " 372 "hosts a shadow root is deprecated. See "
360 "https://www.chromestatus.com/features/4668884095336448 for more " 373 "https://www.chromestatus.com/features/4668884095336448 for more "
361 "details."; 374 "details.";
362 375
363 case UseCounter::CSSDeepCombinator: 376 case UseCounter::CSSDeepCombinator:
364 return "/deep/ combinator is deprecated. See " 377 return "/deep/ combinator is deprecated. See "
365 "https://www.chromestatus.com/features/6750456638341120 for more " 378 "https://www.chromestatus.com/features/6750456638341120 for more "
366 "details."; 379 "details.";
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 "-internal-media-controls-text-track-list* selectors", M59, 430 "-internal-media-controls-text-track-list* selectors", M59,
418 "5661431349379072"); 431 "5661431349379072");
419 432
420 // Features that aren't deprecated don't have a deprecation message. 433 // Features that aren't deprecated don't have a deprecation message.
421 default: 434 default:
422 return String(); 435 return String();
423 } 436 }
424 } 437 }
425 438
426 } // namespace blink 439 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698