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

Unified Diff: third_party/WebKit/Source/core/frame/Deprecation.cpp

Issue 1585383003: Add deprecation message for -webkit-background-composite (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/Deprecation.cpp
diff --git a/third_party/WebKit/Source/core/fetch/FetchInitiatorInfo.h b/third_party/WebKit/Source/core/frame/Deprecation.cpp
similarity index 51%
copy from third_party/WebKit/Source/core/fetch/FetchInitiatorInfo.h
copy to third_party/WebKit/Source/core/frame/Deprecation.cpp
index a9490a48debeacfcc707d7db9ec86653070981b3..484b6131008657172ad863fed43ce3014b369df0 100644
--- a/third_party/WebKit/Source/core/fetch/FetchInitiatorInfo.h
+++ b/third_party/WebKit/Source/core/frame/Deprecation.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Google, Inc. All rights reserved.
+ * Copyright (C) 2016 Google, Inc. All rights reserved.
Timothy Loh 2016/01/25 00:40:00 short license?
nainar 2016/01/25 03:48:24 Done.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,55 +23,48 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef FetchInitiatorInfo_h
-#define FetchInitiatorInfo_h
+#include "core/frame/Deprecation.h"
-#include "wtf/Allocator.h"
-#include "wtf/text/AtomicString.h"
-#include "wtf/text/TextPosition.h"
+#include "core/frame/FrameConsole.h"
+#include "core/frame/FrameHost.h"
+#include "core/frame/LocalFrame.h"
+#include "core/frame/UseCounter.h"
+#include "core/inspector/ConsoleMessage.h"
namespace blink {
-struct FetchInitiatorInfo {
- DISALLOW_NEW();
- FetchInitiatorInfo()
- : name()
- , position(TextPosition::belowRangePosition())
- , startTime(0.0)
- {
- }
+Deprecation::Deprecation()
+{
+ m_CSSPropertyDeprecationBits.ensureSize(lastUnresolvedCSSProperty + 1);
+ m_CSSPropertyDeprecationBits.clearAll();
+}
- // When adding members, CrossThreadFetchInitiatorInfoData should be
- // updated.
- AtomicString name;
- TextPosition position;
- double startTime;
-};
+Deprecation::~Deprecation()
+{
+ m_CSSPropertyDeprecationBits.clearAll();
+}
-// Encode AtomicString as String to cross threads.
-struct CrossThreadFetchInitiatorInfoData {
- DISALLOW_NEW();
- explicit CrossThreadFetchInitiatorInfoData(const FetchInitiatorInfo& info)
- : name(info.name.string().isolatedCopy())
- , position(info.position)
- , startTime(info.startTime)
- {
- }
+void Deprecation::showConsoleWarning(const LocalFrame* frame, CSSPropertyID propertyID)
+{
+ FrameHost* host = frame ? frame->host() : nullptr;
+ if (!frame && frame->host() && !host->deprecation().isSuppressed(propertyID))
Timothy Loh 2016/01/25 00:40:00 this condition makes no sense :/
alancutter (OOO until 2018) 2016/01/25 03:13:36 I think you want: if (!host || host->deprecation(
nainar 2016/01/25 03:48:24 Fixed.
+ return;
- operator FetchInitiatorInfo() const
- {
- FetchInitiatorInfo info;
- info.name = AtomicString(name);
- info.position = position;
- info.startTime = startTime;
- return info;
+ String message = deprecationMessage(propertyID);
+ if (!message.isEmpty()) {
+ host->deprecation().suppress(propertyID);
+ frame->console().addMessage(ConsoleMessage::create(DeprecationMessageSource, WarningMessageLevel, message));
}
+}
- String name;
- TextPosition position;
- double startTime;
-};
+String Deprecation::deprecationMessage(CSSPropertyID cssPropertyID)
+{
+ switch (cssPropertyID) {
+ case CSSPropertyWebkitBackgroundComposite:
+ return UseCounter::willBeRemoved("'-webkit-background-composite'", 51, "6607299456008192");
+ default:
+ return emptyString();
+ }
+}
} // namespace blink
-
-#endif

Powered by Google App Engine
This is Rietveld 408576698